Function declarations for SpiHcPlatformLib
Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file SpiHcPlatformLib.h.
This is the platform specific Spi Chip select function. Assert or deassert the SPI chip select.
This routine is called at 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] | This | Pointer to an EFI_SPI_HC_PROTOCOL structure. |
[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 operati on. |
[in] | PinValue | The value to be applied to the chip select line of the SPI peripheral. |
- Return values
-
EFI_SUCCESS | The chip select was set as requested |
EFI_NOT_READY | Support for the chip select is not properly initialized |
EFI_INVALID_PARAMETER | The ChipSeLect value or its contents are invalid |
This is the platform specific Spi Chip select function. Assert or deassert the SPI chip select.
This routine is called at 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] | This | Pointer to an EFI_SPI_HC_PROTOCOL structure. |
[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 operati on. |
[in] | PinValue | The value to be applied to the chip select line of the SPI peripheral. |
- Return values
-
Definition at line 74 of file BaseSpiHcPlatformLibNull.c.
This function is the platform specific SPI clock function. Set up the clock generator to produce the correct clock frequency, phase and polarity for a SPI chip.
This routine is called at TPL_NOTIFY. This routine updates the clock generator to generate the correct frequency and polarity for the SPI clock.
- Parameters
-
[in] | This | Pointer to an EFI_SPI_HC_PROTOCOL structure. |
[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 SPI host controller 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 SPI host controller will be returned. |
- Return values
-
EFI_SUCCESS | The clock was set up successfully |
EFI_UNSUPPORTED | The SPI controller was not able to support the frequency requested by ClockHz |
This function is the platform specific SPI clock function. Set up the clock generator to produce the correct clock frequency, phase and polarity for a SPI chip.
This routine is called at TPL_NOTIFY. This routine updates the clock generator to generate the correct frequency and polarity for the SPI clock.
- Parameters
-
[in] | This | Pointer to an EFI_SPI_HC_PROTOCOL structure. |
[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 SPI host controller 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 SPI host controller will be returned. |
- Return values
-
Definition at line 110 of file BaseSpiHcPlatformLibNull.c.
This function is the platform specific SPI transaction function Perform the SPI transaction on the SPI peripheral using the SPI host controller.
This routine is called at TPL_NOTIFY. This routine synchronously returns EFI_SUCCESS indicating that the asynchronous SPI transaction was started. The routine then waits for completion of the SPI transaction prior to returning the final transaction status.
- Parameters
-
[in] | This | Pointer to an EFI_SPI_HC_PROTOCOL structure. |
[in] | BusTransaction | Pointer to a EFI_SPI_BUS_ TRANSACTION containing the description of the SPI transaction to perform. |
- Return values
-
EFI_SUCCESS | The transaction completed successfully |
EFI_BAD_BUFFER_SIZE | The BusTransaction->WriteBytes value is invalid, or the BusTransaction->ReadinBytes value is invalid |
EFI_UNSUPPORTED | The BusTransaction-> Transaction Type is unsupported |
This function is the platform specific SPI transaction function Perform the SPI transaction on the SPI peripheral using the SPI host controller.
This routine is called at TPL_NOTIFY. This routine synchronously returns EFI_SUCCESS indicating that the asynchronous SPI transaction was started. The routine then waits for completion of the SPI transaction prior to returning the final transaction status.
- Parameters
-
[in] | This | Pointer to an EFI_SPI_HC_PROTOCOL structure. |
[in] | BusTransaction | Pointer to a EFI_SPI_BUS_ TRANSACTION containing the description of the SPI transaction to perform. |
- Return values
-
Definition at line 139 of file BaseSpiHcPlatformLibNull.c.