25#if (HAL_USE_SPI == TRUE) || defined(__DOXYGEN__)
70#if SPI_USE_SYNCHRONIZATION == TRUE
73#if SPI_USE_MUTUAL_EXCLUSION == TRUE
76#if defined(SPI_DRIVER_EXT_INIT_HOOK)
77 SPI_DRIVER_EXT_INIT_HOOK(spip);
111#if SPI_USE_ASSERT_ON_ERROR == TRUE
196#if SPI_SUPPORTS_CIRCULAR
205#if SPI_USE_ASSERT_ON_ERROR == TRUE
255 const void *txbuf,
void *rxbuf) {
261 (rxbuf != NULL) && (txbuf != NULL));
262#if SPI_SUPPORTS_CIRCULAR
271#if SPI_USE_ASSERT_ON_ERROR == TRUE
297 const void *txbuf,
void *rxbuf) {
328 osalDbgCheck((spip != NULL) && (n > 0U) && (txbuf != NULL));
329#if SPI_SUPPORTS_CIRCULAR
338#if SPI_USE_ASSERT_ON_ERROR == TRUE
392 osalDbgCheck((spip != NULL) && (n > 0U) && (rxbuf != NULL));
393#if SPI_SUPPORTS_CIRCULAR
402#if SPI_USE_ASSERT_ON_ERROR == TRUE
463#if SPI_USE_SYNCHRONIZATION == TRUE
497#if (SPI_USE_SYNCHRONIZATION == TRUE) || defined(__DOXYGEN__)
603 const void *txbuf,
void *rxbuf) {
685#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.
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.
msg_t osalThreadSuspendTimeoutS(thread_reference_t *trp, sysinterval_t timeout)
Sends the current thread sleeping and sets a reference variable.
#define osalDbgCheck(c)
Function parameters check.
#define osalDbgCheckClassI()
I-Class state check.
#define spiUnselectI(spip)
Deasserts the slave select signal.
void spi_lld_ignore(SPIDriver *spip, size_t n)
Ignores data on the SPI bus.
#define spiStartReceiveI(spip, n, rxbuf)
Receives data from 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_receive(SPIDriver *spip, size_t n, void *rxbuf)
Receives data from the SPI bus.
void spi_lld_init(void)
Low level SPI driver initialization.
void spi_lld_exchange(SPIDriver *spip, size_t n, const void *txbuf, void *rxbuf)
Exchanges data on the SPI bus.
void spi_lld_stop(SPIDriver *spip)
Deactivates the SPI peripheral.
void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf)
Sends data over 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.
#define spiStartIgnoreI(spip, n)
Ignores 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 spiSelect(SPIDriver *spip)
Asserts the slave select signal and prepares for transfers.
void spiReleaseBus(SPIDriver *spip)
Releases exclusive access to the SPI bus.
void spiInit(void)
SPI Driver initialization.
msg_t spiExchange(SPIDriver *spip, size_t n, const void *txbuf, void *rxbuf)
Exchanges data on the SPI bus.
msg_t spiIgnore(SPIDriver *spip, size_t n)
Ignores data on the SPI bus.
msg_t spi_lld_stop_transfer(SPIDriver *spip, size_t *sizep)
Aborts the ongoing SPI operation, if any.
void spiAcquireBus(SPIDriver *spip)
Gains exclusive access to the SPI bus.
void spiObjectInit(SPIDriver *spip)
Initializes the standard part of a SPIDriver structure.
msg_t 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.
msg_t spiSend(SPIDriver *spip, size_t n, const void *txbuf)
Sends data over the SPI bus.
msg_t spiStopTransfer(SPIDriver *spip, size_t *sizep)
Stops the ongoing SPI operation, if any.
msg_t spiStartIgnore(SPIDriver *spip, size_t n)
Ignores data on the SPI bus.
msg_t spiStopTransferI(SPIDriver *spip, size_t *sizep)
Stops the ongoing SPI operation.
void spiStop(SPIDriver *spip)
Deactivates the SPI peripheral.
msg_t spiStartReceive(SPIDriver *spip, size_t n, void *rxbuf)
Receives data from the SPI bus.
void spiUnselect(SPIDriver *spip)
Deasserts the slave select signal.
msg_t spiSynchronizeS(SPIDriver *spip, sysinterval_t timeout)
Synchronizes with current transfer completion.
msg_t spiStartExchange(SPIDriver *spip, size_t n, const void *txbuf, void *rxbuf)
Exchanges data on the SPI bus.
msg_t spiSynchronize(SPIDriver *spip, sysinterval_t timeout)
Synchronizes with current transfer completion.
msg_t spiReceive(SPIDriver *spip, size_t n, void *rxbuf)
Receives data from the SPI bus.
#define MSG_OK
Normal wakeup message.
#define MSG_RESET
Wakeup caused by a reset condition.
uint64_t sysinterval_t
Type of time interval.
#define TIME_INFINITE
Infinite interval specification for all functions with a timeout specification.
bool circular
Enables the circular buffer mode.
const SPIConfig * config
Current configuration data.
thread_reference_t sync_transfer
Synchronization point for transfer.
mutex_t mutex
Mutex protecting the peripheral.
spistate_t state
Driver state.