zephyr/samples/drivers/uart/echo_bot
Benjamin Cabé f6a4217a88 doc: driver: samples: Update driver samples to use new Sphinx extension
Migrated existing driver samples to use the new code-sample directive
and role.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-22 09:21:43 +02:00
..
src
CMakeLists.txt
README.rst doc: driver: samples: Update driver samples to use new Sphinx extension 2023-09-22 09:21:43 +02:00
prj.conf
sample.yaml

README.rst

.. zephyr:code-sample:: uart
   :name: UART echo
   :relevant-api: uart_interface

   Read data from the console and echo it back.

Overview
********

This sample demonstrates how to use the UART serial driver with a simple
echo bot. It reads data from the console and echoes the characters back after
an end of line (return key) is received.

The polling API is used for sending data and the interrupt-driven API
for receiving, so that in theory the thread could do something else
while waiting for incoming data.

By default, the UART peripheral that is normally used for the Zephyr shell
is used, so that almost every board should be supported.

Building and Running
********************

Build and flash the sample as follows, changing ``nrf52840dk_nrf52840`` for
your board:

.. zephyr-app-commands::
   :zephyr-app: samples/drivers/uart/echo_bot
   :board: nrf52840dk_nrf52840
   :goals: build flash
   :compact:

Sample Output
=============

.. code-block:: console

    Hello! I\'m your echo bot.
    Tell me something and press enter:
    # Type e.g. "Hi there!" and hit enter!
    Echo: Hi there!