spi_m_async_register_callback

Register a function as SPI transfer completion callback.

void spi_m_async_register_callback(
    struct spi_m_async_descriptor * spi,
    const enum spi_m_async_cb_type type,
    FUNC_PTR func
)
Register callback function specified by its type.
  • SPI_CB_COMPLETE: set the function that will be called on the SPI transfer completion including deactivating the CS.

  • SPI_CB_XFER: set the function that will be called on the SPI buffer transfer completion. Register NULL function to not use the callback.

Parameters

spi

Type: struct spi_m_async_descriptor Struct *

Pointer to the HAL SPI instance.

type

Type: const enum spi_m_async_cb_type Enum

Callback type (spi_m_async_cb_type Enum).

func

Type: FUNC_PTR typedef

Pointer to callback function.

Returns

Type: void