STM32 USART Lecture 5 – USART Driver API: Tx and Rx assignment

 

USART Driver API: Tx and Rx assignment

 

 

Now let’s attempt data send, and data receive API with blocking and non-blocking mode.

Steps:

1. Download the file attached in the resource section, and the file name is USART_DataTxRxAPIs.c (Figure 1).

Tx and Rx assignment
Figure 1. USART_DataTxRxAPIs.c file.

 

2. In the downloaded file, the USART send data, receive data, send data with IT and receive data with IT APIs are implemented partially. There are a couple of TODOs, which you have to resolve.

The implementation of APIs is similar to the way you coded for I2C and SPI.

USART Driver API: Tx and Rx assignment
Figure 2. Partially implemented APIs with comments and TODOs.

 

3. When you code for these APIs, you can see that they use a couple of USART flags. These flags should be created in the usart_driver.h file similar to I2C and SPI.

USART Driver API: Tx and Rx assignment
Figure 3. USART flags.

In the following article, let’s see USART Driver API: Send data.

 

FastBit Embedded Brain Academy Courses

Click here: https://fastbitlab.com/course1

FastBitLab

The FastBit Embedded Brain Academy uses the power of internet to bring the online courses related to the field of embedded system programming, Real time operating system, Embedded Linux systems, etc at your finger tip with very low cost. Backed with strong experience of industry, we have produced lots of courses with the customer enrolment over 3000+ across 100+ countries.