spi_s_async_init

Initialize the SPI Slave HAL instance and hardware for callback mode.

int32_t spi_s_async_init(
    struct spi_s_async_descriptor * spi,
    void *const hw,
    uint8_t *const rxbuf,
    int16_t bufsize
)

Initialize SPI Slave HAL with interrupt mode (uses callbacks).

Parameters

spi

Type: struct spi_s_async_descriptor Struct *

Pointer to the SPI Slave HAL instance.

hw

Type: void *const

Pointer to the hardware base.

rxbuf

Type: uint8_t *const

Pointer to the buffer for receiving ring buffer.

bufsize

Type: int16_t

The receiving ring buffer size.

Returns

Type: int32_t

Operation status.

0

Success.

-1

Error.