ChibiOS/HAL 9.0.0
|
SPI (v1) 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. | |
#define | SPI_USE_MUTUAL_EXCLUSION TRUE |
Enables the spiAcquireBus() and spiReleaseBus() APIs. | |
#define | SPI_SELECT_MODE SPI_SELECT_MODE_PAD |
Handling method for SPI CS line. | |
Macro Functions | |
#define | spiIsBufferComplete(spip) |
Buffer state. | |
#define | spiSelectI(spip) |
Asserts the slave select signal and prepares for transfers. | |
#define | spiUnselectI(spip) |
Deasserts the slave select signal. | |
#define | spiStartIgnoreI(spip, n) |
Ignores data on the SPI bus. | |
#define | spiStartExchangeI(spip, n, txbuf, rxbuf) |
Exchanges data on the SPI bus. | |
#define | spiStartSendI(spip, n, txbuf) |
Sends data over the SPI bus. | |
#define | spiStartReceiveI(spip, n, rxbuf) |
Receives data from the SPI bus. | |
#define | spiPolledExchange(spip, frame) |
Exchanges one frame using a polled wait. | |
Low level driver helper macros | |
#define | _spi_wakeup_isr(spip) |
Wakes up the waiting thread. | |
#define | _spi_isr_code(spip) |
Common ISR code when circular mode is not supported. | |
#define | _spi_isr_half_code(spip) |
Half buffer filled ISR code in circular mode. | |
#define | _spi_isr_full_code(spip) |
Full buffer filled ISR code in circular mode. |
Typedefs | |
typedef struct hal_spi_driver | SPIDriver |
Type of a structure representing an SPI driver. | |
typedef struct hal_spi_config | SPIConfig |
Type of a SPI driver configuration structure. | |
typedef void(* | spicallback_t) (SPIDriver *spip) |
SPI notification callback type. |
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. | |
void | spiObjectInit (SPIDriver *spip) |
Initializes the standard part of a SPIDriver structure. | |
msg_t | spiStart (SPIDriver *spip, const SPIConfig *config) |
Configures and activates the SPI peripheral. | |
void | spiStop (SPIDriver *spip) |
Deactivates the SPI peripheral. | |
void | spiSelect (SPIDriver *spip) |
Asserts the slave select signal and prepares for transfers. | |
void | spiUnselect (SPIDriver *spip) |
Deasserts the slave select signal. | |
void | spiStartIgnore (SPIDriver *spip, size_t n) |
Ignores data on the SPI bus. | |
void | spiStartExchange (SPIDriver *spip, size_t n, const void *txbuf, void *rxbuf) |
Exchanges data on the SPI bus. | |
void | spiStartSend (SPIDriver *spip, size_t n, const void *txbuf) |
Sends data over the SPI bus. | |
void | spiStartReceive (SPIDriver *spip, size_t n, void *rxbuf) |
Receives data from the SPI bus. | |
void | spiAbortI (SPIDriver *spip) |
Aborts the ongoing SPI operation. | |
void | spiAbort (SPIDriver *spip) |
Aborts the ongoing SPI operation, if any. | |
void | spiIgnore (SPIDriver *spip, size_t n) |
Ignores data on the SPI bus. | |
void | spiExchange (SPIDriver *spip, size_t n, const void *txbuf, void *rxbuf) |
Exchanges data on the SPI bus. | |
void | spiSend (SPIDriver *spip, size_t n, const void *txbuf) |
Sends data over the SPI bus. | |
void | spiReceive (SPIDriver *spip, size_t n, void *rxbuf) |
Receives data from the SPI bus. | |
void | spiAcquireBus (SPIDriver *spip) |
Gains exclusive access to the SPI bus. | |
void | spiReleaseBus (SPIDriver *spip) |
Releases exclusive access to the SPI bus. |
SPI (v1) Driver macros and structures.
Definition in file hal_spi_v1.h.