Control3Reg

Struct Control3Reg 

Source
pub struct Control3Reg(pub u8);

Tuple Fields§

§0: u8

Implementations§

Source§

impl Control3Reg

Source

pub fn ng_thresh(&self) -> u8

This bit is the noise-gate threshold for PWM and analog inputs. 0: Disabled 1: 2% 2: 4% (Default) 3: 8%

Source

pub fn erm_open_loop(&self) -> bool

This bit selects mode of operation while in ERM mode. Closed-loop operation is usually desired for because of automatic overdrive and braking properties. However, many existing waveform libraries were designed for open-loop operation, so open-loop operation may be required for compatibility. 0: Closed Loop 1: Open Loop

Source

pub fn supply_comp_dis(&self) -> bool

This bit disables supply compensation. The DRV2605 device generally provides constant drive output over variation in the power supply input (V DD ). In some systems, supply compensation may have already been implemented upstream, so disabling the DRV2605 supply compensation can be useful. 0: Supply compensation enabled 1: Supply compensation disabled

Source

pub fn data_format_rtp(&self) -> bool

This bit selects the input data interpretation for RTP (Real-Time Playback) mode. 0: Signed 1: Unsigned

Source

pub fn lra_drive_mode(&self) -> bool

This bit selects the drive mode for the LRA algorithm. This bit determines how often the drive amplitude is updated. Updating once per cycle provides a symmetrical output signal, while updating twice per cycle provides more precise control. 0: Once per cycle 1: Twice per cycle

Source

pub fn n_pwm_analog(&self) -> bool

This bit selects the input mode for the IN/TRIG pin when MODE[2:0] = 3. In PWM input mode, the duty cycle of the input signal determines the amplitude of the waveform. In analog input mode, the amplitude of the input determines the amplitude of the waveform. 0: PWM Input 1: Analog Input

Source

pub fn lra_open_loop(&self) -> bool

This bit selects an open-loop drive option for LRA Mode. When asserted, the playback engine drives the LRA at the selected frequency independently of the resonance frequency. In PWM input mode, the playback engine recovers the LRA commutation frequency from the PWM input, dividing the frequency by 128. Therefore the PWM input frequency must be equal to 128 times the resonant frequency of the LRA. 0: Auto-resonance mode 1: LRA open-loop mode

Source

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

This bit is the noise-gate threshold for PWM and analog inputs. 0: Disabled 1: 2% 2: 4% (Default) 3: 8%

Source

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

This bit selects mode of operation while in ERM mode. Closed-loop operation is usually desired for because of automatic overdrive and braking properties. However, many existing waveform libraries were designed for open-loop operation, so open-loop operation may be required for compatibility. 0: Closed Loop 1: Open Loop

Source

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

This bit disables supply compensation. The DRV2605 device generally provides constant drive output over variation in the power supply input (V DD ). In some systems, supply compensation may have already been implemented upstream, so disabling the DRV2605 supply compensation can be useful. 0: Supply compensation enabled 1: Supply compensation disabled

Source

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

This bit selects the input data interpretation for RTP (Real-Time Playback) mode. 0: Signed 1: Unsigned

Source

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

This bit selects the drive mode for the LRA algorithm. This bit determines how often the drive amplitude is updated. Updating once per cycle provides a symmetrical output signal, while updating twice per cycle provides more precise control. 0: Once per cycle 1: Twice per cycle

Source

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

This bit selects the input mode for the IN/TRIG pin when MODE[2:0] = 3. In PWM input mode, the duty cycle of the input signal determines the amplitude of the waveform. In analog input mode, the amplitude of the input determines the amplitude of the waveform. 0: PWM Input 1: Analog Input

Source

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

This bit selects an open-loop drive option for LRA Mode. When asserted, the playback engine drives the LRA at the selected frequency independently of the resonance frequency. In PWM input mode, the playback engine recovers the LRA commutation frequency from the PWM input, dividing the frequency by 128. Therefore the PWM input frequency must be equal to 128 times the resonant frequency of the LRA. 0: Auto-resonance mode 1: LRA open-loop mode

Trait Implementations§

Source§

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

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.