MdePkg[all]
1.08
|
Data Structures | |
struct | _EFI_SPI_BUS_TRANSACTION |
struct | _EFI_SPI_IO_PROTOCOL |
Typedefs | |
typedef struct _EFI_SPI_IO_PROTOCOL | EFI_SPI_IO_PROTOCOL |
typedef IN EFI_SPI_TRANSACTION_TYPE | TransactionType |
typedef IN EFI_SPI_TRANSACTION_TYPE IN BOOLEAN | DebugTransaction |
typedef IN EFI_SPI_TRANSACTION_TYPE IN BOOLEAN IN UINT32 | ClockHz |
typedef IN EFI_SPI_TRANSACTION_TYPE IN BOOLEAN IN UINT32 IN UINT32 | BusWidth |
typedef IN EFI_SPI_TRANSACTION_TYPE IN BOOLEAN IN UINT32 IN UINT32 IN UINT32 | FrameSize |
typedef IN EFI_SPI_TRANSACTION_TYPE IN BOOLEAN IN UINT32 IN UINT32 IN UINT32 IN UINT32 | WriteBytes |
typedef IN EFI_SPI_TRANSACTION_TYPE IN BOOLEAN IN UINT32 IN UINT32 IN UINT32 IN UINT32 IN UINT8 * | WriteBuffer |
typedef IN EFI_SPI_TRANSACTION_TYPE IN BOOLEAN IN UINT32 IN UINT32 IN UINT32 IN UINT32 IN UINT8 IN UINT32 | ReadBytes |
typedef IN EFI_SPI_TRANSACTION_TYPE IN BOOLEAN IN UINT32 IN UINT32 IN UINT32 IN UINT32 IN UINT8 IN UINT32 OUT UINT8 * | ReadBuffer |
typedef IN CONST EFI_SPI_PERIPHERAL * | SpiPeripheral |
typedef struct _EFI_SPI_BUS_TRANSACTION | EFI_SPI_BUS_TRANSACTION |
Enumerations | |
enum | EFI_SPI_TRANSACTION_TYPE { SPI_TRANSACTION_FULL_DUPLEX, SPI_TRANSACTION_WRITE_ONLY, SPI_TRANSACTION_READ_ONLY, SPI_TRANSACTION_WRITE_THEN_READ } |
Functions | |
typedef | EFI_STATUS (EFIAPI *EFI_SPI_IO_PROTOCOL_TRANSACTION)(IN CONST EFI_SPI_IO_PROTOCOL *This |
This file defines the SPI I/O Protocol.
Copyright (c) 2017, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
typedef struct _EFI_SPI_BUS_TRANSACTION EFI_SPI_BUS_TRANSACTION |
The EFI_SPI_BUS_ TRANSACTION data structure contains the description of the SPI transaction to perform on the host controller.
typedef struct _EFI_SPI_IO_PROTOCOL EFI_SPI_IO_PROTOCOL |
typedef IN EFI_SPI_TRANSACTION_TYPE IN BOOLEAN IN UINT32 IN UINT32 IN UINT32 IN UINT32 IN UINT8 IN UINT32 OUT UINT8* ReadBuffer |
typedef IN EFI_SPI_TRANSACTION_TYPE IN BOOLEAN IN UINT32 IN UINT32 IN UINT32 IN UINT32 IN UINT8 IN UINT32 ReadBytes |
typedef IN CONST EFI_SPI_PERIPHERAL* SpiPeripheral |
typedef IN EFI_SPI_TRANSACTION_TYPE IN BOOLEAN IN UINT32 IN UINT32 IN UINT32 IN UINT32 IN UINT8* WriteBuffer |
Note: The UEFI PI 1.6 specification does not specify values for the members below. The order matches the specification.
typedef EFI_STATUS | ( | EFIAPI * | EFI_SPI_IO_PROTOCOL_UPDATE_SPI_PERIPHERAL | ) |
Initiate a SPI transaction between the host and a SPI peripheral.
This routine must be called at or below TPL_NOTIFY. This routine works with the SPI bus layer to pass the SPI transaction to the SPI controller for execution on the SPI bus. There are four types of supported transactions supported by this routine: Full Duplex: WriteBuffer and ReadBuffer are the same size. Write Only: WriteBuffer contains data for SPI peripheral, ReadBytes = 0 Read Only: ReadBuffer to receive data from SPI peripheral, WriteBytes = 0 Write Then Read: WriteBuffer contains control data to write to SPI peripheral before data is placed into the ReadBuffer. Both WriteBytes and ReadBytes must be non-zero.
[in] | This | Pointer to an EFI_SPI_IO_PROTOCOL structure. |
[in] | TransactionType | Type of SPI transaction. |
[in] | DebugTransaction | Set TRUE only when debugging is desired. Debugging may be turned on for a single SPI transaction. Only this transaction will display debugging messages. All other transactions with this value set to FALSE will not display any debugging messages. |
[in] | ClockHz | Specify the ClockHz value as zero (0) to use the maximum clock frequency supported by the SPI controller and part. Specify a non-zero value only when a specific SPI transaction requires a reduced clock rate. |
[in] | BusWidth | Width of the SPI bus in bits: 1, 2, 4 |
[in] | FrameSize | Frame size in bits, range: 1 - 32 |
[in] | WriteBytes | The length of the WriteBuffer in bytes. Specify zero for read-only operations. |
[in] | WriteBuffer | The buffer containing data to be sent from the host to the SPI chip. Specify NULL for read only operations. Frame sizes 1-8 bits: UINT8 (one byte) per frame Frame sizes 7-16 bits: UINT16 (two bytes) per frame Frame sizes 17-32 bits: UINT32 (four bytes) per frame The transmit frame is in the least significant N bits. |
[in] | ReadBytes | The length of the ReadBuffer in bytes. Specify zero for write-only operations. |
[out] | ReadBuffer | The buffer to receeive data from the SPI chip during the transaction. Specify NULL for write only operations. Frame sizes 1-8 bits: UINT8 (one byte) per frame Frame sizes 7-16 bits: UINT16 (two bytes) per frame Frame sizes 17-32 bits: UINT32 (four bytes) per frame The received frame is in the least significant N bits. |
EFI_SUCCESS | The SPI transaction completed successfully |
EFI_BAD_BUFFER_SIZE | The writeBytes value was invalid |
EFI_BAD_BUFFER_SIZE | The ReadBytes value was invalid |
EFI_INVALID_PARAMETER | TransactionType is not valid, or BusWidth not supported by SPI peripheral or SPI host controller, or WriteBytes non-zero and WriteBuffer is NULL, or ReadBytes non-zero and ReadBuffer is NULL, or ReadBuffer != WriteBuffer for full-duplex type, or WriteBuffer was NULL, or TPL is too high |
EFI_OUT_OF_RESOURCES | Insufficient memory for SPI transaction |
EFI_UNSUPPORTED | The FrameSize is not supported by the SPI bus layer or the SPI host controller |
EFI_UNSUPPORTED | The SPI controller was not able to support |
Update the SPI peripheral associated with this SPI 10 instance.
Support socketed SPI parts by allowing the SPI peripheral driver to replace the SPI peripheral after the connection is made. An example use is socketed SPI NOR flash parts, where the size and parameters change depending upon device is in the socket.
[in] | This | Pointer to an EFI_SPI_IO_PROTOCOL structure. |
[in] | SpiPeripheral | Pointer to an EFI_SPI_PERIPHERAL structure. |
EFI_SUCCESS | The SPI peripheral was updated successfully |
EFI_INVALID_PARAMETER | The SpiPeripheral value is NULL, or the SpiPeripheral->SpiBus is NULL, or the SpiP eripheral - >SpiBus pointing at wrong bus, or the SpiP eripheral - >SpiPart is NULL |