pub struct CommonAdc<ADC> { /* private fields */ }
Expand description
The common ADC peripheral, which is shared between different concrete ADC peripheral.
For example CommonAdc<ADC1_2>
shares control over pac::ADC1
and pac::ADC2
.
This peripheral can control different parts, like enabling internal sensors (like temperature sensor) or enable dual channel mode (which is not supported yet.)
Implementations§
Source§impl<ADC> CommonAdc<ADC>where
ADC: CommonInstance,
impl<ADC> CommonAdc<ADC>where
ADC: CommonInstance,
Sourcepub fn new(common_adc: ADC, clocks: &Clocks, ahb: &mut AHB) -> Self
pub fn new(common_adc: ADC, clocks: &Clocks, ahb: &mut AHB) -> Self
Create a CommonAdc
instance, consuming the pac
’s ADC (e.g. pac::ADC1_2
.
Sourcepub unsafe fn peripheral(&mut self) -> &mut ADC
pub unsafe fn peripheral(&mut self) -> &mut ADC
Get access to the underlying register block.
§Safety
This function is not memory unsafe per se, but does not guarantee anything about assumptions of invariants made in this implementation.
Changing specific options can lead to un-expected behavior and nothing is guaranteed.
Source§impl<ADC> CommonAdc<ADC>where
ADC: CommonInstance + Enable,
impl<ADC> CommonAdc<ADC>where
ADC: CommonInstance + Enable,
Sourcepub fn free(self, _adcs: &<ADC as CommonInstance>::Childs) -> ADC
pub fn free(self, _adcs: &<ADC as CommonInstance>::Childs) -> ADC
Releases the common ADC peripheral
Auto Trait Implementations§
impl<ADC> Freeze for CommonAdc<ADC>where
ADC: Freeze,
impl<ADC> RefUnwindSafe for CommonAdc<ADC>where
ADC: RefUnwindSafe,
impl<ADC> Send for CommonAdc<ADC>where
ADC: Send,
impl<ADC> Sync for CommonAdc<ADC>where
ADC: Sync,
impl<ADC> Unpin for CommonAdc<ADC>where
ADC: Unpin,
impl<ADC> UnwindSafe for CommonAdc<ADC>where
ADC: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more