Data transfers functions.
More...
Data transfers functions.
===============================================================================
##### Data transfers functions #####
===============================================================================
[..] This section provides a set of functions allowing to manage the SPI or I2S
data transfers.
[..] In reception, data are received and then stored into an internal Rx buffer while
In transmission, data are first stored into an internal Tx buffer before being
transmitted.
[..] The read access of the SPI_DR register can be done using
SPI_ReceiveData8() (when data size is equal or inferior than 8bits) and.
SPI_I2S_ReceiveData16() (when data size is superior than 8bits)function
and returns the Rx buffered value. Whereas a write access to the SPI_DR
can be done using SPI_SendData8() (when data size is equal or inferior than 8bits)
and SPI_I2S_SendData16() (when data size is superior than 8bits) function
and stores the written data into Tx buffer.
uint16_t SPI_I2S_ReceiveData16 |
( |
SPI_TypeDef * |
SPIx | ) |
|
Returns the most recent received data by the SPIx peripheral.
- Parameters
-
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
- Return values
-
The | value of the received data. |
void SPI_I2S_SendData16 |
( |
SPI_TypeDef * |
SPIx, |
|
|
uint16_t |
Data |
|
) |
| |
Transmits a Data through the SPIx/I2Sx peripheral.
- Parameters
-
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
Data,: | Data to be transmitted. |
- Return values
-
uint8_t SPI_ReceiveData8 |
( |
SPI_TypeDef * |
SPIx | ) |
|
Returns the most recent received data by the SPIx/I2Sx peripheral.
- Parameters
-
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
- Return values
-
The | value of the received data. |
void SPI_SendData8 |
( |
SPI_TypeDef * |
SPIx, |
|
|
uint8_t |
Data |
|
) |
| |
Transmits a Data through the SPIx/I2Sx peripheral.
- Parameters
-
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
Data,: | Data to be transmitted. |
- Return values
-