Struct stabilizer::hardware::shared_adc::SharedAdc
source · 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