PSPSDK 2026-10-30
Loading...
Searching...
No Matches
pspusbgps.h
Go to the documentation of this file.
1/*
2 * PSP Software Development Kit - https://github.com/pspdev
3 * -----------------------------------------------------------------------
4 * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5 *
6 * pspusbgps.h - Prototypes for the sceUsbGps library
7 *
8 */
9#ifndef __PSPUSBGPS_H__
10#define __PSPUSBGPS_H__
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16#include <psptypes.h>
17
18#define PSP_USBGPS_PID (0x283)
19#define PSP_USBGPS_DRIVERNAME "USBGps_Driver"
20
22#define PSP_USBGPS_NUM_SATELLITE (32)
23
24/* Error codes returned by the sceUsbGps functions */
25#define PSP_USBGPS_ERROR_NOT_STARTED (0x80244001)
26#define PSP_USBGPS_ERROR_NOT_OPENED (0x80244002)
27#define PSP_USBGPS_ERROR_ALREADY_OPENED (0x80244003)
28#define PSP_USBGPS_ERROR_NOT_AVAILABLE (0x80244004)
29#define PSP_USBGPS_ERROR_BUSY (0x80244005)
30#define PSP_USBGPS_ERROR_PRIV_REQUIRED (0x80244006)
31#define PSP_USBGPS_ERROR_INVALID_PARAM (0x80244007)
32#define PSP_USBGPS_ERROR_FATAL (0x80244010)
33#define PSP_USBGPS_ERROR_NO_INIT_DATA (0x802440FF)
34
47
58
69
78
85
97
114
133
159
175
185
198
207
219
233
247
259
273
285
300
317
330int sceUsbGpsGetPowerSaveMode(u32 *mode, u32 *interval);
331
343
364int sceUsbGpsResetInitialPosition(float latitude, float longitude, float altitude, float geoidsep);
365
366#ifdef __cplusplus
367}
368#endif
369
370#endif
uint8_t u8
Definition psptypes.h:38
uint16_t u16
Definition psptypes.h:39
uint32_t u32
Definition psptypes.h:41
struct SceUsbGpsSatelliteData SceUsbGpsSatelliteData
Satellite information returned by sceUsbGpsGetData.
int sceUsbGpsOpen(void)
Initializes the GPS driver and starts GPS receiver operation.
int sceUsbGpsGetPowerSaveMode(u32 *mode, u32 *interval)
Gets the current GPS receiver power-save settings.
PspUsbGpsPositionQuality
Positioning quality.
Definition pspusbgps.h:50
@ PSP_USBGPS_POSITION_QUALITY_GPS
GPS single point positioning.
Definition pspusbgps.h:54
@ PSP_USBGPS_POSITION_QUALITY_NOT_AVAILABLE
The position cannot be determined.
Definition pspusbgps.h:52
@ PSP_USBGPS_POSITION_QUALITY_DGPS
Differential GPS positioning.
Definition pspusbgps.h:56
int sceUsbGpsGetStaticNavMode(u8 *mode)
Gets the current static navigation mode.
PspUsbGpsState
GPS receiver states returned by sceUsbGpsGetState.
Definition pspusbgps.h:37
@ PSP_USBGPS_STATE_NOT_ACCESSORY
Something other than a PSP accessory is connected.
Definition pspusbgps.h:41
@ PSP_USBGPS_STATE_NOT_AVAILABLE
No GPS receiver is connected.
Definition pspusbgps.h:39
@ PSP_USBGPS_STATE_BUSY
The GPS receiver is initializing.
Definition pspusbgps.h:43
@ PSP_USBGPS_STATE_WORKING
The GPS receiver is up and running.
Definition pspusbgps.h:45
struct SceUsbGpsSv SceUsbGpsSv
Information about a single GPS satellite.
int sceUsbGpsGetInitDataLocation(u32 *datalocation)
Gets the file currently selected for the GPS init (assistance) data.
PspUsbGpsPositionMode
Positioning modes.
Definition pspusbgps.h:61
@ PSP_USBGPS_POSITION_MODE_2D
2D positioning (latitude/longitude)
Definition pspusbgps.h:65
@ PSP_USBGPS_POSITION_MODE_3D
3D positioning (latitude/longitude/altitude)
Definition pspusbgps.h:67
@ PSP_USBGPS_POSITION_MODE_NOT_AVAILABLE
Positioning cannot be performed.
Definition pspusbgps.h:63
int sceUsbGpsSetInitDataLocation(u32 datalocation)
Selects the file the GPS init (assistance) data is loaded from when the receiver starts and saved to ...
int sceUsbGpsClose(void)
Stops GPS receiver operation and shuts down the GPS driver.
PspUsbGpsInitDataLocation
Storage locations for the GPS init data file, used by sceUsbGpsSetInitDataLocation and sceUsbGpsGetIn...
Definition pspusbgps.h:89
@ PSP_USBGPS_INIT_DATA_LOCATION_MS0
ms0:gps_init_data.bin
Definition pspusbgps.h:93
@ PSP_USBGPS_INIT_DATA_LOCATION_FLASH1
flash1:/gps/init_data.bin (default)
Definition pspusbgps.h:91
@ PSP_USBGPS_INIT_DATA_LOCATION_HOST0
host0:.
Definition pspusbgps.h:95
int sceUsbGpsGetState(u32 *state)
Gets the state of the GPS receiver.
PspUsbGpsPowerSaveMode
Power-save modes for sceUsbGpsSetPowerSaveMode.
Definition pspusbgps.h:102
@ PSP_USBGPS_POWER_SAVE_MODE_ACTIVE_LIGHT
Sleeps a little when active, full power when idle.
Definition pspusbgps.h:112
@ PSP_USBGPS_POWER_SAVE_MODE_MAX
Sleeps a little when active, sleeps a lot when idle.
Definition pspusbgps.h:110
@ PSP_USBGPS_POWER_SAVE_MODE_IDLE_LIGHT
Full power when active, sleeps a little between fixes when idle.
Definition pspusbgps.h:106
@ PSP_USBGPS_POWER_SAVE_MODE_IDLE_DEEP
Full power when active, sleeps a lot between fixes when idle.
Definition pspusbgps.h:108
@ PSP_USBGPS_POWER_SAVE_MODE_OFF
No power saving.
Definition pspusbgps.h:104
struct SceUsbGpsPositionData SceUsbGpsPositionData
Position information returned by sceUsbGpsGetData.
int sceUsbGpsSetPowerSaveMode(u32 mode, u32 interval)
Sets the GPS receiver power-save mode.
int sceUsbGpsReset(u32 type)
Restarts the GPS receiver at the given reset level, controlling how much of its acquired data is disc...
PspUsbGpsStaticNavMode
Static navigation modes for sceUsbGpsSetStaticNavMode.
Definition pspusbgps.h:81
@ PSP_USBGPS_STATIC_NAV_MODE_ENABLE
Definition pspusbgps.h:83
@ PSP_USBGPS_STATIC_NAV_MODE_DISABLE
Definition pspusbgps.h:82
PspUsbGpsResetType
Receiver reset levels for sceUsbGpsReset, ordered from most to least data discarded.
Definition pspusbgps.h:119
@ PSP_USBGPS_RESET_WARM
Warm start: discard ephemeris only, keeping almanac, last position and time.
Definition pspusbgps.h:125
@ PSP_USBGPS_RESET_HOT_SEEDED
Hot start: restart from the last known position and the current time supplied by the PSP.
Definition pspusbgps.h:131
@ PSP_USBGPS_RESET_COLD
Cold start: discard the ephemeris, almanac, last position and time held in memory.
Definition pspusbgps.h:122
@ PSP_USBGPS_RESET_HOT
Hot start: restart from the position and time retained in the receiver.
Definition pspusbgps.h:128
#define PSP_USBGPS_NUM_SATELLITE
Maximum number of satellites reported in SceUsbGpsSatelliteData.
Definition pspusbgps.h:22
int sceUsbGpsSaveInitData(void)
Saves the GPS init (assistance) data to the file selected with sceUsbGpsSetInitDataLocation.
PspUsbGpsSatelliteFlag
Satellite usage flags.
Definition pspusbgps.h:72
@ PSP_USBGPS_SATELLITE_USED
The satellite is used for the position fix.
Definition pspusbgps.h:76
@ PSP_USBGPS_SATELLITE_NOT_USED
The satellite is not used for the position fix.
Definition pspusbgps.h:74
int sceUsbGpsSetStaticNavMode(u8 mode)
Sets the static navigation mode.
int sceUsbGpsResetInitialPosition(float latitude, float longitude, float altitude, float geoidsep)
Seeds the GPS receiver with a known starting position to shorten the time to first fix.
int sceUsbGpsGetData(SceUsbGpsPositionData *pos, SceUsbGpsSatelliteData *sat)
Gets position and satellite information.
Definition psptypes.h:420
Position information returned by sceUsbGpsGetData.
Definition pspusbgps.h:135
ScePspDateTime datetime
Date and time of the fix (UTC)
Definition pspusbgps.h:137
float longitude
Longitude in degrees, west negative.
Definition pspusbgps.h:149
float reserve1
Reserved.
Definition pspusbgps.h:153
u8 mode
Positioning mode.
Definition pspusbgps.h:143
float hdop
Horizontal dilution of precision.
Definition pspusbgps.h:139
float latitude
Latitude in degrees, south negative.
Definition pspusbgps.h:147
float altitude
Height above sea level in meters.
Definition pspusbgps.h:151
u8 reserve0[2]
Reserved.
Definition pspusbgps.h:145
float course
Direction of travel in degrees.
Definition pspusbgps.h:157
float speed
Ground speed in km/h.
Definition pspusbgps.h:155
u8 quality
Positioning quality.
Definition pspusbgps.h:141
Satellite information returned by sceUsbGpsGetData.
Definition pspusbgps.h:177
u8 reserve[3]
Reserved.
Definition pspusbgps.h:181
SceUsbGpsSv sv_view[(32)]
Details of each satellite in view.
Definition pspusbgps.h:183
u8 num_sv_view
Number of satellites in view.
Definition pspusbgps.h:179
Information about a single GPS satellite.
Definition pspusbgps.h:161
u8 used
Whether the satellite is used for the fix.
Definition pspusbgps.h:171
u8 reserve[2]
Reserved.
Definition pspusbgps.h:173
u16 azimuth
Azimuth in degrees.
Definition pspusbgps.h:167
u8 snr
Signal-to-noise ratio in dBHz.
Definition pspusbgps.h:169
u8 id
Satellite ID.
Definition pspusbgps.h:163
u8 elev
Angle of elevation in degrees.
Definition pspusbgps.h:165