diff --git a/boards/msbiot/Makefile.features b/boards/msbiot/Makefile.features index 1826fdc268184446f27c793e275fa951c8e40c26..e6c82f7d3087fe5223ea964961112394ebcdac4b 100644 --- a/boards/msbiot/Makefile.features +++ b/boards/msbiot/Makefile.features @@ -1,4 +1,5 @@ FEATURES_PROVIDED += cpp -FEATURES_PROVIDED += periph_uart periph_gpio periph_spi periph_i2c periph_pwm +FEATURES_PROVIDED += periph_uart periph_gpio periph_spi periph_i2c periph_pwm periph_random \ + periph_adc periph_dac FEATURES_PROVIDED += transceiver FEATURES_MCU_GROUP = cortex_m4 diff --git a/boards/msbiot/include/periph_conf.h b/boards/msbiot/include/periph_conf.h index dafc37dadaf09f086286b727735d05581209f704..6135a7f3b8b36daf3b209d16f4c19116a9767673 100644 --- a/boards/msbiot/include/periph_conf.h +++ b/boards/msbiot/include/periph_conf.h @@ -91,6 +91,56 @@ extern "C" { #define PWM_0_PIN_AF 3 /** @} */ +/** + * @name ADC configuration + * @{ + */ +#define ADC_NUMOF (1U) +#define ADC_0_EN 1 +#define ADC_MAX_CHANNELS 2 + +/* ADC 0 configuration */ +#define ADC_0_DEV ADC1 +#define ADC_0_CHANNELS 2 +#define ADC_0_CLKEN() (RCC->APB2ENR |= RCC_APB2ENR_ADC1EN) +#define ADC_0_CLKDIS() (RCC->APB2ENR &= ~(RCC_APB2ENR_ADC1EN)) +#define ADC_0_PORT GPIOB +#define ADC_0_PORT_CLKEN() (RCC->AHB1ENR |= RCC_AHB1ENR_GPIOBEN) +/* ADC 0 channel 0 pin config */ +#define ADC_0_CH0 8 +#define ADC_0_CH0_PIN 0 +/* ADC 0 channel 1 pin config */ +#define ADC_0_CH1 9 +#define ADC_0_CH1_PIN 1 +/** @} */ + +/** + * @name DAC configuration + * @{ + */ +#define DAC_NUMOF (1U) +#define DAC_0_EN 1 +#define DAC_MAX_CHANNELS 2 + +/* DAC 0 configuration */ +#define DAC_0_DEV DAC +#define DAC_0_CHANNELS 2 +#define DAC_0_CLKEN() (RCC->APB1ENR |= (RCC_APB1ENR_DACEN)) +#define DAC_0_CLKDIS() (RCC->APB1ENR &= ~(RCC_APB1ENR_DACEN)) +#define DAC_0_PORT GPIOA +#define DAC_0_PORT_CLKEN() (RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN) +/* DAC 0 channel config */ +#define DAC_0_CH0_PIN 4 +#define DAC_0_CH1_PIN 5 +/** @} */ + +/** + * @name Random Number Generator configuration + * @{ + */ +#define RANDOM_NUMOF (1U) +/** @} */ + /** * @name UART configuration * @{