stm32-rs / stm32g0xx-hal

Peripheral access API for STM32G0 series microcontrollers
Apache License 2.0
74 stars 51 forks source link

Change DAC functionality in EnabledUnbuffered mode #54

Closed richardeoin closed 3 years ago

richardeoin commented 3 years ago

Previously MCR.MODE[12] = 3, which corresponds to "connected to on chip peripherals with buffer disabled". In this case the DAC output is not connected to the pin, which is quite unexpected.

Change to MCR.MODE[12] = 2, which corresponds to "connected to external pin with buffer disabled". This provides the expected functionality.

Perhaps it would be useful to support connecting the DAC to on-chip peripherals, but that should be available separately to the choice of buffered/unbuffered.

dotcypress commented 3 years ago

Great! Thank you