Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Documentation/platforms/arm/rtl8721dx/boards/pke8721daf/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Supported in this NuttX port:
partition), backing the Wi-Fi key-value store
* Wi-Fi station and SoftAP through the ``wapi`` tool
* DHCP client (STA) and DHCP server (SoftAP)
* GPIO pins exposed as ``/dev/gpioN`` character devices (input, output and
interrupt), driven directly on the SDK fwlib register layer

Buttons and LEDs
================
Expand All @@ -58,6 +60,24 @@ The console is the LOG-UART at 1500000 8N1 (the rate is configured by the
bootloader and inherited by NuttX). The Wi-Fi examples below are available from
this configuration.

gpio
----

Minimal NSH with the GPIO driver and the ``gpio`` example enabled (no Wi-Fi).
The board registers three pins from its pin table (see
``boards/arm/rtl8721dx/pke8721daf/src/rtl8721dx_gpio.c``): an output at
``/dev/gpio0``, an input at ``/dev/gpio1`` and an interrupt pin at
``/dev/gpio2``. Edit that table to match a board's wiring. Exercise them with
the example::

nsh> gpio -o 1 /dev/gpio0 # drive the output high
nsh> gpio /dev/gpio1 # read the input
nsh> gpio -w 1 /dev/gpio2 # wait for a rising-edge interrupt

Pins are encoded with the ``AMEBA_PA()`` / ``AMEBA_PB()`` helpers from
``arch/arm/src/common/ameba/ameba_gpio.h`` (port A/B, pin 0-31), matching the
Ameba SDK ``PinName`` layout.

Wi-Fi
=====

Expand Down
25 changes: 25 additions & 0 deletions arch/arm/src/common/ameba/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
# Shared Realtek Ameba peripheral drivers (arch/arm/src/common/ameba). These
# options are common to every Ameba ARM chip (RTL8721Dx, RTL8720F, ...) and
# are sourced from each chip's own Kconfig.
#

menu "Ameba Peripheral Support"

config AMEBA_GPIO
bool "GPIO"
default n
select DEV_GPIO
---help---
Expose Ameba GPIO pins through the NuttX GPIO (ioexpander) upper
half at /dev/gpioN. The board selects which pins are registered
and their type (input, output or interrupt) in its bring-up code.

The driver (arch/arm/src/common/ameba/ameba_gpio.c) sits on the SDK
fwlib register layer and dispatches pin interrupts through the ROM
GPIO interrupt handler.

endmenu # Ameba Peripheral Support
Loading
Loading