boards/nucleo-f303k8: add ADC feature
This commit is contained in:
parent
b2da5d0687
commit
f03a9f603c
@ -15,6 +15,7 @@ config BOARD_NUCLEO_F303K8
|
|||||||
select CPU_MODEL_STM32F303K8
|
select CPU_MODEL_STM32F303K8
|
||||||
|
|
||||||
# Put defined MCU peripherals here (in alphabetical order)
|
# Put defined MCU peripherals here (in alphabetical order)
|
||||||
|
select HAS_PERIPH_ADC
|
||||||
select HAS_PERIPH_DMA
|
select HAS_PERIPH_DMA
|
||||||
select HAS_PERIPH_PWM
|
select HAS_PERIPH_PWM
|
||||||
select HAS_PERIPH_RTC
|
select HAS_PERIPH_RTC
|
||||||
|
|||||||
@ -2,6 +2,7 @@ CPU = stm32
|
|||||||
CPU_MODEL = stm32f303k8
|
CPU_MODEL = stm32f303k8
|
||||||
|
|
||||||
# Put defined MCU peripherals here (in alphabetical order)
|
# Put defined MCU peripherals here (in alphabetical order)
|
||||||
|
FEATURES_PROVIDED += periph_adc
|
||||||
FEATURES_PROVIDED += periph_dma
|
FEATURES_PROVIDED += periph_dma
|
||||||
FEATURES_PROVIDED += periph_pwm
|
FEATURES_PROVIDED += periph_pwm
|
||||||
FEATURES_PROVIDED += periph_rtc
|
FEATURES_PROVIDED += periph_rtc
|
||||||
|
|||||||
@ -34,6 +34,27 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name ADC configuration
|
||||||
|
*
|
||||||
|
* Note that we do not configure all ADC channels,
|
||||||
|
* and not in the STM32F303 order. Instead, we
|
||||||
|
* just define 6 ADC channels, for the Nucleo
|
||||||
|
* Arduino header pins A0-A3 and A6
|
||||||
|
*
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
static const adc_conf_t adc_config[] = {
|
||||||
|
{ .pin = GPIO_PIN(PORT_A, 0), .dev = 0, .chan = 1 }, /* ADC1_IN1, fast */
|
||||||
|
{ .pin = GPIO_PIN(PORT_A, 1), .dev = 0, .chan = 2 }, /* ADC1_IN2, fast */
|
||||||
|
{ .pin = GPIO_PIN(PORT_A, 3), .dev = 0, .chan = 4 }, /* ADC1_IN4, fast */
|
||||||
|
{ .pin = GPIO_PIN(PORT_A, 4), .dev = 1, .chan = 1 }, /* ADC2_IN1, fast */
|
||||||
|
{ .pin = GPIO_PIN(PORT_A, 7), .dev = 1, .chan = 4 }, /* ADC2_IN4, fast */
|
||||||
|
};
|
||||||
|
|
||||||
|
#define ADC_NUMOF ARRAY_SIZE(adc_config)
|
||||||
|
/** @} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name DMA streams configuration
|
* @name DMA streams configuration
|
||||||
* @{
|
* @{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user