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
17 changes: 17 additions & 0 deletions Documentation/platforms/arm/rtl8720f/boards/rtl8720f_evb/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Supported in this NuttX port:
on the SDK fwlib register layer
* PWM output exposed as a ``/dev/pwm0`` character device, driven directly on
the SDK fwlib timer register layer
* ADC channels exposed as an ``/dev/adc0`` character device, driven directly
on the SDK fwlib register layer

Buttons and LEDs
================
Expand Down Expand Up @@ -144,6 +146,21 @@ example::

nsh> pwm -d 25 -f 1000 # 1 kHz, 25% duty on /dev/pwm0

adc
---

Minimal NSH with the ADC driver and the ``adc`` example enabled (no Wi-Fi).
The board registers its channels from a table (see
``boards/arm/rtl8720f/rtl8720f_evb/src/rtl8720f_adc.c``): ``/dev/adc0`` samples
CH0 on PA13 and CH1 on PA14. Edit that table -- channel numbers and the analog
pad each is wired to -- to match a board's wiring; the external channels
CH0..CH5 map to pads PA13..PA18 and are muxed to the ADC function through the
SDK ROM, while internal channels carry ``AMEBA_ADC_PIN_NC``. Every listed
channel is sampled, in order, on each trigger. Read the channels with the
example::

nsh> adc -n 1 # one sweep of /dev/adc0

nsh
---

Expand Down
17 changes: 17 additions & 0 deletions Documentation/platforms/arm/rtl8721dx/boards/pke8721daf/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Supported in this NuttX port:
on the SDK fwlib register layer
* PWM output exposed as a ``/dev/pwm0`` character device, driven directly on
the SDK fwlib timer register layer
* ADC channels exposed as an ``/dev/adc0`` character device, driven directly
on the SDK fwlib register layer

Buttons and LEDs
================
Expand Down Expand Up @@ -153,6 +155,21 @@ example::

nsh> pwm -d 25 -f 1000 # 1 kHz, 25% duty on /dev/pwm0

adc
---

Minimal NSH with the ADC driver and the ``adc`` example enabled (no Wi-Fi).
The board registers its channels from a table (see
``boards/arm/rtl8721dx/pke8721daf/src/rtl8721dx_adc.c``): ``/dev/adc0`` samples
CH0 on PB19 and CH1 on PB18. Edit that table -- channel numbers and the analog
pad each is wired to -- to match a board's wiring; the external channels
CH0..CH6 map to pads PB19..PB13 and are muxed to the ADC function through the
SDK ROM, while internal channels carry ``AMEBA_ADC_PIN_NC``. Every listed
channel is sampled, in order, on each trigger. Read the channels with the
example::

nsh> adc -n 1 # one sweep of /dev/adc0

Wi-Fi
=====

Expand Down
17 changes: 17 additions & 0 deletions Documentation/platforms/arm/rtl8721f/boards/rtl8721f_evb/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ Supported in this NuttX port:
on the SDK fwlib register layer
* PWM output exposed as a ``/dev/pwm0`` character device, driven directly on
the SDK fwlib timer register layer
* ADC channels exposed as an ``/dev/adc0`` character device, driven directly
on the SDK fwlib register layer

Buttons and LEDs
================
Expand Down Expand Up @@ -147,6 +149,21 @@ example::

nsh> pwm -d 25 -f 1000 # 1 kHz, 25% duty on /dev/pwm0

adc
---

Minimal NSH with the ADC driver and the ``adc`` example enabled (no Wi-Fi).
The board registers its channels from a table (see
``boards/arm/rtl8721f/rtl8721f_evb/src/rtl8721f_adc.c``): ``/dev/adc0`` samples
CH0 on PA20 and CH1 on PA19. Edit that table -- channel numbers and the analog
pad each is wired to -- to match a board's wiring; the external channels
CH0..CH7 map to pads PA20,PA19,PA18,PA17,PA15,PA14,PA13,PA12 and are muxed to
the ADC function through the SDK ROM, while internal channels carry
``AMEBA_ADC_PIN_NC``. Every listed channel is sampled, in order, on each
trigger. Read the channels with the example::

nsh> adc -n 1 # one sweep of /dev/adc0

nsh
---

Expand Down
17 changes: 17 additions & 0 deletions arch/arm/src/common/ameba/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,21 @@ config AMEBA_PWM
The driver (arch/arm/src/common/ameba/ameba_pwm.c) sits on the SDK
fwlib RTIM register layer and runs in polling task context.

config AMEBA_ADC
bool "ADC"
default n
select ANALOG
select ADC
---help---
Expose the Ameba SAR ADC as a NuttX ADC input at /dev/adc0. The
converter has one channel-switch list; the board selects which
channels are sampled and which analog pad each external channel is
wired to in its bring-up code. Every channel is sampled, in list
order, on each ANIOC_TRIGGER.

The driver (arch/arm/src/common/ameba/ameba_adc.c) sits on the SDK
fwlib register layer and reads the auto channel-switch FIFO by
polling in task context (the chip does not enable a hardware
software-trigger path).

endmenu # Ameba Peripheral Support
Loading
Loading