HAL_USART_TransmitReceive() function
Full-Duplex Send and Receive an amount of data in full-duplex mode (blocking mode).
Arguments
husart
Pointer to a USART_HandleTypeDef structure that contains the configuration information for the specified USART module.
pTxData
Pointer to TX data buffer (u8 or u16 data elements).
pRxData
Pointer to RX data buffer (u8 or u16 data elements).
Size
Amount of data elements (u8 or u16) to be sent (same amount to be received).
Return value
HAL status
Notes
When USART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01), the sent data and the received data are handled as sets of u16. In this case, Size must indicate the number of u16 available through pTxData and through pRxData.