Struct FeedbackControlReg

Source
pub struct FeedbackControlReg(pub u8);

Tuple Fields§

§0: u8

Implementations§

Source§

impl FeedbackControlReg

Source

pub fn n_erm_lra(&self) -> bool

This bit sets the DRV2605 device in ERM or LRA mode. This bit should be set prior to running auto calibration. 0: ERM Mode 1: LRA Mode

Source

pub fn fb_brake_factor(&self) -> u8

This bit selects the feedback gain ratio between braking gain and driving gain. In general, adding additional feedback gain while braking is desirable so that the actuator brakes as quickly as possible. Large ratios provide less-stable operation than lower ones. The advanced user can select to optimize this register. Otherwise, the default value should provide good performance for most actuators. This value should be set prior to running auto calibration. 0: 1x 1: 2x 2: 3x 3: 4x 4: 6x 5: 8x 6: 16x 7: Braking disabled

Source

pub fn loop_gain(&self) -> u8

This bit selects a loop gain for the feedback control. The LOOP_GAIN[1:0] bit sets how fast the loop attempts to make the back-EMF (and thus motor velocity) match the input signal level. Higher loop-gain (faster settling) options provide less-stable operation than lower loop gain (slower settling). The advanced user can select to optimize this register. Otherwise, the default value should provide good performance for most actuators. This value should be set prior to running auto calibration. 0: Low 1: Medium (default) 2: High 3: Very High

Source

pub fn bemf_gain(&self) -> u8

This bit sets the analog gain of the back-EMF amplifier. This value is interpreted differently between ERM mode and LRA mode. Auto calibration automatically populates the BEMF_GAIN bit with the most appropriate value for the actuator. ERM Mode 0: 0.33x 1: 1.0x 2: 1.8x (default) 3: 4.0x LRA Mode 0: 5x 1: 10x 2: 20x (default) 3: 30x

Source

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

This bit sets the DRV2605 device in ERM or LRA mode. This bit should be set prior to running auto calibration. 0: ERM Mode 1: LRA Mode

Source

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

This bit selects the feedback gain ratio between braking gain and driving gain. In general, adding additional feedback gain while braking is desirable so that the actuator brakes as quickly as possible. Large ratios provide less-stable operation than lower ones. The advanced user can select to optimize this register. Otherwise, the default value should provide good performance for most actuators. This value should be set prior to running auto calibration. 0: 1x 1: 2x 2: 3x 3: 4x 4: 6x 5: 8x 6: 16x 7: Braking disabled

Source

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

This bit selects a loop gain for the feedback control. The LOOP_GAIN[1:0] bit sets how fast the loop attempts to make the back-EMF (and thus motor velocity) match the input signal level. Higher loop-gain (faster settling) options provide less-stable operation than lower loop gain (slower settling). The advanced user can select to optimize this register. Otherwise, the default value should provide good performance for most actuators. This value should be set prior to running auto calibration. 0: Low 1: Medium (default) 2: High 3: Very High

Source

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

This bit sets the analog gain of the back-EMF amplifier. This value is interpreted differently between ERM mode and LRA mode. Auto calibration automatically populates the BEMF_GAIN bit with the most appropriate value for the actuator. ERM Mode 0: 0.33x 1: 1.0x 2: 1.8x (default) 3: 4.0x LRA Mode 0: 5x 1: 10x 2: 20x (default) 3: 30x

Trait Implementations§

Source§

impl<T> BitRange<T> for FeedbackControlReg
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 FeedbackControlReg
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 FeedbackControlReg

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.