Skip to content
Snippets Groups Projects
Commit 828147c2 authored by swym's avatar swym
Browse files

gpio: document mode.ADC, move comment out of clang-tidy's reach

parent 127ea870
No related branches found
No related tags found
1 merge request!229feat(epicardium): gpios are configurable as ADC
......@@ -25,7 +25,10 @@ output in your scripts.
:param int pin: ID of the pin to be configured.
:param int mode: An integer with the bits for the wanted mode set. Create your
integer by ORing :py:data:`gpio.mode.OUTPUT`, :py:data:`gpio.mode.INPUT`,
:py:data:`gpio.mode.PULL_UP`, :py:data:`gpio.mode.PULL_DOWN`.
:py:data:`gpio.mode.ADC`, :py:data:`gpio.mode.PULL_UP`,
:py:data:`gpio.mode.PULL_DOWN`.
.. note:: On WRISTBAND_3, there is no ADC functionality available
.. py:function:: get_mode(pin)
......@@ -47,6 +50,9 @@ output in your scripts.
:param int pin: ID of the pin of to get the mode of.
:returns: Current value of the GPIO pin.
If the pin is configured as ADC, the value returned
will be between 0 and 1000, representing voltages from
0V to 3.3V
.. py:data:: WRISTBAND_1
......
......@@ -33,8 +33,11 @@ static gpio_cfg_t gpio_configs[] = {
static int s_adc_channels[] = {
[EPIC_GPIO_WRISTBAND_1] = ADC_CH_5,
[EPIC_GPIO_WRISTBAND_2] = ADC_CH_6,
[EPIC_GPIO_WRISTBAND_3] =
-1, //AFAICT on P0.29, there is no ADC available
/* on P0.29, there is no ADC available
* see GPIO matrix in MAX32665-MAX32668.pdf,
* pages 32,33
*/
[EPIC_GPIO_WRISTBAND_3] = -1,
[EPIC_GPIO_WRISTBAND_4] = ADC_CH_4,
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment