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

cpu/efm32: fix DAC reference voltage configuration

The EFM32 MCU allows the reference voltage to be configured per DAC device, not per DAC channel. Also, the DAC reference voltage was defined in the configuration but not used anywhere.
This commit is contained in:
Gunar Schorcht 2023-08-15 13:20:59 +02:00
parent 91441db357
commit 817bb48843
2 changed files with 2 additions and 1 deletions

View File

@ -79,6 +79,7 @@ typedef struct {
*/
typedef struct {
DAC_TypeDef *dev; /**< DAC device used */
DAC_Ref_TypeDef ref; /**< DAC voltage reference */
CMU_Clock_TypeDef cmu; /**< the device CMU channel */
} dac_conf_t;
@ -88,7 +89,6 @@ typedef struct {
typedef struct {
uint8_t dev; /**< device index */
uint8_t index; /**< channel index */
DAC_Ref_TypeDef ref; /**< channel voltage reference */
} dac_chan_conf_t;
#endif

View File

@ -45,6 +45,7 @@ int8_t dac_init(dac_t line)
/* reset and initialize peripheral */
DAC_Init_TypeDef init = DAC_INIT_DEFAULT;
init.reference = dac_config[dev].ref;
DAC_Reset(dac_config[dev].dev);
DAC_Init(dac_config[dev].dev, &init);