spi_m_sync_set_baudrate

Set SPI baudrate.

int32_t spi_m_sync_set_baudrate(
    struct spi_m_sync_descriptor * spi,
    const uint32_t baud_val
)

Works if SPI is initialized as master, it sets the baudrate.

Parameters

spi

Type: struct spi_m_sync_descriptor Struct *

Pointer to the HAL SPI instance.

baud_val

Type: const uint32_t

The target baudrate value (see "baudrate calculation" for calculating the value).

Returns

Type: int32_t

Operation status.

ERR_NONE

Success.

ERR_BUSY

Busy

ERR_INVALID_ARG

The baudrate is not supported.