Skip to content

Commit

Permalink
boards/nucleo-f439zi: add full ADC config and doxygen doc
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztof-cabaj committed Aug 16, 2024
1 parent 2d52ebd commit 03c700f
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion boards/nucleo-f439zi/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,43 @@ static const eth_conf_t eth_config = {
#define ETH_DMA_ISR isr_dma2_stream0
/** @} */

static const adc_conf_t adc_config[] = {{}};
/**
* @name ADC configuration
*
* Note that we do not configure all ADC channels,
* and not in the STM32F439ZI order. Instead, we
* just define 6 ADC channels, for the Nucleo
* Arduino header pins A0-A5 and the internal VBAT channel.
*
* To find appropriate device and channel find in the
* board manual, table showing pin assignments and
* information about ADC - a text similar to ADC[X]_IN[Y],
* where:
* [X] - describes used device - indexed from 0,
* for example ADC12_IN10 is device 0 or device 1,
* [Y] - describes used channel - indexed from 1,
* for example ADC12_IN10 is channel 10
*
* For STM32F439ZI this information is in MCU datasheet,
* Table 10, page 53 or in Nucleo-f439ZI board manual,
* Table 17, page 52.
* @{
*/
static const adc_conf_t adc_config[] = {
{GPIO_PIN(PORT_A, 3), .dev = 2, .chan = 3}, /* ADC123_IN3 */
{GPIO_PIN(PORT_C, 0), .dev = 2, .chan = 10}, /* ADC123_IN10 */
{GPIO_PIN(PORT_C, 3), .dev = 2, .chan = 13}, /* ADC123_IN13 */
{GPIO_PIN(PORT_F, 3), .dev = 2, .chan = 9}, /* ADC3_IN9 */
{GPIO_PIN(PORT_F, 5), .dev = 2, .chan = 15}, /* ADC3_IN15 */
{GPIO_PIN(PORT_F, 10), .dev = 2, .chan = 8}, /* ADC3_IN8 */
{GPIO_UNDEF, .dev = 0, .chan = 18}, /* VBAT */
};

#define VBAT_ADC ADC_LINE(6) /**< VBAT ADC line */

#define ADC_NUMOF ARRAY_SIZE(adc_config)
/** @} */

#ifdef __cplusplus
}
Expand Down

0 comments on commit 03c700f

Please sign in to comment.