Browse Source

boards/nucleo-l1: add adc and dac configuration

pr/rotary
Alexandre Abadie 6 years ago
parent
commit
b4ff23580c
  1. 2
      boards/nucleo-l1/Makefile.features
  2. 34
      boards/nucleo-l1/include/periph_conf.h

2
boards/nucleo-l1/Makefile.features

@ -1,5 +1,7 @@
# Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_adc
FEATURES_PROVIDED += periph_cpuid
FEATURES_PROVIDED += periph_dac
FEATURES_PROVIDED += periph_gpio
FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_pwm

34
boards/nucleo-l1/include/periph_conf.h

@ -49,13 +49,6 @@ extern "C" {
#define CLOCK_APB1 (CLOCK_CORECLOCK / 1)
/** @} */
/**
* @name DAC configuration
* @{
*/
#define DAC_NUMOF (0)
/** @} */
/**
* @name Timer configuration
* @{
@ -221,7 +214,34 @@ static const i2c_conf_t i2c_config[] = {
{I2C2, GPIO_PIN(PORT_B, 10), GPIO_PIN(PORT_B, 11), GPIO_OD_PU,
GPIO_AF4, I2C2_ER_IRQn, I2C2_EV_IRQn},
};
/** @} */
/**
* @name ADC configuration
* @{
*/
#define ADC_CONFIG { \
{ GPIO_PIN(PORT_A, 0), 0 }, \
{ GPIO_PIN(PORT_A, 1), 1 }, \
{ GPIO_PIN(PORT_A, 4), 4 }, \
{ GPIO_PIN(PORT_B, 0), 8 }, \
{ GPIO_PIN(PORT_C, 1), 11 }, \
{ GPIO_PIN(PORT_C, 0), 10 }, \
}
#define ADC_NUMOF (6U)
/** @} */
/**
* @name DAC configuration
* @{
*/
#define DAC_CONFIG { \
{ GPIO_PIN(PORT_A, 4), 1}, \
{ GPIO_PIN(PORT_A, 5), 2}, \
}
#define DAC_NUMOF (2U)
/** @} */
#ifdef __cplusplus

Loading…
Cancel
Save