PSP2SDK  dirty-f9e4f2d
The free SDK for PSP2
include/psp2/motion.h
Go to the documentation of this file.
00001 
00012 #ifndef _PSP2_MOTION_H_
00013 #define _PSP2_MOTION_H_
00014 
00015 #include <psp2/types.h>
00016 #include <stdint.h>
00017 
00018 #ifdef __cplusplus
00019 extern "C" {
00020 #endif
00021 
00022 /* struct */
00023 
00024 typedef struct SceMotionState {
00025     unsigned int timestamp;
00026     SceFVector3 acceleration;
00027     SceFVector3 angularVelocity;
00028     uint8_t reserved1[12];
00029     SceFQuaternion deviceQuat;
00030     SceUMatrix4 rotationMatrix;
00031     SceUMatrix4 nedMatrix;
00032     uint32_t reserved2;
00033     SceFVector3 basicOrientation;
00034     SceULong64 hostTimestamp;
00035     uint8_t reserved[40];
00036 } SceMotionState;
00037 
00038 typedef struct SceMotionSensorState {
00039     SceFVector3 accelerometer;
00040     SceFVector3 gyro;
00041     uint8_t reserved1[12];
00042     unsigned int timestamp;
00043     unsigned int counter;
00044     uint32_t reserved2;
00045     SceULong64 hostTimestamp;
00046     uint8_t reserved3[8];
00047 } SceMotionSensorState;
00048 
00049 /* prototypes */
00050 
00051 int sceMotionGetState(SceMotionState *motionState);
00052 int sceMotionGetSensorState(SceMotionSensorState *sensorState, int numRecords);
00053 int sceMotionGetBasicOrientation(SceFVector3 *basicOrientation);
00054 int sceMotionRotateYaw(float radians);
00055 int sceMotionGetTiltCorrection(void);
00056 int sceMotionSetTiltCorrection(int setValue);
00057 int sceMotionGetDeadband(void);
00058 int sceMotionSetDeadband(int setValue);
00059 int sceMotionSetAngleThreshold(float angle);
00060 float sceMotionGetAngleThreshold(void);
00061 int sceMotionReset(void);
00062 int sceMotionMagnetometerOn(void);
00063 int sceMotionMagnetometerOff(void);
00064 int sceMotionGetMagnetometerState(void);
00065 int sceMotionStartSampling(void);
00066 int sceMotionStopSampling(void);
00067 
00068 #ifdef __cplusplus
00069 }
00070 #endif
00071 
00072 #endif /* _PSP2_MOTION_H_ */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines