summaryrefslogtreecommitdiff
path: root/include/kernel/lowio/gpio.h
blob: 944acbd811e2f52c8eb8dc111ad5a6b83ce724e0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef _PSP2_LOWIO_GPIO_H_
#define _PSP2_LOWIO_GPIO_H_

#include <psp2kern/types.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef enum SceGpioErrorCode {
	SCE_GPIO_ERROR_INVALID_BUS	= 0x803F0100,
	SCE_GPIO_ERROR_INVALID_PORT	= 0x803F0101,
	SCE_GPIO_ERROR_INVALID_MODE	= 0x803F0102
} SceGpioErrorCode;

typedef enum SceGpioPortMasks {
	SCE_GPIO_PORT_MASK_LED_GAMECARD		= 1 << 6,
	SCE_GPIO_PORT_MASK_LED_PS_BUTTON	= 1 << 7
} SceGpioPortMasks;

typedef enum SceGpioPortMode {
	SCE_GPIO_PORT_MODE_OUTPUT	= 0,
	SCE_GPIO_PORT_MODE_INPUT	= 1
} SceGpioPortMode;

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_ */