UART Driver Example Source Code Reference

This file contains the API that implements the UART Example functionalities.

This file contains sample source codes to demonstrate the UART Foundation Services APIs.

For this example application to work the following needs to be done:
  1. 1.Configure the EUSART module as follows:
    • Enable EUSART: ticked
    • Enable Transmit: ticked
    • Enable Receive: ticked
    • Enable EUSART Interrupts: ticked
    • Redirect STDIO to USART: ticked
    • Configure other settings as desired.
    • Select TX and RX pins in Pin Manager: Grid View.
  2. 2.Connect the board to a laptop serial port.
  3. 3.Open a serial port terminal application (i.e. PuTTY or TeraTerm)
  4. 4.Configure the serial port application to the following settings:
    • Baud Speed: same as the UART configuration
    • Data: same as the UART configuration
    • Parity: none
    • Stop bits: same as the UART configuration
    • Flow control: none
    • Receive: Carriage Return
    • Transmit: Carriage Return
    • Local Echo: On
  5. 5.Call UART_example_<USE_CASE>() from main().
This example works like this:
  1. 1.Upon reset, the application will display "START" to test UART_Write function.
  2. 2.The program will then print the following to test printf support: Hello World! 1 Hello World! 2 Hello World! 3
  3. 3.The program will then display "Receive test: Type a message then press enter (max 16 chars):"
  4. 4.Type a message no longer than 16 characters.
  5. 5.The program will then print "You typed:" and echo back your message. This will ensure that the UART_Read function is working.
  6. 6.If everything is working fine, the program will print "OK."

Note: To test other instances, feel free to modify this file.