spi_m_sync_set_char_size

Set SPI transfer character size in number of bits.

int32_t spi_m_sync_set_char_size(
    struct spi_m_sync_descriptor * spi,
    const enum spi_char_size char_size
)

The character size (spi_char_size) influence the way the data is sent/received. For char size <= 8-bit, data is stored byte by byte. For char size between 9-bit ~ 16-bit, data is stored in 2-byte length. Note that the default and recommended char size is 8-bit since it's supported by all system.

Parameters

spi

Type: struct spi_m_sync_descriptor Struct *

Pointer to the HAL SPI instance.

char_size

Type: const enum spi_char_size

The char size (~16, recommended 8).

Returns

Type: int32_t

Operation status.

ERR_NONE

Success.

ERR_BUSY

Busy

ERR_INVALID_ARG

The char size is not supported.