Basic UART Example

Echo characters received on a UART

API Features Demonstrated

Platforms

This app works on:

Requirements and Prerequisites

This app requires a ZentriOS device, such as an AMWx06 (Moray) evaluation board.

Description

The app configures the UART and echoes characters received on the UART. Keys typed into a ZentriOS terminal are echoed back to the terminal.

Usage Instructions

Connect a serial terminal application to the ZentriOS device UART.

The terminal application should be set to match the ZentriOS app configuration:

On running the app displays on the ZentriOS terminal:

>UART App Ready. Type something ...

Each character you type appears on the terminal.

Implementation

zn_app_init:

uart_rx_callback:

uart_rx_event_handler:

zn_app_deinit:

Notes

Note that the uart makefile uart.mk contains the line:

GLOBAL_DEFINES := ZOS_FLAGS=ZOS_FLAG_DISABLE_CMD_CONSOLE

This adds, to the ZentriOS app, a header that disables the command console when the ZentriOS app is running. This prevents conflict between the app and the serial command console.

Source

See: