pub struct Drv2605<I2C>where
I2C: I2c,{ /* private fields */ }Implementations§
Source§impl<I2C, E> Drv2605<I2C>where
I2C: I2c<Error = E>,
impl<I2C, E> Drv2605<I2C>where
I2C: I2c<Error = E>,
pub async fn init_open_loop_erm(&mut self) -> Result<(), E>
pub async fn get_status(&mut self) -> Result<StatusReg, E>
pub async fn get_mode(&mut self) -> Result<ModeReg, E>
Sourcepub async fn reset(&mut self) -> Result<(), E>
pub async fn reset(&mut self) -> Result<(), E>
performs the equivalent operation of power cycling the device. Any playback operations are immediately interrupted, and all registers are reset to the default values.
Sourcepub async fn set_standby(&mut self, standby: bool) -> Result<(), E>
pub async fn set_standby(&mut self, standby: bool) -> Result<(), E>
Put the device into standby mode, or wake it up from standby
Sourcepub async fn set_realtime_playback_input(&mut self, value: i8) -> Result<(), E>
pub async fn set_realtime_playback_input(&mut self, value: i8) -> Result<(), E>
This field is the entry point for real-time playback (RTP) data. The DRV2605 playback engine drives the RTP_INPUT[7:0] value to the load when MODE[2:0] = 5 (RTP mode). The RTP_INPUT[7:0] value can be updated in real-time by the host controller to create haptic waveforms. The RTP_INPUT[7:0] value is interpreted as signed by default, but can be set to unsigned by the DATA_FORMAT_RTP bit in register 0x1D. When the haptic waveform is complete, the user can idle the device by setting MODE[2:0] = 0, or alternatively by setting STANDBY = 1.
Sourcepub async fn set_high_impedance_state(&mut self, value: bool) -> Result<(), E>
pub async fn set_high_impedance_state(&mut self, value: bool) -> Result<(), E>
This bit sets the output driver into a true high-impedance state. The device must be enabled to go into the high-impedance state. When in hardware shutdown or standby mode, the output drivers have 15 kΩ to ground. When the HI_Z bit is asserted, the hi-Z functionality takes effect immediately, even if a transaction is taking place.
Sourcepub async fn set_library(&mut self, value: LibrarySelection) -> Result<(), E>
pub async fn set_library(&mut self, value: LibrarySelection) -> Result<(), E>
Selects the library the playback engine selects when the GO bit is set.
Sourcepub async fn set_waveform(
&mut self,
waveform: &[WaveformReg; 8],
) -> Result<(), E>
pub async fn set_waveform( &mut self, waveform: &[WaveformReg; 8], ) -> Result<(), E>
Sets the waveform generation registers to the shape provided
pub async fn set_single_effect(&mut self, effect: Effect) -> Result<(), E>
Sourcepub async fn set_go(&mut self, go: bool) -> Result<(), E>
pub async fn set_go(&mut self, go: bool) -> Result<(), E>
This bit is used to fire processes in the DRV2605 device. The process fired by the GO bit is selected by the MODE[2:0] bit (register 0x01). The primary function of this bit is to fire playback of the waveform identifiers in the waveform sequencer (registers 0x04 to 0x0B), in which case, this bit can be thought of a software trigger for haptic waveforms. The GO bit remains high until the playback of the haptic waveform sequence is complete. Clearing the GO bit during waveform playback cancels the waveform sequence. Using one of the external trigger modes can cause the GO bit to be set or cleared by the external trigger pin. This bit can also be used to fire the auto-calibration process or the diagnostic process.
Sourcepub async fn set_overdrive_time_offset(&mut self, value: i8) -> Result<(), E>
pub async fn set_overdrive_time_offset(&mut self, value: i8) -> Result<(), E>
This bit adds a time offset to the overdrive portion of the library waveforms. Some motors require more overdrive time than others, so this register allows the user to add or remove overdrive time from the library waveforms. The maximum voltage value in the library waveform is automatically determined to be the overdrive portion. This register is only useful in open-loop mode. Overdrive is automatic for closed-loop mode. The offset is interpreted as 2s complement, so the time offset may be positive or negative. Overdrive Time Offset (ms) = ODT[7:0] × PLAYBACK_INTERVAL See the section for PLAYBACK_INTERVAL details.
Sourcepub async fn set_sustain_time_offset_positive(
&mut self,
value: i8,
) -> Result<(), E>
pub async fn set_sustain_time_offset_positive( &mut self, value: i8, ) -> Result<(), E>
This bit adds a time offset to the positive sustain portion of the library waveforms. Some motors have a faster or slower response time than others, so this register allows the user to add or remove positive sustain time from the library waveforms. Any positive voltage value other than the overdrive portion is considered as a sustain positive value. The offset is interpreted as 2s complement, so the time offset can positive or negative. Sustain-Time Positive Offset (ms) = SPT[7:0] × PLAYBACK_INTERVAL See the section for PLAYBACK_INTERVAL details.
Sourcepub async fn set_sustain_time_offset_negative(
&mut self,
value: i8,
) -> Result<(), E>
pub async fn set_sustain_time_offset_negative( &mut self, value: i8, ) -> Result<(), E>
This bit adds a time offset to the negative sustain portion of the library waveforms. Some motors have a faster or slower response time than others, so this register allows the user to add or remove negative sustain time from the library waveforms. Any negative voltage value other than the overdrive portion is considered as a sustaining negative value. The offset is interpreted as two’s complement, so the time offset can be positive or negative. Sustain-Time Negative Offset (ms) = SNT[7:0] × PLAYBACK_INTERVAL See the section for PLAYBACK_INTERVAL details.
Sourcepub async fn set_brake_time_offset(&mut self, value: i8) -> Result<(), E>
pub async fn set_brake_time_offset(&mut self, value: i8) -> Result<(), E>
This bit adds a time offset to the braking portion of the library waveforms. Some motors require more braking time than others, so this register allows the user to add or take away brake time from the library waveforms. The most negative voltage value in the library waveform is automatically determined to be the braking portion. This register is only useful in open-loop mode. Braking is automatic for closed-loop mode. The offset is interpreted as 2s complement, so the time offset can be positive or negative. Brake Time Offset (ms) = BRT[7:0] × PLAYBACK_INTERVAL See the section for PLAYBACK_INTERVAL details.