TianoCore EDK2 master
|
Go to the source code of this file.
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)) |
#define | SPI_PART_SUPPORTS_2_BIT_DATA_BUS_WIDTH BIT0 |
#define | SPI_PART_SUPPORTS_4_BIT_DATA_BUS_WIDTH BIT1 |
#define | SPI_PART_SUPPORTS_8_BIT_DATA_BUS_WIDTH BIT2 |
Typedefs | |
typedef struct _EFI_SPI_PERIPHERAL | EFI_SPI_PERIPHERAL |
typedef EFI_STATUS(EFIAPI * | EFI_SPI_CHIP_SELECT) (IN CONST EFI_SPI_PERIPHERAL *SpiPeripheral, IN BOOLEAN PinValue) |
typedef EFI_STATUS(EFIAPI * | EFI_SPI_CLOCK) (IN CONST EFI_SPI_PERIPHERAL *SpiPeripheral, 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 |
Variables | |
EFI_GUID | gEfiSpiConfigurationProtocolGuid |
This file defines the SPI Configuration Protocol.
Copyright (c) 2017, Intel Corporation. All rights reserved.
Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file SpiConfiguration.h.
#define EFI_SPI_CONFIGURATION_GUID |
Global ID for the SPI Configuration Protocol
Definition at line 19 of file SpiConfiguration.h.
#define Hz | ( | Frequency | ) | (Frequency) |
Macros to easily specify frequencies in hertz, kilohertz and megahertz.
Definition at line 26 of file SpiConfiguration.h.
#define KHz | ( | Frequency | ) | (1000 * Hz (Frequency)) |
Definition at line 27 of file SpiConfiguration.h.
#define MHz | ( | Frequency | ) | (1000 * KHz (Frequency)) |
Definition at line 28 of file SpiConfiguration.h.
#define SPI_PART_SUPPORTS_2_BIT_DATA_BUS_WIDTH BIT0 |
Definitions of SPI Part Attributes.
Definition at line 175 of file SpiConfiguration.h.
#define SPI_PART_SUPPORTS_4_BIT_DATA_BUS_WIDTH BIT1 |
Definition at line 176 of file SpiConfiguration.h.
#define SPI_PART_SUPPORTS_8_BIT_DATA_BUS_WIDTH BIT2 |
Definition at line 177 of file SpiConfiguration.h.
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 EFI_STATUS(EFIAPI * EFI_SPI_CHIP_SELECT) (IN CONST EFI_SPI_PERIPHERAL *SpiPeripheral, IN BOOLEAN PinValue) |
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 |
Definition at line 57 of file SpiConfiguration.h.
typedef EFI_STATUS(EFIAPI * EFI_SPI_CLOCK) (IN CONST EFI_SPI_PERIPHERAL *SpiPeripheral, IN UINT32 *ClockHz) |
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 |
Definition at line 88 of file SpiConfiguration.h.
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 |
Definition at line 30 of file SpiConfiguration.h.