TouchReport

Struct TouchReport 

Source
pub struct TouchReport {
    pub data_len: u16,
    pub report_id: u8,
    pub time_stamp: u16,
    pub large_object: u8,
    pub record_num: u8,
    pub report_counter: u8,
    pub noise_effect: u8,
    /* private fields */
}
Expand description

Prelude data for one or more touch events

Fields§

§data_len: u16

Total length of the data; should be 7, 17, or 27

§report_id: u8

ID of the report

§time_stamp: u16

Timestamp

§large_object: u8§record_num: u8§report_counter: u8§noise_effect: u8

Implementations§

Source§

impl TouchReport

Source

pub fn read_data_len(input_byte_buffer: &[u8; 7]) -> u16

Reads bits 0 through 15 within output_byte_buffer, getting the data_len field of a TouchReport in bitfield form.

Source

pub fn read_report_id(input_byte_buffer: &[u8; 7]) -> u8

Reads bits 16 through 23 within output_byte_buffer, getting the report_id field of a TouchReport in bitfield form.

Source

pub fn read_time_stamp(input_byte_buffer: &[u8; 7]) -> u16

Reads bits 24 through 39 within output_byte_buffer, getting the time_stamp field of a TouchReport in bitfield form.

Source

pub fn read_padding0(input_byte_buffer: &[u8; 7]) -> u8

Reads bits 40 through 41 within output_byte_buffer, getting the padding0 field of a TouchReport in bitfield form.

Source

pub fn read_large_object(input_byte_buffer: &[u8; 7]) -> u8

Reads bits 42 through 42 within output_byte_buffer, getting the large_object field of a TouchReport in bitfield form.

Source

pub fn read_record_num(input_byte_buffer: &[u8; 7]) -> u8

Reads bits 43 through 47 within output_byte_buffer, getting the record_num field of a TouchReport in bitfield form.

Source

pub fn read_report_counter(input_byte_buffer: &[u8; 7]) -> u8

Reads bits 48 through 49 within output_byte_buffer, getting the report_counter field of a TouchReport in bitfield form.

Source

pub fn read_padding1(input_byte_buffer: &[u8; 7]) -> u8

Reads bits 50 through 52 within output_byte_buffer, getting the padding1 field of a TouchReport in bitfield form.

Source

pub fn read_noise_effect(input_byte_buffer: &[u8; 7]) -> u8

Reads bits 53 through 55 within output_byte_buffer, getting the noise_effect field of a TouchReport in bitfield form.

Source

pub fn write_data_len(output_byte_buffer: &mut [u8; 7], data_len: u16)

Writes to bits 0 through 15 within output_byte_buffer, setting the data_len field of a TouchReport in bitfield form.

Source

pub fn write_report_id(output_byte_buffer: &mut [u8; 7], report_id: u8)

Writes to bits 16 through 23 within output_byte_buffer, setting the report_id field of a TouchReport in bitfield form.

Source

pub fn write_time_stamp(output_byte_buffer: &mut [u8; 7], time_stamp: u16)

Writes to bits 24 through 39 within output_byte_buffer, setting the time_stamp field of a TouchReport in bitfield form.

Source

pub fn write_padding0(output_byte_buffer: &mut [u8; 7], padding0: u8)

Writes to bits 40 through 41 within output_byte_buffer, setting the padding0 field of a TouchReport in bitfield form.

Source

pub fn write_large_object(output_byte_buffer: &mut [u8; 7], large_object: u8)

Writes to bits 42 through 42 within output_byte_buffer, setting the large_object field of a TouchReport in bitfield form.

Source

pub fn write_record_num(output_byte_buffer: &mut [u8; 7], record_num: u8)

Writes to bits 43 through 47 within output_byte_buffer, setting the record_num field of a TouchReport in bitfield form.

Source

pub fn write_report_counter( output_byte_buffer: &mut [u8; 7], report_counter: u8, )

Writes to bits 48 through 49 within output_byte_buffer, setting the report_counter field of a TouchReport in bitfield form.

Source

pub fn write_padding1(output_byte_buffer: &mut [u8; 7], padding1: u8)

Writes to bits 50 through 52 within output_byte_buffer, setting the padding1 field of a TouchReport in bitfield form.

Source

pub fn write_noise_effect(output_byte_buffer: &mut [u8; 7], noise_effect: u8)

Writes to bits 53 through 55 within output_byte_buffer, setting the noise_effect field of a TouchReport in bitfield form.

Trait Implementations§

Source§

impl Bitfields<7> for TouchReport

Source§

const BIT_SIZE: usize = 56usize

Total amount of Bits the Bitfields within this structure take to contain in a fixed size array.
Source§

fn into_bytes(self) -> [u8; 7]

Inserts the values of the Bitfields in this structure into a fixed size array, consuming the structure. Read more
Source§

fn from_bytes(input_byte_buffer: [u8; 7]) -> Self

Extracts the values of the Bitfields in this structure from a fixed size array while consuming it. Read more
Source§

const BYTE_SIZE: usize = SIZE

Total amount of Bytes the Bitfields within this structure take to contain in a fixed size array.
Source§

impl Clone for TouchReport

Source§

fn clone(&self) -> TouchReport

Returns a duplicate 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 TouchReport

Source§

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

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

impl PartialEq for TouchReport

Source§

fn eq(&self, other: &TouchReport) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for TouchReport

Source§

impl Eq for TouchReport

Source§

impl StructuralPartialEq for TouchReport

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> 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.