MdePkg[all]  1.08
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
SpiConfiguration.h File Reference

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 UINT32ClockHz
 
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
 

Detailed Description

This file defines the SPI Configuration Protocol.

Copyright (c) 2017, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Revision Reference:
This Protocol was introduced in UEFI PI Specification 1.6.

Macro Definition Documentation

#define EFI_SPI_CONFIGURATION_GUID
Value:
{ 0x85a6d3e6, 0xb65b, 0x4afc, \
{ 0xb3, 0x8f, 0xc6, 0xd5, 0x4a, 0xf6, 0xdd, 0xc8 }}

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 Documentation

typedef IN UINT32* ClockHz
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.

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 IN BOOLEAN PinValue

Function Documentation

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.

Parameters
[in]SpiPeripheralThe 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]PinValueThe value to be applied to the chip select line of the SPI peripheral.
Return values
EFI_SUCCESSThe chip select was set successfully
EFI_NOT_READYSupport for the chip select is not properly initialized
EFI_INVALID_PARAMETERThe 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.

Parameters
[in]SpiPeripheralPointer 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]ClockHzPointer 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.
Return values
EFI_SUCCESSThe clock was set up successfully
EFI_UNSUPPORTEDThe SPI controller was not able to support the frequency requested by CLockHz

Variable Documentation

EFI_GUID gEfiSpiConfigurationProtocolGuid