Struct kiibohd_hall_effect::SenseAnalysis
source · pub struct SenseAnalysis {
pub state: KeyState,
pub distance: i16,
pub velocity: i16,
pub acceleration: i16,
pub jerk: i16,
}
Expand description
Calculations: d = linearized(adc sample) –> distance v = (d - d_prev) / 1 –> velocity a = (v - v_prev) / 2 –> acceleration j = (a - a_prev) / 3 –> jerk
These calculations assume constant time delta of 1
Fields§
§state: KeyState
Threshold state
distance: i16
Distance value (lookup + min/max alignment)
velocity: i16
Velocity calculation (*)
acceleration: i16
Acceleration calculation (*)
jerk: i16
Jerk calculation (*)
Implementations§
source§impl SenseAnalysis
impl SenseAnalysis
Trait Implementations§
source§impl Clone for SenseAnalysis
impl Clone for SenseAnalysis
source§fn clone(&self) -> SenseAnalysis
fn clone(&self) -> SenseAnalysis
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl RefUnwindSafe for SenseAnalysis
impl Send for SenseAnalysis
impl Sync for SenseAnalysis
impl Unpin for SenseAnalysis
impl UnwindSafe for SenseAnalysis
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more