Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: SPIne CH_Communicatuin_Test CH_Communicatuin_Test2 MCP_SPIne ... more
Fork of mbed-dev-f303 by
Functions | |
int | spi_master_write (spi_t *obj, int value) |
Write a byte out in master mode and receive a value. | |
int | spi_master_block_write (spi_t *obj, const char *tx_buffer, int tx_length, char *rx_buffer, int rx_length, char write_fill) |
Write a block out in master mode and receive a value. | |
int | spi_slave_receive (spi_t *obj) |
Check if a value is available to read. | |
int | spi_slave_read (spi_t *obj) |
Get a received value out of the SPI receive buffer in slave mode. | |
void | spi_slave_write (spi_t *obj, int value) |
Write a value to the SPI peripheral in slave mode. | |
int | spi_busy (spi_t *obj) |
Checks if the specified SPI peripheral is in use. | |
uint8_t | spi_get_module (spi_t *obj) |
Get the module number. |
Function Documentation
int spi_busy | ( | spi_t * | obj ) |
Checks if the specified SPI peripheral is in use.
- Parameters:
-
[in] obj The SPI peripheral to check
- Returns:
- non-zero if the peripheral is currently transmitting
uint8_t spi_get_module | ( | spi_t * | obj ) |
Get the module number.
- Parameters:
-
[in] obj The SPI peripheral to check
- Returns:
- The module number
int spi_master_block_write | ( | spi_t * | obj, |
const char * | tx_buffer, | ||
int | tx_length, | ||
char * | rx_buffer, | ||
int | rx_length, | ||
char | write_fill | ||
) |
Write a block out in master mode and receive a value.
The total number of bytes sent and recieved will be the maximum of tx_length and rx_length. The bytes written will be padded with the value 0xff.
- Parameters:
-
[in] obj The SPI peripheral to use for sending [in] tx_buffer Pointer to the byte-array of data to write to the device [in] tx_length Number of bytes to write, may be zero [in] rx_buffer Pointer to the byte-array of data to read from the device [in] rx_length Number of bytes to read, may be zero [in] write_fill Default data transmitted while performing a read
- Returns:
- The number of bytes written and read from the device. This is maximum of tx_length and rx_length.
int spi_master_write | ( | spi_t * | obj, |
int | value | ||
) |
Write a byte out in master mode and receive a value.
- Parameters:
-
[in] obj The SPI peripheral to use for sending [in] value The value to send
- Returns:
- Returns the value received during send
int spi_slave_read | ( | spi_t * | obj ) |
Get a received value out of the SPI receive buffer in slave mode.
Blocks until a value is available
- Parameters:
-
[in] obj The SPI peripheral to read
- Returns:
- The value received
int spi_slave_receive | ( | spi_t * | obj ) |
Check if a value is available to read.
- Parameters:
-
[in] obj The SPI peripheral to check
- Returns:
- non-zero if a value is available
void spi_slave_write | ( | spi_t * | obj, |
int | value | ||
) |
Write a value to the SPI peripheral in slave mode.
Blocks until the SPI peripheral can be written to
- Parameters:
-
[in] obj The SPI peripheral to write [in] value The value to write
Generated on Tue Jul 12 2022 19:39:49 by
