27 #if (HAL_USE_SPI == TRUE) || defined(__DOXYGEN__) 72 #if SPI_USE_WAIT == TRUE 75 #if SPI_USE_MUTUAL_EXCLUSION == TRUE 78 #if defined(SPI_DRIVER_EXT_INIT_HOOK) 79 SPI_DRIVER_EXT_INIT_HOOK(spip);
203 const void *txbuf,
void *rxbuf) {
206 (rxbuf != NULL) && (txbuf != NULL));
231 osalDbgCheck((spip != NULL) && (n > 0U) && (txbuf != NULL));
256 osalDbgCheck((spip != NULL) && (n > 0U) && (rxbuf != NULL));
264 #if (SPI_SUPPORTS_CIRCULAR == TRUE) || defined(__DOXYGEN__) 282 #if SPI_USE_WAIT == TRUE 307 #if (SPI_USE_WAIT == TRUE) || defined(__DOXYGEN__) 325 #if SPI_SUPPORTS_CIRCULAR 355 const void *txbuf,
void *rxbuf) {
358 (rxbuf != NULL) && (txbuf != NULL));
359 #if SPI_SUPPORTS_CIRCULAR 388 osalDbgCheck((spip != NULL) && (n > 0U) && (txbuf != NULL));
389 #if SPI_SUPPORTS_CIRCULAR 418 osalDbgCheck((spip != NULL) && (n > 0U) && (rxbuf != NULL));
419 #if SPI_SUPPORTS_CIRCULAR 431 #if (SPI_USE_MUTUAL_EXCLUSION == TRUE) || defined(__DOXYGEN__) static void osalMutexObjectInit(mutex_t *mp)
Initializes s mutex_t object.
#define spiStartSendI(spip, n, txbuf)
Sends data over the SPI bus.
void spiUnselect(SPIDriver *spip)
Deasserts the slave select signal.
void spiStartExchange(SPIDriver *spip, size_t n, const void *txbuf, void *rxbuf)
Exchanges data on the SPI bus.
msg_t osalThreadSuspendS(thread_reference_t *trp)
Sends the current thread sleeping and sets a reference variable.
void spiSelect(SPIDriver *spip)
Asserts the slave select signal and prepares for transfers.
#define spiStartIgnoreI(spip, n)
Ignores data on the SPI bus.
void spiObjectInit(SPIDriver *spip)
Initializes the standard part of a SPIDriver structure.
void spiReceive(SPIDriver *spip, size_t n, void *rxbuf)
Receives data from the SPI bus.
void spiExchange(SPIDriver *spip, size_t n, const void *txbuf, void *rxbuf)
Exchanges data on the SPI bus.
void spiAbortI(SPIDriver *spip)
Aborts the ongoing SPI operation.
void spiStart(SPIDriver *spip, const SPIConfig *config)
Configures and activates the SPI peripheral.
#define osalDbgCheckClassI()
I-Class state check.
void spiAbort(SPIDriver *spip)
Aborts the ongoing SPI operation, if any.
void osalMutexLock(mutex_t *mp)
Locks the specified mutex.
static void osalSysUnlock(void)
Leaves a critical zone from thread context.
void spiReleaseBus(SPIDriver *spip)
Releases exclusive access to the SPI bus.
void osalOsRescheduleS(void)
Checks if a reschedule is required and performs it.
void spiInit(void)
SPI Driver initialization.
const SPIConfig * config
Current configuration data.
void spiAcquireBus(SPIDriver *spip)
Gains exclusive access to the SPI bus.
#define spiStartReceiveI(spip, n, rxbuf)
Receives data from the SPI bus.
#define spiStartExchangeI(spip, n, txbuf, rxbuf)
Exchanges data on the SPI bus.
#define spiSelectI(spip)
Asserts the slave select signal and prepares for transfers.
Driver configuration structure.
#define osalDbgCheck(c)
Function parameters check.
void spiStartIgnore(SPIDriver *spip, size_t n)
Ignores data on the SPI bus.
void spi_lld_stop(SPIDriver *spip)
Deactivates the SPI peripheral.
void spi_lld_abort(SPIDriver *spip)
Aborts the ongoing SPI operation, if any.
void spi_lld_start(SPIDriver *spip)
Configures and activates the SPI peripheral.
void spiIgnore(SPIDriver *spip, size_t n)
Ignores data on the SPI bus.
void spi_lld_init(void)
Low level SPI driver initialization.
mutex_t mutex
Mutex protecting the peripheral.
static void osalSysLock(void)
Enters a critical zone from thread context.
void spiSend(SPIDriver *spip, size_t n, const void *txbuf)
Sends data over the SPI bus.
#define osalDbgAssert(c, remark)
Condition assertion.
#define spiUnselectI(spip)
Deasserts the slave select signal.
thread_reference_t thread
Waiting thread.
void osalMutexUnlock(mutex_t *mp)
Unlocks the specified mutex.
bool circular
Enables the circular buffer mode.
void osalThreadResumeI(thread_reference_t *trp, msg_t msg)
Wakes up a thread waiting on a thread reference object.
void spiStartSend(SPIDriver *spip, size_t n, const void *txbuf)
Sends data over the SPI bus.
void spiStop(SPIDriver *spip)
Deactivates the SPI peripheral.
Structure representing an SPI driver.
void spiStartReceive(SPIDriver *spip, size_t n, void *rxbuf)
Receives data from the SPI bus.
spistate_t state
Driver state.