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: Nucleo_F103RB_RTC_battery_bkup_pwr_off_okay
Fork of mbed-dev by
Diff: hal/spi_api.h
- Revision:
- 167:e84263d55307
- Parent:
- 149:156823d33999
- Child:
- 170:19eb464bc2be
--- a/hal/spi_api.h Thu Jun 08 15:02:37 2017 +0100 +++ b/hal/spi_api.h Wed Jun 21 17:46:44 2017 +0100 @@ -116,6 +116,23 @@ */ int spi_master_write(spi_t *obj, int value); +/** 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. + * + * @param[in] obj The SPI peripheral to use for sending + * @param[in] tx_buffer Pointer to the byte-array of data to write to the device + * @param[in] tx_length Number of bytes to write, may be zero + * @param[in] rx_buffer Pointer to the byte-array of data to read from the device + * @param[in] rx_length Number of bytes to read, may be zero + * @returns + * The number of bytes written and read from the device. This is + * maximum of tx_length and rx_length. + */ +int spi_master_block_write(spi_t *obj, const char *tx_buffer, int tx_length, char *rx_buffer, int rx_length); + /** Check if a value is available to read * * @param[in] obj The SPI peripheral to check