25#if (HAL_USE_SPI == TRUE) || defined(__DOXYGEN__)
70#if SPI_USE_WAIT == TRUE
73#if SPI_USE_MUTUAL_EXCLUSION == TRUE
76#if defined(SPI_DRIVER_EXT_INIT_HOOK)
77 SPI_DRIVER_EXT_INIT_HOOK(spip);
101#if defined(SPI_LLD_ENHANCED_API)
218 const void *txbuf,
void *rxbuf) {
221 (rxbuf != NULL) && (txbuf != NULL));
246 osalDbgCheck((spip != NULL) && (n > 0U) && (txbuf != NULL));
271 osalDbgCheck((spip != NULL) && (n > 0U) && (rxbuf != NULL));
279#if (SPI_SUPPORTS_CIRCULAR == TRUE) || defined(__DOXYGEN__)
297#if SPI_USE_WAIT == TRUE
322#if (SPI_USE_WAIT == TRUE) || defined(__DOXYGEN__)
338#if SPI_SUPPORTS_CIRCULAR
366 const void *txbuf,
void *rxbuf) {
369 (rxbuf != NULL) && (txbuf != NULL));
370#if SPI_SUPPORTS_CIRCULAR
397 osalDbgCheck((spip != NULL) && (n > 0U) && (txbuf != NULL));
398#if SPI_SUPPORTS_CIRCULAR
425 osalDbgCheck((spip != NULL) && (n > 0U) && (rxbuf != NULL));
426#if SPI_SUPPORTS_CIRCULAR
438#if (SPI_USE_MUTUAL_EXCLUSION == TRUE) || defined(__DOXYGEN__)
static void osalSysLock(void)
Enters a critical zone from thread context.
static void osalMutexObjectInit(mutex_t *mp)
Initializes a mutex_t object.
static void osalSysUnlock(void)
Leaves a critical zone from thread context.
msg_t osalThreadSuspendS(thread_reference_t *trp)
Sends the current thread sleeping and sets a reference variable.
void osalOsRescheduleS(void)
Checks if a reschedule is required and performs it.
void osalMutexLock(mutex_t *mp)
Locks the specified mutex.
void osalThreadResumeI(thread_reference_t *trp, msg_t msg)
Wakes up a thread waiting on a thread reference object.
#define osalDbgAssert(c, remark)
Condition assertion.
void osalMutexUnlock(mutex_t *mp)
Unlocks the specified mutex.
#define osalDbgCheck(c)
Function parameters check.
#define osalDbgCheckClassI()
I-Class state check.
void spiSelect(SPIDriver *spip)
Asserts the slave select signal and prepares for transfers.
#define spiUnselectI(spip)
Deasserts the slave select signal.
void spiReleaseBus(SPIDriver *spip)
Releases exclusive access to the SPI bus.
void spi_lld_abort(SPIDriver *spip)
Aborts the ongoing SPI operation, if any.
#define spiStartReceiveI(spip, n, rxbuf)
Receives data from the SPI bus.
void spiSend(SPIDriver *spip, size_t n, const void *txbuf)
Sends data over the SPI bus.
void spiInit(void)
SPI Driver initialization.
void spiIgnore(SPIDriver *spip, size_t n)
Ignores data on the SPI bus.
struct hal_spi_config SPIConfig
Type of a SPI driver configuration structure.
#define spiStartExchangeI(spip, n, txbuf, rxbuf)
Exchanges data on the SPI bus.
void spi_lld_init(void)
Low level SPI driver initialization.
void spiAcquireBus(SPIDriver *spip)
Gains exclusive access to the SPI bus.
void spiObjectInit(SPIDriver *spip)
Initializes the standard part of a SPIDriver structure.
void spi_lld_stop(SPIDriver *spip)
Deactivates the SPI peripheral.
void spiStartSend(SPIDriver *spip, size_t n, const void *txbuf)
Sends data over the SPI bus.
msg_t spiStart(SPIDriver *spip, const SPIConfig *config)
Configures and activates the SPI peripheral.
void spiStartReceive(SPIDriver *spip, size_t n, void *rxbuf)
Receives data from the SPI bus.
void spiStartIgnore(SPIDriver *spip, size_t n)
Ignores data on the SPI bus.
struct hal_spi_driver SPIDriver
Type of a structure representing an SPI driver.
#define spiStartSendI(spip, n, txbuf)
Sends data over the SPI bus.
void spiStop(SPIDriver *spip)
Deactivates the SPI peripheral.
#define spiStartIgnoreI(spip, n)
Ignores data on the SPI bus.
void spiReceive(SPIDriver *spip, size_t n, void *rxbuf)
Receives data from the SPI bus.
void spiUnselect(SPIDriver *spip)
Deasserts the slave select signal.
void spiExchange(SPIDriver *spip, size_t n, const void *txbuf, void *rxbuf)
Exchanges data on the SPI bus.
void spi_lld_start(SPIDriver *spip)
Configures and activates the SPI peripheral.
#define spiSelectI(spip)
Asserts the slave select signal and prepares for transfers.
void spiStartExchange(SPIDriver *spip, size_t n, const void *txbuf, void *rxbuf)
Exchanges data on the SPI bus.
#define spiAbort(spip)
Compatibility API with SPI driver v1.
#define spiAbortI(spip)
Compatibility API with SPI driver v1.
#define MSG_OK
Normal wakeup message.
bool circular
Enables the circular buffer mode.
const SPIConfig * config
Current configuration data.
thread_reference_t thread
Waiting thread.
mutex_t mutex
Mutex protecting the peripheral.
spistate_t state
Driver state.