diff options
author | Sergi Granell | 2017-04-10 11:50:30 +0200 |
---|---|---|
committer | Sunguk Lee | 2017-04-10 18:50:30 +0900 |
commit | 02aa05525c921b227f1c3ab7a8b26f49ad08b782 (patch) | |
tree | 1f013fce875c3af2ee7bc9939903cb7ec8314a75 /include/kernel/lowio | |
parent | Revert "Update ctrl.h (#155)" (diff) | |
download | vds-libraries-02aa05525c921b227f1c3ab7a8b26f49ad08b782.tar.gz |
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
Diffstat (limited to 'include/kernel/lowio')
-rw-r--r-- | include/kernel/lowio/gpio.h | 42 |
1 files changed, 42 insertions, 0 deletions
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 <psp2/types.h> + +#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_ */ + |