1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

boards/nucleo-g071rb: Added ADCs 0-5 for g071 nucleo

This commit is contained in:
Dave VanKampen 2021-09-24 10:21:17 -04:00
parent f278df5c96
commit ef6fc615ab
3 changed files with 23 additions and 0 deletions

View File

@ -15,6 +15,7 @@ config BOARD_NUCLEO_G071RB
select CPU_MODEL_STM32G071RB
# Put defined MCU peripherals here (in alphabetical order)
select HAS_PERIPH_ADC
select HAS_PERIPH_I2C
select HAS_PERIPH_RTT
select HAS_PERIPH_SPI

View File

@ -2,6 +2,7 @@ CPU = stm32
CPU_MODEL = stm32g071rb
# Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_adc
FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_rtt
FEATURES_PROVIDED += periph_spi

View File

@ -84,6 +84,27 @@ static const uart_conf_t uart_config[] = {
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
/**
* @name ADC configuration
*
* Note that we do not configure all ADC channels,
* and not in the STM32G071 order. Instead, we
* just define 6 ADC channels, for the Nucleo
* Arduino header pins A0-A5
*
* @{
*/
static const adc_conf_t adc_config[] = {
{ .pin = GPIO_PIN(PORT_A, 0), .dev = 0, .chan = 0 },
{ .pin = GPIO_PIN(PORT_A, 1), .dev = 0, .chan = 1 },
{ .pin = GPIO_PIN(PORT_A, 4), .dev = 0, .chan = 4 },
{ .pin = GPIO_PIN(PORT_B, 1), .dev = 0, .chan = 9 },
{ .pin = GPIO_PIN(PORT_B, 11), .dev = 0, .chan = 15 },
{ .pin = GPIO_PIN(PORT_B, 12), .dev = 0, .chan = 16 },
};
#define ADC_NUMOF ARRAY_SIZE(adc_config)
/**
* @name SPI configuration
* @{