modm API documentation
modm::touch2046< SpiMaster, Cs >::Calibration Struct Reference

#include <modm/driver/touch/touch2046.hpp>

Public Attributes

int16_t OffsetX = 0
 
int16_t OffsetY = 0
 
int32_t FactorX = 1'000'000
 
int32_t FactorY = 1'000'000
 
uint16_t MaxX = 240
 
uint16_t MaxY = 320
 
uint16_t ThresholdZ = 1500
 
Orientation orientation = Orientation::Normal
 

Detailed Description

template<class SpiMaster, class Cs>
struct modm::touch2046< SpiMaster, Cs >::Calibration

Calibration values are used to calculate touch point from raw values.

FactorX and FactorY scaled by 1000000 to avoid float arithmetic. E.g. to get a factor of 0.75 FactorX has to be set to 750'000.

isTouched() = bool(Z > ThresholdZ)

X = (rawX * FactorX / 1000000) + OffsetX limited to [0, MaxX] Y = (rawY * FactorY / 1000000) + OffsetY limited to [0, MaxY]

Orientation (rotation, mirror) are applied after the above operations.


The documentation for this struct was generated from the following file: