File syn_port_spi_async.h¶
FileList > port > syn_port_spi_async.h
Go to the source code of this file
Async SPI port interface — implement these for your platform. More...
Detailed Description¶
Provides non-blocking, callback-based SPI transfers alongside the existing blocking API in syn_port_spi.h. The callback fires from ISR context.
** **
static void on_spi_done(uint8_t bus, SYN_Status result, void *ctx) {
syn_port_spi_cs_deassert(0, cs_pin);
// Process rx_buf
}
syn_port_spi_cs_assert(0, cs_pin);
SYN_SPI_Xfer xfer = {
.bus = 0,
.tx_buf = tx_data,
.rx_buf = rx_data,
.len = 256,
.callback = on_spi_done,
.user_data = NULL,
};
syn_port_spi_xfer_async(&xfer);
The documentation for this class was generated from the following file src/syntropic/port/syn_port_spi_async.h