PSPSDK 2026-10-30
Loading...
Searching...
No Matches
pspusbgps.h File Reference
#include <psptypes.h>
Include dependency graph for pspusbgps.h:

Go to the source code of this file.

Data Structures

struct  SceUsbGpsPositionData
 Position information returned by sceUsbGpsGetData. More...
 
struct  SceUsbGpsSv
 Information about a single GPS satellite. More...
 
struct  SceUsbGpsSatelliteData
 Satellite information returned by sceUsbGpsGetData. More...
 

Macros

#define PSP_USBGPS_PID   (0x283)
 
#define PSP_USBGPS_DRIVERNAME   "USBGps_Driver"
 
#define PSP_USBGPS_NUM_SATELLITE   (32)
 Maximum number of satellites reported in SceUsbGpsSatelliteData.
 
#define PSP_USBGPS_ERROR_NOT_STARTED   (0x80244001)
 
#define PSP_USBGPS_ERROR_NOT_OPENED   (0x80244002)
 
#define PSP_USBGPS_ERROR_ALREADY_OPENED   (0x80244003)
 
#define PSP_USBGPS_ERROR_NOT_AVAILABLE   (0x80244004)
 
#define PSP_USBGPS_ERROR_BUSY   (0x80244005)
 
#define PSP_USBGPS_ERROR_PRIV_REQUIRED   (0x80244006)
 
#define PSP_USBGPS_ERROR_INVALID_PARAM   (0x80244007)
 
#define PSP_USBGPS_ERROR_FATAL   (0x80244010)
 
#define PSP_USBGPS_ERROR_NO_INIT_DATA   (0x802440FF)
 

Typedefs

typedef struct SceUsbGpsPositionData SceUsbGpsPositionData
 Position information returned by sceUsbGpsGetData.
 
typedef struct SceUsbGpsSv SceUsbGpsSv
 Information about a single GPS satellite.
 
typedef struct SceUsbGpsSatelliteData SceUsbGpsSatelliteData
 Satellite information returned by sceUsbGpsGetData.
 

Enumerations

enum  PspUsbGpsState { PSP_USBGPS_STATE_NOT_AVAILABLE = 0 , PSP_USBGPS_STATE_NOT_ACCESSORY = 1 , PSP_USBGPS_STATE_BUSY = 2 , PSP_USBGPS_STATE_WORKING = 3 }
 GPS receiver states returned by sceUsbGpsGetState. More...
 
enum  PspUsbGpsPositionQuality { PSP_USBGPS_POSITION_QUALITY_NOT_AVAILABLE = 0 , PSP_USBGPS_POSITION_QUALITY_GPS = 1 , PSP_USBGPS_POSITION_QUALITY_DGPS = 2 }
 Positioning quality. More...
 
enum  PspUsbGpsPositionMode { PSP_USBGPS_POSITION_MODE_NOT_AVAILABLE = 0 , PSP_USBGPS_POSITION_MODE_2D = 1 , PSP_USBGPS_POSITION_MODE_3D = 2 }
 Positioning modes. More...
 
enum  PspUsbGpsSatelliteFlag { PSP_USBGPS_SATELLITE_NOT_USED = 0 , PSP_USBGPS_SATELLITE_USED = 1 }
 Satellite usage flags. More...
 
enum  PspUsbGpsStaticNavMode { PSP_USBGPS_STATIC_NAV_MODE_DISABLE = 0 , PSP_USBGPS_STATIC_NAV_MODE_ENABLE = 1 }
 Static navigation modes for sceUsbGpsSetStaticNavMode. More...
 
enum  PspUsbGpsInitDataLocation { PSP_USBGPS_INIT_DATA_LOCATION_FLASH1 = 0 , PSP_USBGPS_INIT_DATA_LOCATION_MS0 = 1 , PSP_USBGPS_INIT_DATA_LOCATION_HOST0 = 2 }
 Storage locations for the GPS init data file, used by sceUsbGpsSetInitDataLocation and sceUsbGpsGetInitDataLocation. More...
 
enum  PspUsbGpsPowerSaveMode {
  PSP_USBGPS_POWER_SAVE_MODE_OFF = 0 , PSP_USBGPS_POWER_SAVE_MODE_IDLE_LIGHT = 1 , PSP_USBGPS_POWER_SAVE_MODE_IDLE_DEEP = 2 , PSP_USBGPS_POWER_SAVE_MODE_MAX = 3 ,
  PSP_USBGPS_POWER_SAVE_MODE_ACTIVE_LIGHT = 10
}
 Power-save modes for sceUsbGpsSetPowerSaveMode. More...
 
