Struct Control2Reg

Source
pub struct Control2Reg(pub u8);

Tuple Fields§

§0: u8

Implementations§

Source§

impl Control2Reg

Source

pub fn bidir_input(&self) -> bool

The BIDIR_INPUT bit selects how the engine interprets data. 0: Unidirectional input mode Braking is automatically determined by the feedback conditions and is applied when needed. Use of this mode also recovers an additional bit of vertical resolution. This mode should only be used for closed-loop operation. Examples:: 0% Input -> No output signal 50% Input -> Half-scale output signal 100% Input -> Full-scale output signal 1: Bidirectional input mode (default) This mode is compatible with traditional open-loop signaling and also works well with closed-loop mode. When operating closed-loop, braking is automatically determined by the feedback conditions and applied when needed. When operating open-loop modes, braking is only applied when the input signal is less than 50%. Open-loop mode (ERM and LRA) examples: 0% Input -> Negative full-scale output signal (braking) 25% Input -> Negative half-scale output signal (braking) 50% Input -> No output signal 75% Input -> Positive half-scale output signal 100% Input -> Positive full-scale output signal Closed-loop mode (ERM and LRA) examples: 0% to 50% Input -> No output signal 50% Input -> No output signal 75% Input -> Half-scale output signal 100% Input -> Full-scale output signal

Source

pub fn brake_stabilizer(&self) -> bool

When this bit is set, loop gain is reduced when braking is almost complete to improve loop stability

Source

pub fn sample_time(&self) -> u8

LRA auto-resonance sampling time (Advanced use only) 0: 150 us 1: 200 us 2: 250 us 3: 300 us

Source

pub fn blanking_time(&self) -> u8

Blanking time before the back-EMF AD makes a conversion. (Advanced use only)

Source

pub fn idiss_time(&self) -> u8

Current dissipation time. This bit is the time allowed for the current to dissipate from the actuator between PWM cycles for flyback mitigation. (Advanced use only)

Source

pub fn set_bidir_input(&mut self, value: bool)

The BIDIR_INPUT bit selects how the engine interprets data. 0: Unidirectional input mode Braking is automatically determined by the feedback conditions and is applied when needed. Use of this mode also recovers an additional bit of vertical resolution. This mode should only be used for closed-loop operation. Examples:: 0% Input -> No output signal 50% Input -> Half-scale output signal 100% Input -> Full-scale output signal 1: Bidirectional input mode (default) This mode is compatible with traditional open-loop signaling and also works well with closed-loop mode. When operating closed-loop, braking is automatically determined by the feedback conditions and applied when needed. When operating open-loop modes, braking is only applied when the input signal is less than 50%. Open-loop mode (ERM and LRA) examples: 0% Input -> Negative full-scale output signal (braking) 25% Input -> Negative half-scale output signal (braking) 50% Input -> No output signal 75% Input -> Positive half-scale output signal 100% Input -> Positive full-scale output signal Closed-loop mode (ERM and LRA) examples: 0% to 50% Input -> No output signal 50% Input -> No output signal 75% Input -> Half-scale output signal 100% Input -> Full-scale output signal

Source

pub fn set_brake_stabilizer(&mut self, value: bool)

When this bit is set, loop gain is reduced when braking is almost complete to improve loop stability

Source

pub fn set_sample_time(&mut self, value: u8)

LRA auto-resonance sampling time (Advanced use only) 0: 150 us 1: 200 us 2: 250 us 3: 300 us

Source

pub fn set_blanking_time(&mut self, value: u8)

Blanking time before the back-EMF AD makes a conversion. (Advanced use only)

Source

pub fn set_idiss_time(&mut self, value: u8)

Current dissipation time. This bit is the time allowed for the current to dissipate from the actuator between PWM cycles for flyback mitigation. (Advanced use only)

Trait Implementations§

Source§

impl<T> BitRange<T> for Control2Reg
where u8: BitRange<T>,

Source§

fn bit_range(&self, msb: usize, lsb: usize) -> T

Get a range of bits.
Source§

impl<T> BitRangeMut<T> for Control2Reg
where u8: BitRangeMut<T>,

Source§

fn set_bit_range(&mut self, msb: usize, lsb: usize, value: T)

Set a range of bits.
Source§

impl Debug for Control2Reg

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> Bit for T
where T: BitRange<u8>,

Source§

fn bit(&self, bit: usize) -> bool

Get a single bit.
Source§

impl<T> BitMut for T
where T: BitRangeMut<u8>,

Source§

fn set_bit(&mut self, bit: usize, value: bool)

Set a single bit.
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.