diff options
Diffstat (limited to 'EmbeddedPkg/Include/Protocol/EmbeddedGpio.h')
-rw-r--r-- | EmbeddedPkg/Include/Protocol/EmbeddedGpio.h | 95 |
1 files changed, 47 insertions, 48 deletions
diff --git a/EmbeddedPkg/Include/Protocol/EmbeddedGpio.h b/EmbeddedPkg/Include/Protocol/EmbeddedGpio.h index 83854fc286..3cd5b74a48 100644 --- a/EmbeddedPkg/Include/Protocol/EmbeddedGpio.h +++ b/EmbeddedPkg/Include/Protocol/EmbeddedGpio.h @@ -12,27 +12,27 @@ //
// Protocol interface structure
//
-typedef struct _EMBEDDED_GPIO EMBEDDED_GPIO;
+typedef struct _EMBEDDED_GPIO EMBEDDED_GPIO;
//
// Data Types
//
typedef UINTN EMBEDDED_GPIO_PIN;
-#define GPIO(Port, Pin) ((EMBEDDED_GPIO_PIN)(((Port) << (16)) | (Pin)))
-#define GPIO_PIN(x) ((EMBEDDED_GPIO_PIN)(x) & (0xFFFF))
-#define GPIO_PORT(x) ((EMBEDDED_GPIO_PIN)(x) >> (16))
+#define GPIO(Port, Pin) ((EMBEDDED_GPIO_PIN)(((Port) << (16)) | (Pin)))
+#define GPIO_PIN(x) ((EMBEDDED_GPIO_PIN)(x) & (0xFFFF))
+#define GPIO_PORT(x) ((EMBEDDED_GPIO_PIN)(x) >> (16))
typedef enum {
- GPIO_MODE_INPUT = 0x00,
- GPIO_MODE_OUTPUT_0 = 0x0E,
- GPIO_MODE_OUTPUT_1 = 0x0F,
- GPIO_MODE_SPECIAL_FUNCTION_2 = 0x02,
- GPIO_MODE_SPECIAL_FUNCTION_3 = 0x03,
- GPIO_MODE_SPECIAL_FUNCTION_4 = 0x04,
- GPIO_MODE_SPECIAL_FUNCTION_5 = 0x05,
- GPIO_MODE_SPECIAL_FUNCTION_6 = 0x06,
- GPIO_MODE_SPECIAL_FUNCTION_7 = 0x07
+ GPIO_MODE_INPUT = 0x00,
+ GPIO_MODE_OUTPUT_0 = 0x0E,
+ GPIO_MODE_OUTPUT_1 = 0x0F,
+ GPIO_MODE_SPECIAL_FUNCTION_2 = 0x02,
+ GPIO_MODE_SPECIAL_FUNCTION_3 = 0x03,
+ GPIO_MODE_SPECIAL_FUNCTION_4 = 0x04,
+ GPIO_MODE_SPECIAL_FUNCTION_5 = 0x05,
+ GPIO_MODE_SPECIAL_FUNCTION_6 = 0x06,
+ GPIO_MODE_SPECIAL_FUNCTION_7 = 0x07
} EMBEDDED_GPIO_MODE;
typedef enum {
@@ -46,11 +46,12 @@ typedef enum { //
typedef
EFI_STATUS
-(EFIAPI *EMBEDDED_GPIO_GET) (
+(EFIAPI *EMBEDDED_GPIO_GET)(
IN EMBEDDED_GPIO *This,
IN EMBEDDED_GPIO_PIN Gpio,
OUT UINTN *Value
);
+
/*++
Routine Description:
@@ -69,14 +70,14 @@ Returns: --*/
-
typedef
EFI_STATUS
-(EFIAPI *EMBEDDED_GPIO_SET) (
- IN EMBEDDED_GPIO *This,
- IN EMBEDDED_GPIO_PIN Gpio,
- IN EMBEDDED_GPIO_MODE Mode
- );
+(EFIAPI *EMBEDDED_GPIO_SET)(
+ IN EMBEDDED_GPIO *This,
+ IN EMBEDDED_GPIO_PIN Gpio,
+ IN EMBEDDED_GPIO_MODE Mode
+ );
+
/*++
Routine Description:
@@ -95,14 +96,14 @@ Returns: --*/
-
typedef
EFI_STATUS
-(EFIAPI *EMBEDDED_GPIO_GET_MODE) (
- IN EMBEDDED_GPIO *This,
- IN EMBEDDED_GPIO_PIN Gpio,
- OUT EMBEDDED_GPIO_MODE *Mode
- );
+(EFIAPI *EMBEDDED_GPIO_GET_MODE)(
+ IN EMBEDDED_GPIO *This,
+ IN EMBEDDED_GPIO_PIN Gpio,
+ OUT EMBEDDED_GPIO_MODE *Mode
+ );
+
/*++
Routine Description:
@@ -121,14 +122,14 @@ Returns: --*/
-
typedef
EFI_STATUS
-(EFIAPI *EMBEDDED_GPIO_SET_PULL) (
- IN EMBEDDED_GPIO *This,
- IN EMBEDDED_GPIO_PIN Gpio,
- IN EMBEDDED_GPIO_PULL Direction
- );
+(EFIAPI *EMBEDDED_GPIO_SET_PULL)(
+ IN EMBEDDED_GPIO *This,
+ IN EMBEDDED_GPIO_PIN Gpio,
+ IN EMBEDDED_GPIO_PULL Direction
+ );
+
/*++
Routine Description:
@@ -147,32 +148,30 @@ Returns: --*/
-
-
struct _EMBEDDED_GPIO {
- EMBEDDED_GPIO_GET Get;
- EMBEDDED_GPIO_SET Set;
- EMBEDDED_GPIO_GET_MODE GetMode;
- EMBEDDED_GPIO_SET_PULL SetPull;
+ EMBEDDED_GPIO_GET Get;
+ EMBEDDED_GPIO_SET Set;
+ EMBEDDED_GPIO_GET_MODE GetMode;
+ EMBEDDED_GPIO_SET_PULL SetPull;
};
-extern EFI_GUID gEmbeddedGpioProtocolGuid;
+extern EFI_GUID gEmbeddedGpioProtocolGuid;
-typedef struct _GPIO_CONTROLLER GPIO_CONTROLLER;
-typedef struct _PLATFORM_GPIO_CONTROLLER PLATFORM_GPIO_CONTROLLER;
+typedef struct _GPIO_CONTROLLER GPIO_CONTROLLER;
+typedef struct _PLATFORM_GPIO_CONTROLLER PLATFORM_GPIO_CONTROLLER;
struct _GPIO_CONTROLLER {
- UINTN RegisterBase;
- UINTN GpioIndex;
- UINTN InternalGpioCount;
+ UINTN RegisterBase;
+ UINTN GpioIndex;
+ UINTN InternalGpioCount;
};
struct _PLATFORM_GPIO_CONTROLLER {
- UINTN GpioCount;
- UINTN GpioControllerCount;
- GPIO_CONTROLLER *GpioController;
+ UINTN GpioCount;
+ UINTN GpioControllerCount;
+ GPIO_CONTROLLER *GpioController;
};
-extern EFI_GUID gPlatformGpioProtocolGuid;
+extern EFI_GUID gPlatformGpioProtocolGuid;
#endif
|