enum  PspUsbGpsResetType { PSP_USBGPS_RESET_COLD = 0 , PSP_USBGPS_RESET_WARM = 1 , PSP_USBGPS_RESET_HOT = 2 , PSP_USBGPS_RESET_HOT_SEEDED = 3 }
 Receiver reset levels for sceUsbGpsReset, ordered from most to least data discarded. More...
 

Functions

int sceUsbGpsOpen (void)
 Initializes the GPS driver and starts GPS receiver operation.
 
int sceUsbGpsClose (void)
 Stops GPS receiver operation and shuts down the GPS driver.
 
int sceUsbGpsGetState (u32 *state)
 Gets the state of the GPS receiver.
 
int sceUsbGpsGetData (SceUsbGpsPositionData *pos, SceUsbGpsSatelliteData *sat)
 Gets position and satellite information.
 
int sceUsbGpsSetStaticNavMode (u8 mode)
 Sets the static navigation mode.
 
int sceUsbGpsGetStaticNavMode (u8 *mode)
 Gets the current static navigation mode.
 
int sceUsbGpsSetInitDataLocation (u32 datalocation)
 Selects the file the GPS init (assistance) data is loaded from when the receiver starts and saved to by sceUsbGpsSaveInitData.
 
int sceUsbGpsGetInitDataLocation (u32 *datalocation)
 Gets the file currently selected for the GPS init (assistance) data.
 
int sceUsbGpsSaveInitData (void)
 Saves the GPS init (assistance) data to the file selected with sceUsbGpsSetInitDataLocation.
 
int sceUsbGpsSetPowerSaveMode (u32 mode, u32 interval)
 Sets the GPS receiver power-save mode.
 
int sceUsbGpsGetPowerSaveMode (u32 *mode, u32 *interval)
 Gets the current GPS receiver power-save settings.
 
int sceUsbGpsReset (u32 type)
 Restarts the GPS receiver at the given reset level, controlling how much of its acquired data is discarded.
 
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.
 

Macro Definition Documentation

◆ PSP_USBGPS_DRIVERNAME

#define PSP_USBGPS_DRIVERNAME   "USBGps_Driver"

◆ PSP_USBGPS_ERROR_ALREADY_OPENED

#define PSP_USBGPS_ERROR_ALREADY_OPENED   (0x80244003)

◆ PSP_USBGPS_ERROR_BUSY

#define PSP_USBGPS_ERROR_BUSY   (0x80244005)

◆ PSP_USBGPS_ERROR_FATAL

#define PSP_USBGPS_ERROR_FATAL   (0x80244010)

◆ PSP_USBGPS_ERROR_INVALID_PARAM

#define PSP_USBGPS_ERROR_INVALID_PARAM   (0x80244007)

◆ PSP_USBGPS_ERROR_NO_INIT_DATA

#define PSP_USBGPS_ERROR_NO_INIT_DATA   (0x802440FF)

◆ PSP_USBGPS_ERROR_NOT_AVAILABLE

#define PSP_USBGPS_ERROR_NOT_AVAILABLE   (0x80244004)

◆ PSP_USBGPS_ERROR_NOT_OPENED

#define PSP_USBGPS_ERROR_NOT_OPENED   (0x80244002)

◆ PSP_USBGPS_ERROR_NOT_STARTED

#define PSP_USBGPS_ERROR_NOT_STARTED   (0x80244001)

◆ PSP_USBGPS_ERROR_PRIV_REQUIRED

#define PSP_USBGPS_ERROR_PRIV_REQUIRED   (0x80244006)

◆ PSP_USBGPS_NUM_SATELLITE

#define PSP_USBGPS_NUM_SATELLITE   (32)

Maximum number of satellites reported in SceUsbGpsSatelliteData.

◆ PSP_USBGPS_PID

#define PSP_USBGPS_PID   (0x283)

Typedef Documentation

◆ SceUsbGpsPositionData

typedef struct SceUsbGpsPositionData SceUsbGpsPositionData

Position information returned by sceUsbGpsGetData.

◆ SceUsbGpsSatelliteData

typedef struct SceUsbGpsSatelliteData SceUsbGpsSatelliteData

Satellite information returned by sceUsbGpsGetData.

◆ SceUsbGpsSv

typedef struct SceUsbGpsSv SceUsbGpsSv

Information about a single GPS satellite.

Enumeration Type Documentation

◆ PspUsbGpsInitDataLocation

Storage locations for the GPS init data file, used by sceUsbGpsSetInitDataLocation and sceUsbGpsGetInitDataLocation.

Enumerator
PSP_USBGPS_INIT_DATA_LOCATION_FLASH1 

flash1:/gps/init_data.bin (default)

PSP_USBGPS_INIT_DATA_LOCATION_MS0 

ms0:gps_init_data.bin

