Skip to content

Commit

Permalink
Add missing impls
Browse files Browse the repository at this point in the history
  • Loading branch information
usbalbin committed Nov 29, 2023
1 parent 6887fcb commit 78d4075
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/dac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,18 @@ impl_pin_for_dac!(DAC2: (PA6<DefaultMode>, Dac2IntSig1), Dac2Ch1<M_MIX_SIG, Disa
// DAC3 int
impl_pin_for_dac!(DAC3: Dac3IntSig1, Dac3Ch1<M_INT_SIG, Disabled>);
impl_pin_for_dac!(DAC3: Dac3IntSig2, Dac3Ch2<M_INT_SIG, Disabled>);
impl_pin_for_dac!(
DAC3: (Dac3IntSig1, Dac3IntSig2),
(Dac3Ch1<M_INT_SIG, Disabled>, Dac3Ch2<M_INT_SIG, Disabled>)
);

// DAC4 int
impl_pin_for_dac!(DAC4: Dac4IntSig1, Dac4Ch1<M_INT_SIG, Disabled>);
impl_pin_for_dac!(DAC4: Dac4IntSig2, Dac4Ch2<M_INT_SIG, Disabled>);
impl_pin_for_dac!(
DAC4: (Dac4IntSig1, Dac4IntSig2),
(Dac4Ch1<M_INT_SIG, Disabled>, Dac4Ch2<M_INT_SIG, Disabled>)
);

pub fn dac<DAC, PINS>(_dac: DAC, _pins: PINS, _rcc: &mut Rcc) -> PINS::Output
where
Expand Down Expand Up @@ -180,6 +188,8 @@ macro_rules! dac_helper {
),)+) => {
$(
impl<const MODE_BITS: u8> $CX<MODE_BITS, Disabled> {
/// TODO: The DAC does not seem to work unless `calibrate_buffer` has been callen
/// even when only using dac output internally
pub fn enable(self) -> $CX<MODE_BITS, Enabled> {
let dac = unsafe { &(*<$DAC>::ptr()) };

Expand Down

0 comments on commit 78d4075

Please sign in to comment.