summaryrefslogtreecommitdiff
path: root/Protocol/GPIO
diff options
context:
space:
mode:
authorraywu <raywu0301@gmail.com>2018-06-15 00:00:50 +0800
committerraywu <raywu0301@gmail.com>2018-06-15 00:00:50 +0800
commitb7c51c9cf4864df6aabb99a1ae843becd577237c (patch)
treeeebe9b0d0ca03062955223097e57da84dd618b9a /Protocol/GPIO
downloadzprj-b7c51c9cf4864df6aabb99a1ae843becd577237c.tar.xz
init. 1AQQW051HEADmaster
Diffstat (limited to 'Protocol/GPIO')
-rw-r--r--Protocol/GPIO/Gpio.c37
-rw-r--r--Protocol/GPIO/Gpio.h83
2 files changed, 120 insertions, 0 deletions
diff --git a/Protocol/GPIO/Gpio.c b/Protocol/GPIO/Gpio.c
new file mode 100644
index 0000000..70376ef
--- /dev/null
+++ b/Protocol/GPIO/Gpio.c
@@ -0,0 +1,37 @@
+/*++
+ This file contains 'Framework Code' and is licensed as such
+ under the terms of your license agreement with Intel or your
+ vendor. This file may not be modified, except as allowed by
+ additional terms of your license agreement.
+--*/
+/*++
+
+Copyright (c) 1999 - 2002 Intel Corporation. All rights reserved
+This software and associated documentation (if any) is furnished
+under a license and may only be used or copied in accordance
+with the terms of the license. Except as permitted by such
+license, no part of this software or documentation may be
+reproduced, stored in a retrieval system, or transmitted in any
+form or by any means without the express written consent of
+Intel Corporation.
+
+
+Module Name:
+
+ Gpio.c
+
+Abstract:
+
+ EFI GPIO Protocol
+
+Revision History
+
+--*/
+
+#include "Tiano.h"
+
+#include EFI_PROTOCOL_DEFINITION (Gpio)
+
+EFI_GUID gEfiGpioProtocolGuid = EFI_GPIO_PROTOCOL_GUID;
+
+EFI_GUID_STRING(&gEfiGpioProtocolGuid, "GPIO Protocol", "EFI 1.1 GPIO Protocol");
diff --git a/Protocol/GPIO/Gpio.h b/Protocol/GPIO/Gpio.h
new file mode 100644
index 0000000..1c792bd
--- /dev/null
+++ b/Protocol/GPIO/Gpio.h
@@ -0,0 +1,83 @@
+//
+// This file contains 'Framework Code' and is licensed as such
+// under the terms of your license agreement with Intel or your
+// vendor. This file may not be modified, except as allowed by
+// additional terms of your license agreement.
+//
+/*++
+
+Copyright (c) 1999 - 2002 Intel Corporation. All rights reserved
+This software and associated documentation (if any) is furnished
+under a license and may only be used or copied in accordance
+with the terms of the license. Except as permitted by such
+license, no part of this software or documentation may be
+reproduced, stored in a retrieval system, or transmitted in any
+form or by any means without the express written consent of
+Intel Corporation.
+
+
+Module Name:
+
+ Gpio.h
+
+Abstract:
+
+ EFI GPIO Protocol
+
+Revision History
+
+--*/
+
+#ifndef _EFI_GPIO_H
+#define _EFI_GPIO_H
+
+//
+// Global ID for the GPIO Protocol
+//
+#define EFI_GPIO_PROTOCOL_GUID \
+ { \
+ 0xb5d09084, 0x80ad, 0x4759, 0xb5, 0x1c, 0x27, 0x54, 0x8a, 0xfb, 0x8b, 0x8d \
+ }
+
+EFI_FORWARD_DECLARATION (EFI_GPIO_PROTOCOL);
+
+typedef enum _EFI_GPIO_METHOD
+{
+ EfiGpioMultipleOperation= 0,
+ EfiGpioSingleOperation = 1,
+ EfiGpioMaxOperation = 2
+} EFI_GPIO_METHOD;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_GPIO_PROTOCOL_GET_STATE) (
+ IN EFI_GPIO_PROTOCOL * This,
+ IN UINT32 *GpioNumberSet,
+ IN UINT32 GpioArraySize,
+ IN EFI_GPIO_METHOD GpioMethod,
+ IN VOID *DeviceSelector,
+ IN OUT VOID *GpioState
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_GPIO_PROTOCOL_SET_STATE) (
+ IN EFI_GPIO_PROTOCOL * This,
+ IN UINT32 *GpioNumberSet,
+ IN UINT32 GpioArraySize,
+ IN EFI_GPIO_METHOD GpioMethod,
+ IN VOID *DeviceSelector,
+ IN VOID *GpioState
+ );
+
+//
+// Interface structure for the GPIO Protocol
+//
+typedef struct _EFI_GPIO_PROTOCOL {
+ EFI_GPIO_PROTOCOL_GET_STATE GetState;
+ EFI_GPIO_PROTOCOL_SET_STATE SetState;
+} EFI_GPIO_PROTOCOL;
+
+extern EFI_GUID gEfiGpioProtocolGuid;
+
+#endif