This is the documentation for the latest (main) development branch of HPM SDK. If you are looking for the documentation of previous releases, use the drop-down menu on the left and select the desired version.

6.38. Universal asynchronous transceiver UART

6.38.1. Overview


uart The general asynchronous transceiver UART driver example project shows the configuration and use method of UART to realize the receiving and sending of serial port data.

  • In the example code, the UART serial port resources are initialized and configured, the serial port clock and the receiving and sending FIFO depth are set, and the interrupt is configured to realize the sending and receiving of serial port receipts.

6.38.2. Port Settings


  • Serial port baud rate is set to 115200bps, with one stop bit and no parity bit

6.38.3. Note


  • The input string length should not exceed UART_SOC_FIFO_SIZE defined in the program every time

6.38.4. Running the example


When the project runs correctly, the serial port terminal will output the following information:

> uart driver example
> fifo mode
> uart will send back received characters, echo every 16 bytes

Manually input the string through the serial port, such as 1234567887654321, and the serial port terminal will receive the following information:

> 1234567887654321