Skip to main content

InlineCurrentSensor

Struct InlineCurrentSensor 

Source
pub struct InlineCurrentSensor<ADC, UP, VP, WP> {
Show 16 fields pub adc_handle: ADC, pub adc_u_pin: Option<UP>, pub adc_v_pin: Option<VP>, pub adc_w_pin: Option<WP>, pub iu: f32, pub iv: f32, pub iw: f32, pub id: f32, pub iq: f32, pub offset_adc_u: f32, pub offset_adc_v: f32, pub offset_adc_w: f32, pub gain_u: f32, pub gain_v: f32, pub gain_w: f32, pub adc_conversion_factor: f32,
}

Fields§

§adc_handle: ADC§adc_u_pin: Option<UP>§adc_v_pin: Option<VP>§adc_w_pin: Option<WP>§iu: f32§iv: f32§iw: f32§id: f32§iq: f32§offset_adc_u: f32§offset_adc_v: f32§offset_adc_w: f32§gain_u: f32§gain_v: f32§gain_w: f32§adc_conversion_factor: f32

Trait Implementations§

Source§

impl<ADC, UP, VP, WP> CurrentSensorTrait for InlineCurrentSensor<ADC, UP, VP, WP>
where UP: Channel<ADC>, VP: Channel<ADC>, WP: Channel<ADC>, ADC: OneShot<ADC, u32, UP> + OneShot<ADC, u32, VP> + OneShot<ADC, u32, WP>,

Source§

fn init<D>(&mut self, delay: &mut D) -> Result<(), ToyError>
where D: DelayUs<u32>,

Source§

fn read_adc( &mut self, ) -> Result<(Option<u32>, Option<u32>, Option<u32>), ToyError>

Source§

fn read_current(&mut self, angle_el: f32) -> Result<(f32, f32), ToyError>

Source§

fn cal_iq_id(&mut self, angle_el: f32)

Source§

fn get_phase_current(&mut self) -> PhaseCurrent

Source§

fn get_current(&mut self) -> (f32, f32)

Source§

fn get_offset(&mut self) -> (f32, f32, f32)

Source§

impl<ADC: Debug, UP: Debug, VP: Debug, WP: Debug> Debug for InlineCurrentSensor<ADC, UP, VP, WP>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<ADC, UP, VP, WP> Freeze for InlineCurrentSensor<ADC, UP, VP, WP>
where ADC: Freeze, UP: Freeze, VP: Freeze, WP: Freeze,

§

impl<ADC, UP, VP, WP> RefUnwindSafe for InlineCurrentSensor<ADC, UP, VP, WP>

§

impl<ADC, UP, VP, WP> Send for InlineCurrentSensor<ADC, UP, VP, WP>
where ADC: Send, UP: Send, VP: Send, WP: Send,

§

impl<ADC, UP, VP, WP> Sync for InlineCurrentSensor<ADC, UP, VP, WP>
where ADC: Sync, UP: Sync, VP: Sync, WP: Sync,

§

impl<ADC, UP, VP, WP> Unpin for InlineCurrentSensor<ADC, UP, VP, WP>
where ADC: Unpin, UP: Unpin, VP: Unpin, WP: Unpin,

§

impl<ADC, UP, VP, WP> UnsafeUnpin for InlineCurrentSensor<ADC, UP, VP, WP>
where ADC: UnsafeUnpin, UP: UnsafeUnpin, VP: UnsafeUnpin, WP: UnsafeUnpin,

§

impl<ADC, UP, VP, WP> UnwindSafe for InlineCurrentSensor<ADC, UP, VP, WP>
where ADC: UnwindSafe, UP: UnwindSafe, VP: UnwindSafe, WP: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.