From 7f1828871707e9976235a0946187bbaae2efb520 Mon Sep 17 00:00:00 2001 From: Sunguk Lee Date: Tue, 27 Sep 2016 22:41:13 +0900 Subject: Add sceCtrlGetBatteryInfo and update SceCtrlData - Add function define - Update LT/RT field of SceCtrlData --- include/user/ctrl.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'include/user/ctrl.h') diff --git a/include/user/ctrl.h b/include/user/ctrl.h index 062329c..90eb4d8 100644 --- a/include/user/ctrl.h +++ b/include/user/ctrl.h @@ -70,7 +70,13 @@ typedef struct SceCtrlData { /** Right analogue stick, Y axis. */ unsigned char ry; /** Reserved. */ - uint8_t reserved[16]; + uint8_t reserved0[4]; + /** Left trigger (L2) */ + unsigned char lt; + /** Right trigger (R2) */ + unsigned char rt; + /** Reserved. */ + uint8_t reserved1[10]; } SceCtrlData; /** Structure to pass as argument to ::sceCtrlSetRapidFire */ @@ -229,6 +235,16 @@ int sceCtrlSetLightBar(int port, SceUInt8 r, SceUInt8 g, SceUInt8 b); * @return 0, <0 on error */ int sceCtrlGetControllerPortInfo(SceCtrlPortInfo *info); + +/** + * Get controller battery information. + * + * @param[in] port - use 1 for the first paired controller, etc. + * @param[out] batt - battery level, between 0-5, 0xEE charging, 0xEF charged + * + * @return 0, <0 on error. + */ +int sceCtrlGetBatteryInfo(int port, SceUInt8 *batt); #ifdef __cplusplus } #endif -- cgit v1.2.3