TianoCore EDK2 master
Loading...
Searching...
No Matches
PL061Gpio.c File Reference

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_CONTROLLERmPL061PlatformGpio
 
EMBEDDED_GPIO gGpio
 

Detailed Description

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.

Function Documentation

◆ Get()

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.

◆ GetMode()

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.

◆ PL061EffectiveAddress()

STATIC UINTN EFIAPI PL061EffectiveAddress ( IN UINTN  Address,
IN UINT8  Mask 
)

Definition at line 75 of file PL061Gpio.c.

◆ PL061GetPins()

STATIC UINT8 EFIAPI PL061GetPins ( IN UINTN  Address,
IN UINT8  Mask 
)

Definition at line 86 of file PL061Gpio.c.

◆ PL061Identify()

EFI_STATUS PL061Identify ( VOID  )

Function implementations

Definition at line 110 of file PL061Gpio.c.

◆ PL061InstallProtocol()

EFI_STATUS EFIAPI PL061InstallProtocol ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Initialize the state information for the Embedded Gpio protocol.

Parameters
ImageHandleof the loaded driver
SystemTablePointer to the System Table
Return values
EFI_SUCCESSProtocol registered
EFI_OUT_OF_RESOURCESCannot allocate protocol data structure
EFI_DEVICE_ERRORHardware problems

Definition at line 372 of file PL061Gpio.c.

◆ PL061Locate()

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.

◆ PL061SetPins()

STATIC VOID EFIAPI PL061SetPins ( IN UINTN  Address,
IN UINT8  Mask,
IN UINT8  Value 
)

Definition at line 97 of file PL061Gpio.c.

◆ Set()

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.

◆ SetPull()

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.

Variable Documentation

◆ gGpio

Initial value:
= {
Get,
Set,
}
EFI_STATUS EFIAPI Get(IN EMBEDDED_GPIO *This, IN EMBEDDED_GPIO_PIN Gpio, OUT UINTN *Value)
Definition: PL061Gpio.c:171
EFI_STATUS EFIAPI SetPull(IN EMBEDDED_GPIO *This, IN EMBEDDED_GPIO_PIN Gpio, IN EMBEDDED_GPIO_PULL Direction)
Definition: PL061Gpio.c:340
EFI_STATUS EFIAPI GetMode(IN EMBEDDED_GPIO *This, IN EMBEDDED_GPIO_PIN Gpio, OUT EMBEDDED_GPIO_MODE *Mode)
Definition: PL061Gpio.c:285
EFI_STATUS EFIAPI Set(IN EMBEDDED_GPIO *This, IN EMBEDDED_GPIO_PIN Gpio, IN EMBEDDED_GPIO_MODE Mode)
Definition: PL061Gpio.c:219

Protocol variable definition

Definition at line 352 of file PL061Gpio.c.

◆ mPL061PlatformGpio

PLATFORM_GPIO_CONTROLLER* mPL061PlatformGpio

Definition at line 26 of file PL061Gpio.c.