pub struct Touchpad<S: SpiDevice<u8>, M: Mode> { /* private fields */ }Implementations§
Source§impl<S: SpiDevice<u8>, M: Mode> Touchpad<S, M>
impl<S: SpiDevice<u8>, M: Mode> Touchpad<S, M>
pub fn product_id(&mut self) -> Result<u8, S::Error>
pub fn firmware_id(&mut self) -> Result<u8, S::Error>
pub fn firmware_version(&mut self) -> Result<u8, S::Error>
Sourcepub fn status(&mut self) -> Result<Status, S::Error>
pub fn status(&mut self) -> Result<Status, S::Error>
When a touch is detected, Pinnacle loads X and Y position data into the
position registers and asserts the SW_DR flag, which also triggers
the HW_DR signal. While the finger/stylus is present, the position
registers are updated every 10 ms and SW_DR and HW_DR are asserted.
Sourcepub fn calibrate(&mut self, c: &Calibration) -> Result<(), S::Error>
pub fn calibrate(&mut self, c: &Calibration) -> Result<(), S::Error>
Forces Pinnacle to re-calibrate.
If the touchpad is reporting touches when no fingers are on the pad then calibration (compensation) is wrong. Calling this function will fix the problem.
IMPORTANT: after calling this function, wait until Touchpad::calibrated
is true and then Touchpad::enable_feed. Until then, the device will not
produce any data and you should not touch the device.
Sourcepub fn calibrated(&mut self) -> Result<bool, S::Error>
pub fn calibrated(&mut self) -> Result<bool, S::Error>
Check if the touchpad is calibrated.
Sourcepub fn clear_flags(&mut self) -> Result<(), S::Error>
pub fn clear_flags(&mut self) -> Result<(), S::Error>
Clear Command Complete and Software Data Ready flags simultaneously.
Sourcepub fn sample_rate(&mut self) -> Result<u8, S::Error>
pub fn sample_rate(&mut self) -> Result<u8, S::Error>
Number of samples generated per second.
Sourcepub fn set_sample_rate(&mut self, sample_rate: u8) -> Result<(), S::Error>
pub fn set_sample_rate(&mut self, sample_rate: u8) -> Result<(), S::Error>
Set the number of samples generated per second.
Sourcepub fn z_idle(&mut self) -> Result<u8, S::Error>
pub fn z_idle(&mut self) -> Result<u8, S::Error>
During Z-idle (no touch detected) and when in absolute data mode,
Pinnacle will continue to send empty packets (both X and Y data set to 0x00)
every 10 ms. The number of empty packets to be sent can be set using
Touchpad::set_z_idle. The default value is 0x1E (30 decimal).
When set to zero (0), this register prevents any empty packets from being sent,
and the position registers will contain the last sensed location until
a new finger presence is detected.
The Z-Idle count can be a helpful design tool. For example, tap-frequency can be determined by counting the number of Z-idle packets reported between a finger lifting off and touching back down (cutting short the stream of Z-idle packets).
Sourcepub fn set_z_idle(&mut self, z_idle: u8) -> Result<(), S::Error>
pub fn set_z_idle(&mut self, z_idle: u8) -> Result<(), S::Error>
Set the number of empty packets sent during Z-idle.
Sourcepub fn set_z_scaler(&mut self, z_scaler: u8) -> Result<(), S::Error>
pub fn set_z_scaler(&mut self, z_scaler: u8) -> Result<(), S::Error>
Set the pen Z_On threshold.
pub fn sleep_timer(&mut self) -> Result<u8, S::Error>
pub fn set_sleep_timer(&mut self, sleep_timer: u8) -> Result<(), S::Error>
pub fn sleep_interval(&mut self) -> Result<u8, S::Error>
pub fn set_sleep_interval(&mut self, sleep_interval: u8) -> Result<(), S::Error>
pub fn disable_feed(&mut self) -> Result<(), S::Error>
pub fn enable_feed(&mut self) -> Result<(), S::Error>
Sourcepub fn power_mode(&mut self) -> Result<PowerMode, S::Error>
pub fn power_mode(&mut self) -> Result<PowerMode, S::Error>
Get the current power mode.