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

boards/nucleo-g070rb: Added ADCs 0-5 for g070 nucleo

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

View File

@ -15,6 +15,7 @@ config BOARD_NUCLEO_G070RB
select CPU_MODEL_STM32G070RB
# Put defined MCU peripherals here (in alphabetical order)
select HAS_PERIPH_ADC
select HAS_PERIPH_I2C
select HAS_PERIPH_SPI
select HAS_PERIPH_TIMER

View File

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

View File

@ -86,6 +86,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 STM32G070 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
* @{