This one I am following the coach as it is for revising. So, writing down the essentials parts here.
1. In the usart_driver.h file, all the required macros are written. For example, the number of Stop bits that can be configured or Rx enable or not.
2. We wrote the init API. The second API is Transmit.
We check if the payload size is 9 bits or 8 bits and if the Parity is enabled. So, from the data, we only mask the 8 bits and increment the buffer.
3. Next, we will write an API to change the Baud Rate.
Oversampling is simply how much times more does the rx pin samples the data and decides whether the bit is 1 or 0. Higher, oversampling means better data but low baud rate.
4. Baud Rate
5. Programming the Baud Rate
6. We send the data from ST board to Arduino. ST board sets its GPIO to UART and set it as per the stop bits, payload, baud rate etc. Enable the peripheral and use the APIs to transmit data to Arduino.
7. Connecting USART to USB PC
USART to USB converter to connect the PC is not present in discovery board.
8. Interrupts
9. Exercise
We will send a string to arduino in blocking mode and receive the same string converted into capital letters in interrupt mode.
This was a revision of how to write embedded API. I will now, go to the next course and complete it thoroughly because its second part (Low Power,RTC) is done. Timer and CAN needs to be done.