stm32-rs / stm32g4xx-hal

Peripheral access API for STM32G4 series microcontrollers
Apache License 2.0
66 stars 48 forks source link

Add internal DAC outputs to available opamp inputs. #123

Open davidstalnaker opened 9 months ago

davidstalnaker commented 9 months ago

This is done by adding internal structs for the DAC outputs and passing these into the constructor functions instead of an input pin, e.g. opamp1.follower(Dac3Out1, Some(gpioa.pa2.into_analog()));

I've tested that this works at least with opamps 1, 3, 4, and 5 in follower mode on an STM32G473. Can't verify everything of course but I don't see anything obvious that would break elsewhere, and it at least builds for other devices.

After writing this I now see related work in https://github.com/stm32-rs/stm32g4xx-hal/pull/113. If I'm reading right, I think this change is completely orthogonal and should merge with that one pretty cleanly.