XCORE SDK
XCORE Software Development Kit
Classes | Functions
hil_spi_slave

Classes

struct  spi_slave_callback_group_t
 

Functions

void spi_slave (const spi_slave_callback_group_t *spi_cbg, port_t p_sclk, port_t p_mosi, port_t p_miso, port_t p_cs, xclock_t clk, int cpol, int cpha)
 

Detailed Description

The public API for using the HIL SPI slave.

Function Documentation

◆ spi_slave()

void spi_slave ( const spi_slave_callback_group_t spi_cbg,
port_t  p_sclk,
port_t  p_mosi,
port_t  p_miso,
port_t  p_cs,
xclock_t  clk,
int  cpol,
int  cpha 
)

Initializes a SPI slave.

Note
Verified at 25000 kbps, with a 2000ns CS assertion to first clock in all modes. The CS to first clock minimum delay will vary based on the duration of the slave_transaction_started callback.
Parameters
spi_cbgThe spi_slave_callback_group_t context to use.
p_sclkThe SPI slave's SCLK port. Must be a 1-bit port.
p_mosiThe SPI slave's MOSI port. Must be a 1-bit port.
p_misoThe SPI slave's MISO port. Must be a 1-bit port.
p_csThe SPI slave's CS port. Must be a 1-bit port.
clock_blockThe clock block to use for the SPI slave.
cpolThe clock polarity to use.
cphaThe clock phase to use.