Trait kernel::hil::touch::MultiTouch
source · pub trait MultiTouch<'a> {
// Required methods
fn enable(&self) -> Result<(), ErrorCode>;
fn disable(&self) -> Result<(), ErrorCode>;
fn get_num_touches(&self) -> usize;
fn get_touch(&self, index: usize) -> Option<TouchEvent>;
fn set_client(&self, multi_touch_client: &'a dyn MultiTouchClient);
}
Expand description
Multi-touch panels should implement this
Required Methods§
sourcefn enable(&self) -> Result<(), ErrorCode>
fn enable(&self) -> Result<(), ErrorCode>
Enable the touche panel
returns Ok(()) even if device is already enabled
sourcefn disable(&self) -> Result<(), ErrorCode>
fn disable(&self) -> Result<(), ErrorCode>
Disable the touch panel
returns Ok(()) even if device is already disabled
sourcefn get_num_touches(&self) -> usize
fn get_num_touches(&self) -> usize
Returns the number of maximum concurently supported touches.
sourcefn get_touch(&self, index: usize) -> Option<TouchEvent>
fn get_touch(&self, index: usize) -> Option<TouchEvent>
Returns the touch event at index or None
.
This function must be called in the same interrupt as the event, otherwise data might not be available.
sourcefn set_client(&self, multi_touch_client: &'a dyn MultiTouchClient)
fn set_client(&self, multi_touch_client: &'a dyn MultiTouchClient)
Set the multi-touch client