Tsungta Wu / Mbed OS mbed_SPIS_multiByte_example
Embed: (wiki syntax)

« Back to documentation index

Synchronous SPI Hardware Abstraction Layer

Synchronous SPI Hardware Abstraction Layer
[Hal]

Functions

int spi_master_write_multibyte (spi_mb_t *obj, int value)
 Write a byte out in master mode and receive a value.
int spi_slave_receive_multibyte (spi_mb_t *obj, int bytes)
 Check if a value is available to read.
int spi_slave_read_multibyte (spi_mb_t *obj)
 Get a received value out of the SPI receive buffer in slave mode.
void spi_slave_write_multibyte (spi_mb_t *obj, uint8_t *value, int bytes)
 Write a value to the SPI peripheral in slave mode.
int spi_busy_multibyte (spi_mb_t *obj)
 Checks if the specified SPI peripheral is in use.
uint8_t spi_get_module_multibyte (spi_mb_t *obj)
 Get the module number.

Function Documentation

int spi_busy_multibyte ( spi_mb_t obj )

Checks if the specified SPI peripheral is in use.

Parameters:
[in]objThe SPI peripheral to check
Returns:
non-zero if the peripheral is currently transmitting

Definition at line 319 of file spi_api_multibyte.c.

uint8_t spi_get_module_multibyte ( spi_mb_t obj )

Get the module number.

Parameters:
[in]objThe SPI peripheral to check
Returns:
The module number
int spi_master_write_multibyte ( spi_mb_t obj,
int  value 
)

Write a byte out in master mode and receive a value.

Parameters:
[in]objThe SPI peripheral to use for sending
[in]valueThe value to send
Returns:
Returns the value received during send

Definition at line 454 of file spi_api_multibyte.c.

int spi_slave_read_multibyte ( spi_mb_t obj )

Get a received value out of the SPI receive buffer in slave mode.

Blocks until a value is available

Parameters:
[in]objThe SPI peripheral to read
Returns:
The value received

Definition at line 482 of file spi_api_multibyte.c.

int spi_slave_receive_multibyte ( spi_mb_t obj,
int  bytes 
)

Check if a value is available to read.

Parameters:
[in]objThe SPI peripheral to check
Returns:
non-zero if a value is available

Definition at line 473 of file spi_api_multibyte.c.

void spi_slave_write_multibyte ( spi_mb_t obj,
uint8_t *  value,
int  bytes 
)

Write a value to the SPI peripheral in slave mode.

Blocks until the SPI peripheral can be written to

Parameters:
[in]objThe SPI peripheral to write
[in]valueThe value to write

Definition at line 492 of file spi_api_multibyte.c.