samples/boards/nrf/nrfx/README.html · samples/boards/nrf/nrfx/README.rst 공식 원문 ↗

Zephyr 3.7.0 · Boards · Nordic nrfx

nrfx 사용 예제

Zephyr interrupt 초기화와 nrfx peripheral task-event 연결을 함께 사용합니다.

Official pathsamples/boards/nrf/nrfx/README.html
Source filesamples/boards/nrf/nrfx/README.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

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

Part 1

요약·해설

GPIO driver 충돌 방지, hardware event path와 debounce 부재를 설명합니다.

Interrupt

GPIOTE

Interconnect

DPPI · PPI

CPU

No intervention

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 757EE5BA1815E75F35E02BD587E5BD2F7399B07FA01CBBBD0687C495D3CFBDB3
.. _nrfx_sample:

nrfx use example
################

Overview
********

This sample demonstrates the usage of nrfx library in Zephyr.
GPIOTE and DPPI/PPI are used as examples of nrfx drivers.

The code shows how to initialize the GPIOTE interrupt in Zephyr
so that the nrfx_gpiote driver can use it. Additionally, it shows
how the DPPI/PPI subsystem can be used to connect tasks and events of
nRF peripherals, enabling those peripherals to interact with each
other without any intervention from the CPU.

Zephyr GPIO driver is disabled to prevent it from registering its own handler
for the GPIOTE interrupt. Button 1 is configured to create an event when pushed.
This calls the ``button_handler()`` callback and triggers the LED 1 pin OUT task.
LED is then toggled.

Please note that no debouncing mechanism is used for the button, so it may
happen that one press results in multiple events. And because the event-task
connection is handled in hardware, for very fast coming events, toggling of
the LED may sometimes be even unnoticeable.

Requirements
************

This sample has been tested on the NordicSemiconductor nRF9160 DK
(nrf9160dk/nrf9160) and nRF52840 DK (nrf52840dk/nrf52840) boards.

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

The code can be found in :zephyr_file:`samples/boards/nrf/nrfx`.

To build and flash the application:

.. zephyr-app-commands::
   :zephyr-app: samples/boards/nrf/nrfx
   :board: nrf9160dk/nrf9160
   :goals: build flash
   :compact:

Push Button 1 to toggle the LED 1.

Connect to the serial port - notice that each time the button is pressed,
the ``button_handler()`` function is called.

See nrfx_repository_ for more information about nrfx.

.. _nrfx_repository: https://github.com/NordicSemiconductor/nrfx

Part 3

한국어 전문 번역

개요

Zephyr에서 nrfx library를 사용하는 방법을 보여주는 sample입니다. Nrfx driver 예제로 GPIOTE와 DPPI/PPI를 사용합니다.

Code는 nrfx_gpiote driver가 사용할 수 있도록 Zephyr에서 GPIOTE interrupt를 초기화하는 방법을 보여줍니다. 또한 DPPI/PPI subsystem으로 nRF peripheral의 task와 event를 연결해 CPU 개입 없이 peripheral끼리 상호작용하게 하는 방법도 보여줍니다.

GPIOTE interrupt에 Zephyr GPIO driver가 자체 handler를 등록하지 않도록 이 driver를 비활성화합니다. Button 1은 눌렸을 때 event를 만들도록 구성됩니다. 이 event는 button_handler() callback을 호출하고 LED 1 pin의 OUT task를 trigger하며, 그 결과 LED가 toggle됩니다.

Button에는 debounce mechanism을 사용하지 않으므로 한 번 누른 동작이 여러 event를 만들 수 있습니다. Event-task 연결은 hardware가 처리하므로 event가 매우 빠르게 연속 발생하면 LED toggle이 눈에 보이지 않을 수도 있습니다.

요구 사항

이 sample은 Nordic Semiconductor nRF9160 DK(nrf9160dk/nrf9160)와 nRF52840 DK(nrf52840dk/nrf52840) board에서 시험되었습니다.

Build와 실행

Source code는 Zephyr tree의 samples/boards/nrf/nrfx에 있습니다. 다음 명령으로 application을 build하고 flash합니다.

west build -b nrf9160dk/nrf9160 samples/boards/nrf/nrfx
west flash

Button 1을 눌러 LED 1을 toggle합니다.

Serial port에 연결하면 button을 누를 때마다 button_handler() function이 호출되는 것을 볼 수 있습니다. Nrfx에 관한 자세한 내용은 nrfx repository를 참조하십시오.

Source

출처

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