TianoCore EDK2 master
|
#include <PiDxe.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/IoLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/PcdLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Protocol/EmbeddedGpio.h>
#include "PL061Gpio.h"
Go to the source code of this file.
Functions | |
EFI_STATUS EFIAPI | PL061Locate (IN EMBEDDED_GPIO_PIN Gpio, OUT UINTN *ControllerIndex, OUT UINTN *ControllerOffset, OUT UINTN *RegisterBase) |
STATIC UINTN EFIAPI | PL061EffectiveAddress (IN UINTN Address, IN UINT8 Mask) |
STATIC UINT8 EFIAPI | PL061GetPins (IN UINTN Address, IN UINT8 Mask) |
STATIC VOID EFIAPI | PL061SetPins (IN UINTN Address, IN UINT8 Mask, IN UINT8 Value) |
EFI_STATUS | PL061Identify (VOID) |
EFI_STATUS EFIAPI | Get (IN EMBEDDED_GPIO *This, IN EMBEDDED_GPIO_PIN Gpio, OUT UINTN *Value) |
EFI_STATUS EFIAPI | Set (IN EMBEDDED_GPIO *This, IN EMBEDDED_GPIO_PIN Gpio, IN EMBEDDED_GPIO_MODE Mode) |
EFI_STATUS EFIAPI | GetMode (IN EMBEDDED_GPIO *This, IN EMBEDDED_GPIO_PIN Gpio, OUT EMBEDDED_GPIO_MODE *Mode) |
EFI_STATUS EFIAPI | SetPull (IN EMBEDDED_GPIO *This, IN EMBEDDED_GPIO_PIN Gpio, IN EMBEDDED_GPIO_PULL Direction) |
EFI_STATUS EFIAPI | PL061InstallProtocol (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
Variables | |
PLATFORM_GPIO_CONTROLLER * | mPL061PlatformGpio |
EMBEDDED_GPIO | gGpio |
Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.
Copyright (c) 2016, Linaro Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file PL061Gpio.c.
EFI_STATUS EFIAPI Get | ( | IN EMBEDDED_GPIO * | This, |
IN EMBEDDED_GPIO_PIN | Gpio, | ||
OUT UINTN * | Value | ||
) |
Routine Description:
Gets the state of a GPIO pin
Arguments:
This - pointer to protocol Gpio - which pin to read Value - state of the pin
Returns:
EFI_SUCCESS - GPIO state returned in Value EFI_INVALID_PARAMETER - Value is NULL pointer or Gpio pin is out of range
Definition at line 171 of file PL061Gpio.c.
EFI_STATUS EFIAPI GetMode | ( | IN EMBEDDED_GPIO * | This, |
IN EMBEDDED_GPIO_PIN | Gpio, | ||
OUT EMBEDDED_GPIO_MODE * | Mode | ||
) |
Routine Description:
Gets the mode (function) of a GPIO pin
Arguments:
This - pointer to protocol Gpio - which pin Mode - pointer to output mode value
Returns:
EFI_SUCCESS - mode value retrieved EFI_INVALID_PARAMETER - Mode is a null pointer or Gpio pin is out of range
Definition at line 285 of file PL061Gpio.c.
Definition at line 75 of file PL061Gpio.c.
Definition at line 86 of file PL061Gpio.c.
EFI_STATUS PL061Identify | ( | VOID | ) |
Function implementations
Definition at line 110 of file PL061Gpio.c.
EFI_STATUS EFIAPI PL061InstallProtocol | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Initialize the state information for the Embedded Gpio protocol.
ImageHandle | of the loaded driver |
SystemTable | Pointer to the System Table |
EFI_SUCCESS | Protocol registered |
EFI_OUT_OF_RESOURCES | Cannot allocate protocol data structure |
EFI_DEVICE_ERROR | Hardware problems |
Definition at line 372 of file PL061Gpio.c.
EFI_STATUS EFIAPI PL061Locate | ( | IN EMBEDDED_GPIO_PIN | Gpio, |
OUT UINTN * | ControllerIndex, | ||
OUT UINTN * | ControllerOffset, | ||
OUT UINTN * | RegisterBase | ||
) |
Definition at line 30 of file PL061Gpio.c.
Definition at line 97 of file PL061Gpio.c.
EFI_STATUS EFIAPI Set | ( | IN EMBEDDED_GPIO * | This, |
IN EMBEDDED_GPIO_PIN | Gpio, | ||
IN EMBEDDED_GPIO_MODE | Mode | ||
) |
Routine Description:
Sets the state of a GPIO pin
Arguments:
This - pointer to protocol Gpio - which pin to modify Mode - mode to set
Returns:
EFI_SUCCESS - GPIO set as requested EFI_UNSUPPORTED - Mode is not supported EFI_INVALID_PARAMETER - Gpio pin is out of range
Definition at line 219 of file PL061Gpio.c.
EFI_STATUS EFIAPI SetPull | ( | IN EMBEDDED_GPIO * | This, |
IN EMBEDDED_GPIO_PIN | Gpio, | ||
IN EMBEDDED_GPIO_PULL | Direction | ||
) |
Routine Description:
Sets the pull-up / pull-down resistor of a GPIO pin
Arguments:
This - pointer to protocol Gpio - which pin Direction - pull-up, pull-down, or none
Returns:
EFI_UNSUPPORTED - Can not perform the requested operation
Definition at line 340 of file PL061Gpio.c.
EMBEDDED_GPIO gGpio |
Protocol variable definition
Definition at line 352 of file PL061Gpio.c.
PLATFORM_GPIO_CONTROLLER* mPL061PlatformGpio |
Definition at line 26 of file PL061Gpio.c.