MdePkg[all]
1.08
|
Data Structures | |
struct | _EFI_SPI_PART |
struct | _EFI_SPI_BUS |
struct | _EFI_SPI_PERIPHERAL |
struct | _EFI_SPI_CONFIGURATION_PROTOCOL |
Macros | |
#define | EFI_SPI_CONFIGURATION_GUID |
#define | Hz(Frequency) (Frequency) |
#define | KHz(Frequency) (1000 * Hz (Frequency)) |
#define | MHz(Frequency) (1000 * KHz (Frequency)) |
Typedefs | |
typedef struct _EFI_SPI_PERIPHERAL | EFI_SPI_PERIPHERAL |
typedef IN BOOLEAN | PinValue |
typedef IN UINT32 * | ClockHz |
typedef struct _EFI_SPI_PART | EFI_SPI_PART |
typedef struct _EFI_SPI_BUS | EFI_SPI_BUS |
typedef struct _EFI_SPI_CONFIGURATION_PROTOCOL | EFI_SPI_CONFIGURATION_PROTOCOL |
Functions | |
typedef | EFI_STATUS (EFIAPI *EFI_SPI_CHIP_SELECT)(IN CONST EFI_SPI_PERIPHERAL *SpiPeripheral |
Variables | |
EFI_GUID | gEfiSpiConfigurationProtocolGuid |
This file defines the SPI Configuration Protocol.
Copyright (c) 2017, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
#define EFI_SPI_CONFIGURATION_GUID |
Global ID for the SPI Configuration Protocol
#define Hz | ( | Frequency | ) | (Frequency) |
Macros to easily specify frequencies in hertz, kilohertz and megahertz.
#define KHz | ( | Frequency | ) | (1000 * Hz (Frequency)) |
#define MHz | ( | Frequency | ) | (1000 * KHz (Frequency)) |
typedef struct _EFI_SPI_BUS EFI_SPI_BUS |
The EFI_SPI_BUS data structure provides the connection details between the physical SPI bus and the EFI_SPI_HC_PROTOCOL instance which controls that SPI bus. This data structure also describes the details of how the clock is generated for that SPI bus. Finally this data structure provides the list of physical SPI devices which are attached to the SPI bus.
typedef struct _EFI_SPI_CONFIGURATION_PROTOCOL EFI_SPI_CONFIGURATION_PROTOCOL |
Describe the details of the board's SPI busses to the SPI driver stack. The board layer uses the EFI_SPI_CONFIGURATION_PROTOCOL to expose the data tables which describe the board's SPI busses, The SPI bus layer uses these tables to configure the clock, chip select and manage the SPI transactions on the SPI controllers.
typedef struct _EFI_SPI_PART EFI_SPI_PART |
The EFI_SPI_PART data structure provides a description of a SPI part which is independent of the use on the board. This data is available directly from the part's datasheet and may be provided by the vendor.
typedef struct _EFI_SPI_PERIPHERAL EFI_SPI_PERIPHERAL |
typedef EFI_STATUS | ( | EFIAPI * | EFI_SPI_CLOCK | ) |
Manipulate the chip select for a SPI device.
This routine must be called at or below TPL_NOTIFY. Update the value of the chip select line for a SPI peripheral. The SPI bus layer calls this routine either in the board layer or in the SPI controller to manipulate the chip select pin at the start and end of a SPI transaction.
[in] | SpiPeripheral | The address of an EFI_SPI_PERIPHERAL data structure describing the SPI peripheral whose chip select pin is to be manipulated. The routine may access the ChipSelectParameter field to gain sufficient context to complete the operation. |
[in] | PinValue | The value to be applied to the chip select line of the SPI peripheral. |
EFI_SUCCESS | The chip select was set successfully |
EFI_NOT_READY | Support for the chip select is not properly initialized |
EFI_INVALID_PARAMETER | The SpiPeripheral->ChipSelectParameter value is invalid |
Set up the clock generator to produce the correct clock frequency, phase and polarity for a SPI chip.
This routine must be called at or below TPL_NOTIFY. This routine updates the clock generator to generate the correct frequency and polarity for the SPI clock.
[in] | SpiPeripheral | Pointer to a EFI_SPI_PERIPHERAL data structure from which the routine can access the ClockParameter, ClockPhase and ClockPolarity fields. The routine also has access to the names for the SPI bus and chip which can be used during debugging. |
[in] | ClockHz | Pointer to the requested clock frequency. The clock generator will choose a supported clock frequency which is less then or equal to this value. Specify zero to turn the clock generator off. The actual clock frequency supported by the clock generator will be returned. |
EFI_SUCCESS | The clock was set up successfully |
EFI_UNSUPPORTED | The SPI controller was not able to support the frequency requested by CLockHz |
EFI_GUID gEfiSpiConfigurationProtocolGuid |