PSP_USBGPS_INIT_DATA_LOCATION_HOST0 

host0:.

/gps_init_data.bin

◆ PspUsbGpsPositionMode

Positioning modes.

Enumerator
PSP_USBGPS_POSITION_MODE_NOT_AVAILABLE 

Positioning cannot be performed.

PSP_USBGPS_POSITION_MODE_2D 

2D positioning (latitude/longitude)

PSP_USBGPS_POSITION_MODE_3D 

3D positioning (latitude/longitude/altitude)

◆ PspUsbGpsPositionQuality

Positioning quality.

Enumerator
PSP_USBGPS_POSITION_QUALITY_NOT_AVAILABLE 

The position cannot be determined.

PSP_USBGPS_POSITION_QUALITY_GPS 

GPS single point positioning.

PSP_USBGPS_POSITION_QUALITY_DGPS 

Differential GPS positioning.

◆ PspUsbGpsPowerSaveMode

Power-save modes for sceUsbGpsSetPowerSaveMode.

Each selects how much the receiver sleeps between fixes while the PSP is active vs. idle. Sleeping more saves power but reduces the fix frequency.

Enumerator
PSP_USBGPS_POWER_SAVE_MODE_OFF 

No power saving.

The receiver tracks continuously at full power.

PSP_USBGPS_POWER_SAVE_MODE_IDLE_LIGHT 

Full power when active, sleeps a little between fixes when idle.

PSP_USBGPS_POWER_SAVE_MODE_IDLE_DEEP 

Full power when active, sleeps a lot between fixes when idle.

PSP_USBGPS_POWER_SAVE_MODE_MAX 

Sleeps a little when active, sleeps a lot when idle.

PSP_USBGPS_POWER_SAVE_MODE_ACTIVE_LIGHT 

Sleeps a little when active, full power when idle.

◆ PspUsbGpsResetType

Receiver reset levels for sceUsbGpsReset, ordered from most to least data discarded.

Each performs a full receiver restart. They differ only in what acquired data is kept.

Enumerator
PSP_USBGPS_RESET_COLD 

Cold start: discard the ephemeris, almanac, last position and time held in memory.

Slowest to get the next fix.

PSP_USBGPS_RESET_WARM 

Warm start: discard ephemeris only, keeping almanac, last position and time.

PSP_USBGPS_RESET_HOT 

Hot start: restart from the position and time retained in the receiver.

PSP_USBGPS_RESET_HOT_SEEDED 

Hot start: restart from the last known position and the current time supplied by the PSP.

◆ PspUsbGpsSatelliteFlag

Satellite usage flags.

Enumerator
PSP_USBGPS_SATELLITE_NOT_USED 

The satellite is not used for the position fix.

PSP_USBGPS_SATELLITE_USED 

The satellite is used for the position fix.

◆ PspUsbGpsState

GPS receiver states returned by sceUsbGpsGetState.

Enumerator
PSP_USBGPS_STATE_NOT_AVAILABLE 

No GPS receiver is connected.

PSP_USBGPS_STATE_NOT_ACCESSORY 

Something other than a PSP accessory is connected.

PSP_USBGPS_STATE_BUSY 

The GPS receiver is initializing.

PSP_USBGPS_STATE_WORKING 

The GPS receiver is up and running.

◆ PspUsbGpsStaticNavMode

Static navigation modes for sceUsbGpsSetStaticNavMode.

Enumerator
PSP_USBGPS_STATIC_NAV_MODE_DISABLE 
PSP_USBGPS_STATIC_NAV_MODE_ENABLE 

Function Documentation

◆ sceUsbGpsClose()

int sceUsbGpsClose ( void )

Stops GPS receiver operation and shuts down the GPS driver.

Available on firmware 2.70 and higher only.

Returns
0 on success, < 0 on error

◆ sceUsbGpsGetData()

int sceUsbGpsGetData ( SceUsbGpsPositionData * pos,
SceUsbGpsSatelliteData * sat )

Gets position and satellite information.

Available on firmware 2.70 and higher only.

Parameters
pos- pointer to a structure that receives the position data, or NULL if not needed
sat- pointer to a structure that receives the satellite data, or NULL if not needed
Returns
0 on success, < 0 on error

◆ sceUsbGpsGetInitDataLocation()

int sceUsbGpsGetInitDataLocation ( u32 * datalocation)

Gets the file currently selected for the GPS init (assistance) data.

Available on firmware 2.70 and higher only.

Parameters
datalocation- pointer to a variable that receives the current location, one of PspUsbGpsInitDataLocation
Returns
0 on success, < 0 on error

◆ sceUsbGpsGetPowerSaveMode()

int sceUsbGpsGetPowerSaveMode ( u32 * mode,
u32 * interval )

