samples/drivers/uart/echo_bot/README.html · samples/drivers/uart/echo_bot/README.rst 공식 원문 ↗

Zephyr 3.7.0 · Samples · Drivers · UART

UART Echo

Polling 송신과 interrupt-driven 수신을 함께 사용합니다.

Official pathsamples/drivers/uart/echo_bot/README.html
Source filesamples/drivers/uart/echo_bot/README.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

본문 기준: Zephyr 3.7.0 LTS3 · 이후 유지보수 패치는 별도입니다.

Part 1

요약·해설

Return key 처리, 기본 shell UART와 전체 대화 출력을 보존합니다.

TX

Polling API

RX

Interrupt API

Trigger

End of line

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 591F83DF875E6B98BEAF0A6A8A508A69AB6F3F7DA4D30331F470ADD2CA9A3221
.. 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!

Part 3

한국어 전문 번역

개요

이 sample은 간단한 echo bot으로 UART serial driver를 사용하는 방법을 보여줍니다. Console에서 data를 읽고 줄 끝, 즉 return key를 수신하면 입력 문자를 그대로 되돌려 보냅니다.

Data 송신에는 polling API를 사용하고 수신에는 interrupt-driven API를 사용하므로, 이론적으로 thread는 incoming data를 기다리는 동안 다른 작업을 수행할 수 있습니다.

기본적으로 Zephyr shell에 보통 사용하는 UART peripheral을 사용하므로 거의 모든 board가 지원됩니다.

Build와 실행

다음과 같이 sample을 build하고 flash합니다. nrf52840dk/nrf52840은 사용하는 board 이름으로 바꾸십시오.

west build -b nrf52840dk/nrf52840 samples/drivers/uart/echo_bot
west flash

Sample 출력

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

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.