Enum Mode

Source
pub enum Mode {
    InternalTrigger = 0,
    ExternalTriggerRisingEdge = 1,
    ExternalTriggerLevelMode = 2,
    PwmInputAndAnalogInput = 3,
    AudioToVibe = 4,
    RealTimePlayback = 5,
    Diagnostics = 6,
    AutoCalibration = 7,
}

Variants§

§

InternalTrigger = 0

Waveforms are fired by setting the GO bit in register 0x0C.

§

ExternalTriggerRisingEdge = 1

A rising edge on the IN/TRIG pin sets the GO Bit. A second rising edge on the IN/TRIG pin cancels the waveform if the second rising edge occurs before the GO bit has cleared.

§

ExternalTriggerLevelMode = 2

The GO bit follows the state of the external trigger. A rising edge on the IN/TRIG pin sets the GO bit, and a falling edge sends a cancel. If the GO bit is already in the appropriate state, no change occurs.

§

PwmInputAndAnalogInput = 3

A PWM or analog signal is accepted at the IN/TRIG pin and used as the driving source. The device actively drives the actuator while in this mode. The PWM or analog input selection occurs by using the N_PWM_ANALOG bit.

§

AudioToVibe = 4

An AC-coupled audio signal is accepted at the IN/TRIG pin. The device converts the audio signal into meaningful haptic vibration. The AC_COUPLE and N_PWM_ANALOG bits should also be set.

§

RealTimePlayback = 5

The device actively drives the actuator with the contents of the RTP_INPUT[7:0] bit in register 0x02.

§

Diagnostics = 6

Set the device in this mode to perform a diagnostic test on the actuator. The user must set the GO bit to start the test. The test is complete when the GO bit self-clears. Results are stored in the DIAG_RESULT bit in register 0x00.

§

AutoCalibration = 7

Set the device in this mode to auto calibrate the device for the actuator. Before starting the calibration, the user must set the all required input parameters. The user must set the GO bit to start the calibration. Calibration is complete when the GO bit self-clears.

Trait Implementations§

Source§

impl Clone for Mode

Source§

fn clone(&self) -> Mode

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Mode

Source§

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

Formats the value using the given formatter. Read more
Source§

impl From<u8> for Mode

Source§

fn from(val: u8) -> Mode

Converts to this type from the input type.
Source§

impl Copy for Mode

Auto Trait Implementations§

§

impl Freeze for Mode

§

impl RefUnwindSafe for Mode

§

impl Send for Mode

§

impl Sync for Mode

§

impl Unpin for Mode

§

impl UnwindSafe for Mode

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.