pub struct SharedAdc<Adc> { /* private fields */ }
Expand description
An ADC peripheral that can provide ownership of individual channels for sharing between drivers.
Implementations§
Sourcepub fn new(slope: f32, adc: Adc<Adc, Enabled>) -> Self
pub fn new(slope: f32, adc: Adc<Adc, Enabled>) -> Self
Construct a new shared ADC driver.
§Args
slope
- The slope of the ADC conversion transfer function.adc
- The ADC peripheral to share.
Sourcepub fn create_channel<PIN: Channel<Adc, ID = u8>>(
&self,
pin: PIN,
) -> AdcChannel<'_, Adc, PIN>
pub fn create_channel<PIN: Channel<Adc, ID = u8>>( &self, pin: PIN, ) -> AdcChannel<'_, Adc, PIN>
Allocate an ADC channel for usage.
§Args
pin
- The ADC input associated with the desired ADC channel. Often, this is a GPIO pin.
§Returns
An instantiated AdcChannel whose ownership can be transferred to other drivers.
Auto Trait Implementations§
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
§impl<T, M> ForwardCompat<T, M> for T
impl<T, M> ForwardCompat<T, M> for T
§impl<T> ReverseCompat<T> for T
impl<T> ReverseCompat<T> for T
§fn reverse(self) -> Reverse<T>
fn reverse(self) -> Reverse<T>
Create an e-h-c wrapper around and e-h object Available methods depend on the wrapped type
§fn reverse_cell(self) -> Reverse<RefCell<T>>
fn reverse_cell(self) -> Reverse<RefCell<T>>
Create an e-h-c reverse compatibility wrapper using a ref-cell for interior mutability (required for InputPin types)