Gets the current GPS receiver power-save settings.

Available on firmware 3.00 and higher only.

Parameters
mode- pointer that receives the mode, one of PspUsbGpsPowerSaveMode, or NULL if not needed
interval- pointer that receives the idle time in seconds, or NULL if not needed
Returns
0 on success, < 0 on error

◆ sceUsbGpsGetState()

int sceUsbGpsGetState ( u32 * state)

Gets the state of the GPS receiver.

Available on firmware 2.70 and higher only.

Parameters
state- pointer to a variable that receives the state, one of PspUsbGpsState
Returns
0 on success, < 0 on error

◆ sceUsbGpsGetStaticNavMode()

int sceUsbGpsGetStaticNavMode ( u8 * mode)

Gets the current static navigation mode.

Available on firmware 3.70 and higher only.

Parameters
mode- pointer to a variable that receives the mode, one of PspUsbGpsStaticNavMode
Returns
0 on success, < 0 on error

◆ sceUsbGpsOpen()

int sceUsbGpsOpen ( void )

Initializes the GPS driver and starts GPS receiver operation.

The GPS modules have to be loaded with sceUtilityLoadModule(PSP_MODULE_USB_GPS) and the USB bus, accessory and GPS drivers started with sceUsbStart before calling this.

Available on firmware 2.70 and higher only.

Returns
0 on success, < 0 on error

◆ sceUsbGpsReset()

int sceUsbGpsReset ( u32 type)

Restarts the GPS receiver at the given reset level, controlling how much of its acquired data is discarded.

Available on firmware 2.70 and higher only.

Parameters
type- one of PspUsbGpsResetType
Returns
0 on success, < 0 on error

◆ sceUsbGpsResetInitialPosition()

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.

Takes effect while the receiver is still searching. It is a no-op once the receiver already has a fix. The receiver is restarted with the new position automatically.

The latitude, longitude and altitude can be taken straight from a prior sceUsbGpsGetData result. altitude + geoidsep is the WGS84 ellipsoidal height. Pass geoidsep as 0 when it is unknown (the resulting error is negligible for a seed).

Available on firmware 3.30 and higher only.

Parameters
latitude- latitude in degrees, -90 to 90 (south negative)
longitude- longitude in degrees, -180 to 180 (west negative)
altitude- height above mean sea level in meters, -10000 to 10000
geoidsep- geoid-to-ellipsoid separation in meters, -1000 to 1000
Returns
0 on success, < 0 on error

◆ sceUsbGpsSaveInitData()

int sceUsbGpsSaveInitData ( void )

Saves the GPS init (assistance) data to the file selected with sceUsbGpsSetInitDataLocation.

The data (last known position, time and ephemeris/almanac) is produced by the receiver while it runs. This call only writes the current in-memory copy to storage so the next session can obtain a fix faster.

Available on firmware 2.70 and higher only.

Returns
0 on success, < 0 on error. Returns PSP_USBGPS_ERROR_NO_INIT_DATA if the receiver has not produced any assistance data yet.

◆ sceUsbGpsSetInitDataLocation()

int sceUsbGpsSetInitDataLocation ( u32 datalocation)

Selects the file the GPS init (assistance) data is loaded from when the receiver starts and saved to by sceUsbGpsSaveInitData.

The default is PSP_USBGPS_INIT_DATA_LOCATION_FLASH1. Should be called right after sceUsbGpsOpen, before the receiver starts and the file is read.

Available on firmware 2.70 and higher only.

Parameters
datalocation- one of PspUsbGpsInitDataLocation
Returns
0 on success, < 0 on error

◆ sceUsbGpsSetPowerSaveMode()

int sceUsbGpsSetPowerSaveMode ( u32 mode,
u32 interval )

Sets the GPS receiver power-save mode.

Power saving engages once the PSP has been idle (no user input) for the given interval, after which the receiver duty-cycles as described by PspUsbGpsPowerSaveMode. Should be called immediately after sceUsbGpsOpen. It fails once the receiver has started running.

Available on firmware 3.00 and higher only.

Parameters
mode- one of PspUsbGpsPowerSaveMode
interval- idle time in seconds before power saving engages, 30 to 600
Returns
0 on success, < 0 on error

◆ sceUsbGpsSetStaticNavMode()

int sceUsbGpsSetStaticNavMode ( u8 mode)

Sets the static navigation mode.

When enabled, the receiver filters out small movements at low speed to keep the reported position stable. Can be called any time after sceUsbGpsOpen. Takes effect immediately if the receiver is running, otherwise when it starts.

Available on firmware 3.70 and higher only.

Parameters
mode- one of PspUsbGpsStaticNavMode
Returns
0 on success, < 0 on error