|
ChibiOS
20.3.4
|
SPI Driver macros and structures. More...
#include "hal_spi_lld.h"Go to the source code of this file.
Data Structures | |
| struct | hal_spi_config |
| Driver configuration structure. More... | |
| struct | hal_spi_driver |
| Structure representing an SPI driver. More... | |
Macros | |
Chip Select modes | |
| #define | SPI_SELECT_MODE_NONE |
| #define | SPI_SELECT_MODE_PAD 1 /** @brief Legacy mode. */ |
| #define | SPI_SELECT_MODE_PORT 2 /** @brief Fastest mode. */ |
| #define | SPI_SELECT_MODE_LINE 3 /** @brief Packed mode. */ |
| #define | SPI_SELECT_MODE_LLD 4 /** @brief LLD-defined mode.*/ |
SPI configuration options | |
| #define | SPI_USE_WAIT TRUE |
| Enables synchronous APIs. More... | |
| #define | SPI_USE_CIRCULAR FALSE |
| Enables circular transfers APIs. More... | |
| #define | SPI_USE_MUTUAL_EXCLUSION TRUE |
Enables the spiAcquireBus() and spiReleaseBus() APIs. More... | |
| #define | SPI_SELECT_MODE SPI_SELECT_MODE_PAD |
| Handling method for SPI CS line. More... | |
Macro Functions | |
| #define | spiIsBufferComplete(spip) ((bool)((spip)->state == SPI_COMPLETE)) |
| Buffer state. More... | |
| #define | spiSelectI(spip) |
| Asserts the slave select signal and prepares for transfers. More... | |
| #define | spiUnselectI(spip) |
| Deasserts the slave select signal. More... | |
| #define | spiStartIgnoreI(spip, n) |
| Ignores data on the SPI bus. More... | |
| #define | spiStartExchangeI(spip, n, txbuf, rxbuf) |
| Exchanges data on the SPI bus. More... | |
| #define | spiStartSendI(spip, n, txbuf) |
| Sends data over the SPI bus. More... | |
| #define | spiStartReceiveI(spip, n, rxbuf) |
| Receives data from the SPI bus. More... | |
| #define | spiPolledExchange(spip, frame) spi_lld_polled_exchange(spip, frame) |
| Exchanges one frame using a polled wait. More... | |
Low level driver helper macros | |
| #define | _spi_wakeup_isr(spip) |
| Wakes up the waiting thread. More... | |
| #define | _spi_isr_code(spip) |
| Common ISR code when circular mode is not supported. More... | |
| #define | _spi_isr_half_code(spip) |
| Half buffer filled ISR code in circular mode. More... | |
| #define | _spi_isr_full_code(spip) |
| Full buffer filled ISR code in circular mode. More... | |
Typedefs | |
| typedef struct hal_spi_driver | SPIDriver |
| Type of a structure representing an SPI driver. More... | |
| typedef struct hal_spi_config | SPIConfig |
| Type of a SPI driver configuration structure. More... | |
| typedef void(* | spicallback_t) (SPIDriver *spip) |
| SPI notification callback type. More... | |
Enumerations | |
| enum | spistate_t { SPI_UNINIT = 0, SPI_STOP = 1, SPI_READY = 2, SPI_ACTIVE = 3, SPI_COMPLETE = 4 } |
| Driver state machine possible states. More... | |
Functions | |
| void | spiInit (void) |
| SPI Driver initialization. More... | |
| void | spiObjectInit (SPIDriver *spip) |
Initializes the standard part of a SPIDriver structure. More... | |
| void | spiStart (SPIDriver *spip, const SPIConfig *config) |
| Configures and activates the SPI peripheral. More... | |
| void | spiStop (SPIDriver *spip) |
| Deactivates the SPI peripheral. More... | |
| void | spiSelect (SPIDriver *spip) |
| Asserts the slave select signal and prepares for transfers. More... | |
| void | spiUnselect (SPIDriver *spip) |
| Deasserts the slave select signal. More... | |
| void | spiStartIgnore (SPIDriver *spip, size_t n) |
| Ignores data on the SPI bus. More... | |
| void | spiStartExchange (SPIDriver *spip, size_t n, const void *txbuf, void *rxbuf) |
| Exchanges data on the SPI bus. More... | |
| void | spiStartSend (SPIDriver *spip, size_t n, const void *txbuf) |
| Sends data over the SPI bus. More... | |
| void | spiStartReceive (SPIDriver *spip, size_t n, void *rxbuf) |
| Receives data from the SPI bus. More... | |
| void | spiAbortI (SPIDriver *spip) |
| Aborts the ongoing SPI operation. More... | |
| void | spiAbort (SPIDriver *spip) |
| Aborts the ongoing SPI operation, if any. More... | |
| void | spiIgnore (SPIDriver *spip, size_t n) |
| Ignores data on the SPI bus. More... | |
| void | spiExchange (SPIDriver *spip, size_t n, const void *txbuf, void *rxbuf) |
| Exchanges data on the SPI bus. More... | |
| void | spiSend (SPIDriver *spip, size_t n, const void *txbuf) |
| Sends data over the SPI bus. More... | |
| void | spiReceive (SPIDriver *spip, size_t n, void *rxbuf) |
| Receives data from the SPI bus. More... | |
| void | spiAcquireBus (SPIDriver *spip) |
| Gains exclusive access to the SPI bus. More... | |
| void | spiReleaseBus (SPIDriver *spip) |
| Releases exclusive access to the SPI bus. More... | |
SPI Driver macros and structures.
Definition in file hal_spi.h.