diff --git a/Documentation/pycardium/gpio.rst b/Documentation/pycardium/gpio.rst index 51c7d5f90f270aedf583d0bd347c85323683626d..7d17b3fdf3597aba664ebc46feae7f7a41dc62ba 100644 --- a/Documentation/pycardium/gpio.rst +++ b/Documentation/pycardium/gpio.rst @@ -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 diff --git a/epicardium/modules/gpio.c b/epicardium/modules/gpio.c index 68271cb93352e372d45bd679fcafedf55850b4c8..6b6977391f878fa58ad6618b98d08dcd9cf7f5a7 100644 --- a/epicardium/modules/gpio.c +++ b/epicardium/modules/gpio.c @@ -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, };