From 02aa05525c921b227f1c3ab7a8b26f49ad08b782 Mon Sep 17 00:00:00 2001 From: Sergi Granell Date: Mon, 10 Apr 2017 11:50:30 +0200 Subject: Add GPIO header and more NIDs (#158) * Add GPIO header and more NIDs * Add ksceSysconCtrlLED NID * Add ksceKernelCpuSuspendIntr and ksceKernelCpuResumeIntr NIDs * Add GPIO to the docs --- include/kernel/lowio/gpio.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 include/kernel/lowio/gpio.h (limited to 'include/kernel/lowio/gpio.h') diff --git a/include/kernel/lowio/gpio.h b/include/kernel/lowio/gpio.h new file mode 100644 index 0000000..2850494 --- /dev/null +++ b/include/kernel/lowio/gpio.h @@ -0,0 +1,42 @@ +#ifndef _PSP2_LOWIO_GPIO_H_ +#define _PSP2_LOWIO_GPIO_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + SCE_GPIO_ERROR_INVALID_BUS = 0x803F0100, + SCE_GPIO_ERROR_INVALID_PORT = 0x803F0101, + SCE_GPIO_ERROR_INVALID_MODE = 0x803F0102 +}; + +enum SceGpioPortMasks { + SCE_GPIO_PORT_MASK_LED_GAMECARD = 1 << 6, + SCE_GPIO_PORT_MASK_LED_PS_BUTTON = 1 << 7 +}; + +enum SceGpioPortMode { + SCE_GPIO_PORT_MODE_OUTPUT = 0, + SCE_GPIO_PORT_MODE_INPUT = 1 +}; + +int sceGpioPortRead(int bus, int port); +int sceGpioPortSet(int bus, int port); +int sceGpioPortClear(int bus, int port); +int sceGpioPortReset(int bus, int port); +int sceGpioSetPortMode(int bus, int port, int mode); +int sceGpioGetPortMode(int bus, int port); +int sceGpioSetIntrMode(int bus, int port, int intr_mode); +int sceGpioGetIntrMode(int bus, int port); +int sceGpioAcquireIntr(int bus, int port); +int sceGpioQueryIntr(int bus, int port); + +#ifdef __cplusplus +} +#endif + +#endif /* _PSP2_LOWIO_GPIO_H_ */ + -- cgit v1.2.3