9#ifndef __EMBEDDED_GPIO_H__
10#define __EMBEDDED_GPIO_H__
20typedef UINTN EMBEDDED_GPIO_PIN;
22#define GPIO(Port, Pin) ((EMBEDDED_GPIO_PIN)(((Port) << (16)) | (Pin)))
23#define GPIO_PIN(x) ((EMBEDDED_GPIO_PIN)(x) & (0xFFFF))
24#define GPIO_PORT(x) ((EMBEDDED_GPIO_PIN)(x) >> (16))
27 GPIO_MODE_INPUT = 0x00,
28 GPIO_MODE_OUTPUT_0 = 0x0E,
29 GPIO_MODE_OUTPUT_1 = 0x0F,
30 GPIO_MODE_SPECIAL_FUNCTION_2 = 0x02,
31 GPIO_MODE_SPECIAL_FUNCTION_3 = 0x03,
32 GPIO_MODE_SPECIAL_FUNCTION_4 = 0x04,
33 GPIO_MODE_SPECIAL_FUNCTION_5 = 0x05,
34 GPIO_MODE_SPECIAL_FUNCTION_6 = 0x06,
35 GPIO_MODE_SPECIAL_FUNCTION_7 = 0x07
51 IN EMBEDDED_GPIO_PIN Gpio,
77 IN EMBEDDED_GPIO_PIN Gpio,
78 IN EMBEDDED_GPIO_MODE Mode
103 IN EMBEDDED_GPIO_PIN Gpio,
104 OUT EMBEDDED_GPIO_MODE *Mode
129 IN EMBEDDED_GPIO_PIN Gpio,
130 IN EMBEDDED_GPIO_PULL Direction
158extern EFI_GUID gEmbeddedGpioProtocolGuid;
166 UINTN InternalGpioCount;
171 UINTN GpioControllerCount;
175extern EFI_GUID gPlatformGpioProtocolGuid;
EFI_STATUS(EFIAPI * EMBEDDED_GPIO_GET)(IN EMBEDDED_GPIO_PPI *This, IN EMBEDDED_GPIO_PIN Gpio, OUT UINTN *Value)
EFI_STATUS(EFIAPI * EMBEDDED_GPIO_GET_MODE)(IN EMBEDDED_GPIO_PPI *This, IN EMBEDDED_GPIO_PIN Gpio, OUT EMBEDDED_GPIO_MODE *Mode)
EFI_STATUS(EFIAPI * EMBEDDED_GPIO_SET_PULL)(IN EMBEDDED_GPIO_PPI *This, IN EMBEDDED_GPIO_PIN Gpio, IN EMBEDDED_GPIO_PULL Direction)
EFI_STATUS(EFIAPI * EMBEDDED_GPIO_SET)(IN EMBEDDED_GPIO_PPI *This, IN EMBEDDED_GPIO_PIN Gpio, IN EMBEDDED_GPIO_MODE Mode)