I2C_Drivers (ARM) 1.1
SMFSW collection of HAL I2C Drivers for ARM
Loading...
Searching...
No Matches
MTCH6102_ex.h File Reference

MTCH6102 Driver extensions. More...

#include "sarmfsw.h"
#include "MTCH6102.h"
Include dependency graph for MTCH6102_ex.h:
This graph shows which files directly or indirectly include this file:

Data Structures

struct  MTCH6102_raw_sense
 

Macros

#define MTCH_RES_STEP   64U
 MTCH6102 Resolution of a single RX/TX.
 
#define perVal2perReg(ms)
 Compute reg value for period ms.
 
#define perReg2perVal(rv)
 Get period in ms from register rv.
 
#define per10ms   0x0142U
 example period register value for 10ms
 
#define per20ms   0x0284U
 example period register value for 20ms
 
#define per50ms   0x064CU
 example period register value for 50ms
 
#define per100ms   0x0C99U
 example period register value for 100ms
 

Enumerations

enum  MTCH6102_COMMAND {
  MTCH_StoreToNV = 0U , MTCH_RestoreDefaults , MTCH_Configure , MTCH_ManufacturingTest ,
  MTCH_ForceBaseline
}
 

Functions

FctERR MTCH6102_Set_Mode (const MTCH6102_t *const pCpnt, const MTCH6102_MODE mode)
 Set MTCH6102 gesture decoding.
 
FctERR MTCH6102_Get_Mode (const MTCH6102_t *const pCpnt, MTCH6102_MODE *const mode)
 Get MTCH6102 gesture decoding.
 
FctERR MTCH6102_Command (const MTCH6102_t *const pCpnt, const MTCH6102_COMMAND cmd)
 Execute MTCH6102 command.
 
FctERR MTCH6102_Restore_Defaults (const MTCH6102_t *const pCpnt)
 Restore MTCH6102 controller to default configuration values.
 
FctERR MTCH6102_Store_To_Non_Volatile (const MTCH6102_t *const pCpnt)
 Write MTCH6102 parameters to non volatile storage.
 
FctERR MTCH6102_Configuration_Request (const MTCH6102_t *const pCpnt)
 Configure MTCH6102controller (after parameters have been changed)
 
FctERR MTCH6102_Manufacturing_Test (const MTCH6102_t *const pCpnt)
 Execute MTCH6102 manufacturing test.
 
FctERR MTCH6102_Force_Baseline (const MTCH6102_t *const pCpnt)
 Force MTCH6102 baseline (re-calibration) to occur.
 
FctERR MTCH6102_Set_Active_Period (const MTCH6102_t *const pCpnt, const uint16_t period)
 Set MTCH6102 active period.
 
FctERR MTCH6102_Set_Idle_Period (const MTCH6102_t *const pCpnt, const uint16_t period)
 Set MTCH6102 idle period.
 
FctERR MTCH6102_Set_Idle_Timeout (const MTCH6102_t *const pCpnt, const uint8_t timeout)
 Set MTCH6102 idle timeout.
 
FctERR MTCH6102_Set_Debounce (const MTCH6102_t *const pCpnt, const uint8_t touch, const uint8_t release)
 Set MTCH6102 debounce period.
 
FctERR MTCH6102_Get_Active_Period (const MTCH6102_t *const pCpnt, uint16_t *const period)
 Get MTCH6102 Active period.
 
FctERR MTCH6102_Get_Idle_Period (const MTCH6102_t *const pCpnt, uint16_t *const period)
 Get MTCH6102 Idle period.
 
FctERR MTCH6102_Set_Filter (const MTCH6102_t *const pCpnt, const MTCH6102_FILTER_TYPE type, const uint8_t strength, const bool baseline_filter)
 Set MTCH6102 raw acquisition filter.
 
FctERR MTCH6102_Set_Scan_Count (const MTCH6102_t *const pCpnt, const uint8_t count)
 Set MTCH6102 scan count.
 
FctERR MTCH6102_Set_Touch_Threshold (const MTCH6102_t *const pCpnt, const uint8_t xthr, const uint8_t ythr)
 Set MTCH6102 touch threshold.
 
FctERR MTCH6102_Set_Hysteresis (const MTCH6102_t *const pCpnt, const uint8_t hyst)
 Set MTCH6102 touch to release hysteresis.
 
FctERR MTCH6102_Set_Large_Activation_Threshold (const MTCH6102_t *const pCpnt, const uint16_t thr)
 Set MTCH6102 large activation threshold.
 
FctERR MTCH6102_Set_Base_Interval (const MTCH6102_t *const pCpnt, const uint16_t interval)
 Set MTCH6102 base interval.
 
FctERR MTCH6102_Set_Base_Filter (const MTCH6102_t *const pCpnt, const uint8_t pos, const uint8_t neg)
 Set MTCH6102 baseline filter thresholds.
 
FctERR MTCH6102_Get_Raw (const MTCH6102_t *const pCpnt, MTCH6102_raw_sense *const raw)
 Get MTCH6102 Raw sensor values data.
 
FctERR MTCH6102_Get_Gest (const MTCH6102_t *const pCpnt, MTCH6102_raw_gest *const gest)
 Get MTCH6102 gesture data.
 
void MTCH6102_INT_GPIO_Init (MTCH6102_t *const pCpnt, GPIO_TypeDef *const GPIOx, const uint16_t GPIO_Pin, const GPIO_PinState GPIO_Active)
 Interrupt GPIO pin init for MTCH6102.
 
bool MTCH6102_INT_GPIO_Get (const MTCH6102_t *const pCpnt)
 Interrupt GPIO pin getter for MTCH6102.
 
void MTCH6102_SYNC_GPIO_Init (MTCH6102_t *const pCpnt, GPIO_TypeDef *const GPIOx, const uint16_t GPIO_Pin, const GPIO_PinState GPIO_Active)
 Synchro GPIO pin init for MTCH6102.
 
bool MTCH6102_SYNC_GPIO_Get (const MTCH6102_t *const pCpnt)
 Synchro GPIO pin getter for MTCH6102.
 

Detailed Description

MTCH6102 Driver extensions.

Author
SMFSW

MTCH6102: Low-Power Projected Capacitive Touch Controller

Macro Definition Documentation

◆ MTCH_RES_STEP

#define MTCH_RES_STEP   64U

MTCH6102 Resolution of a single RX/TX.

◆ per100ms

#define per100ms   0x0C99U

example period register value for 100ms

◆ per10ms

#define per10ms   0x0142U

example period register value for 10ms

◆ per20ms

#define per20ms   0x0284U

example period register value for 20ms

◆ per50ms

#define per50ms   0x064CU

example period register value for 50ms

◆ perReg2perVal

#define perReg2perVal ( rv)
Value:
(uint16_t) ((((rv) - 1U) * 31U) / 1000U)

Get period in ms from register rv.

◆ perVal2perReg

#define perVal2perReg ( ms)
Value:
(uint16_t) ((((ms) * 1000U) / 31U) + 1U)

Compute reg value for period ms.

Enumeration Type Documentation

◆ MTCH6102_COMMAND

Enumerator
MTCH_StoreToNV 

Write to non volatile storage.

MTCH_RestoreDefaults 

Restore controller to default configuration values.

MTCH_Configure 

Configure controller (after parameters have been changed)

MTCH_ManufacturingTest 

Execute manufacturing test.

MTCH_ForceBaseline 

Force baseline (re-calibration) to occur.

Function Documentation

◆ MTCH6102_Command()

FctERR MTCH6102_Command ( const MTCH6102_t *const pCpnt,
const MTCH6102_COMMAND cmd )

Execute MTCH6102 command.

Parameters
[in]pCpnt- Pointer to MTCH6102 component
[in]cmd- Command to execute
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MTCH6102_Configuration_Request()

FctERR MTCH6102_Configuration_Request ( const MTCH6102_t *const pCpnt)
inline

Configure MTCH6102controller (after parameters have been changed)

Parameters
[in]pCpnt- Pointer to MTCH6102 component
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MTCH6102_Force_Baseline()

FctERR MTCH6102_Force_Baseline ( const MTCH6102_t *const pCpnt)
inline

Force MTCH6102 baseline (re-calibration) to occur.

Parameters
[in]pCpnt- Pointer to MTCH6102 component
Returns
FctERR - error code
Here is the call graph for this function:

◆ MTCH6102_Get_Active_Period()

FctERR MTCH6102_Get_Active_Period ( const MTCH6102_t *const pCpnt,
uint16_t *const period )

Get MTCH6102 Active period.

Parameters
[in]pCpnt- Pointer to MTCH6102 component
[in]period- Pointer to active period result
Returns
FctERR - error code
Here is the call graph for this function:

◆ MTCH6102_Get_Gest()

FctERR MTCH6102_Get_Gest ( const MTCH6102_t *const pCpnt,
MTCH6102_raw_gest *const gest )
inline

Get MTCH6102 gesture data.

Parameters
[in]pCpnt- Pointer to MTCH6102 component
[in]gest- Pointer to gesture data result
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MTCH6102_Get_Idle_Period()

FctERR MTCH6102_Get_Idle_Period ( const MTCH6102_t *const pCpnt,
uint16_t *const period )

Get MTCH6102 Idle period.

Parameters
[in]pCpnt- Pointer to MTCH6102 component
[in]period- Pointer to idle period result
Returns
FctERR - error code
Here is the call graph for this function:

◆ MTCH6102_Get_Mode()

FctERR MTCH6102_Get_Mode ( const MTCH6102_t *const pCpnt,
MTCH6102_MODE *const mode )
inline

Get MTCH6102 gesture decoding.

Parameters
[in]pCpnt- Pointer to MTCH6102 component
[in,out]mode- Gesture decoding mode
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MTCH6102_Get_Raw()

FctERR MTCH6102_Get_Raw ( const MTCH6102_t *const pCpnt,
MTCH6102_raw_sense *const raw )
inline

Get MTCH6102 Raw sensor values data.

Parameters
[in]pCpnt- Pointer to MTCH6102 component
[in]raw- Pointer to raw data result
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MTCH6102_INT_GPIO_Get()

bool MTCH6102_INT_GPIO_Get ( const MTCH6102_t *const pCpnt)

Interrupt GPIO pin getter for MTCH6102.

Weak Functions
MTCH6102 Interrupt GPIO pin getter may be user implemented if needed
Parameters
[in]pCpnt- Pointer to MTCH6102 component
Returns
INT pin state value (0: inactive, 1: active)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MTCH6102_INT_GPIO_Init()

void MTCH6102_INT_GPIO_Init ( MTCH6102_t *const pCpnt,
GPIO_TypeDef *const GPIOx,
const uint16_t GPIO_Pin,
const GPIO_PinState GPIO_Active )

Interrupt GPIO pin init for MTCH6102.

Weak Functions
MTCH6102 Interrupt GPIO pin init may be user implemented if needed
Parameters
[in]pCpnt- Pointer to MTCH6102 component
[in]GPIOx- INT port
[in]GPIO_Pin- INT pin
[in]GPIO_ActiveINT pin active state
Here is the call graph for this function:

◆ MTCH6102_Manufacturing_Test()

FctERR MTCH6102_Manufacturing_Test ( const MTCH6102_t *const pCpnt)
inline

Execute MTCH6102 manufacturing test.

Parameters
[in]pCpnt- Pointer to MTCH6102 component
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MTCH6102_Restore_Defaults()

FctERR MTCH6102_Restore_Defaults ( const MTCH6102_t *const pCpnt)
inline

Restore MTCH6102 controller to default configuration values.

Parameters
[in]pCpnt- Pointer to MTCH6102 component
Returns
FctERR - error code
Here is the call graph for this function:

◆ MTCH6102_Set_Active_Period()

FctERR MTCH6102_Set_Active_Period ( const MTCH6102_t *const pCpnt,
const uint16_t period )

Set MTCH6102 active period.

Parameters
[in]pCpnt- Pointer to MTCH6102 component
[in]period- Active period
Returns
FctERR - error code
Here is the call graph for this function:

◆ MTCH6102_Set_Base_Filter()

FctERR MTCH6102_Set_Base_Filter ( const MTCH6102_t *const pCpnt,
const uint8_t pos,
const uint8_t neg )
inline

Set MTCH6102 baseline filter thresholds.

Parameters
[in]pCpnt- Pointer to MTCH6102 component
[in]pos- Positive filter value
[in]neg- Negative filter value
Returns
FctERR - error code
Here is the call graph for this function:

◆ MTCH6102_Set_Base_Interval()

FctERR MTCH6102_Set_Base_Interval ( const MTCH6102_t *const pCpnt,
const uint16_t interval )
inline

Set MTCH6102 base interval.

Parameters
[in]pCpnt- Pointer to MTCH6102 component
[in]interval- Time interval between baselines
Returns
FctERR - error code
Here is the call graph for this function:

◆ MTCH6102_Set_Debounce()

FctERR MTCH6102_Set_Debounce ( const MTCH6102_t *const pCpnt,
const uint8_t touch,
const uint8_t release )
inline

Set MTCH6102 debounce period.

Parameters
[in]pCpnt- Pointer to MTCH6102 component
[in]touch- Debounce for touch
[in]release- Debounce for release
Returns
FctERR - error code
Here is the call graph for this function:

◆ MTCH6102_Set_Filter()

FctERR MTCH6102_Set_Filter ( const MTCH6102_t *const pCpnt,
const MTCH6102_FILTER_TYPE type,
const uint8_t strength,
const bool baseline_filter )

Set MTCH6102 raw acquisition filter.

Parameters
[in]pCpnt- Pointer to MTCH6102 component
[in]type- Filter type
[in]strength- Filter strength
[in]baseline_filter- 0: Acquisition filter, 1: Baseline filter
Returns
FctERR - error code
Here is the call graph for this function:

◆ MTCH6102_Set_Hysteresis()

FctERR MTCH6102_Set_Hysteresis ( const MTCH6102_t *const pCpnt,
const uint8_t hyst )
inline

Set MTCH6102 touch to release hysteresis.

Parameters
[in]pCpnt- Pointer to MTCH6102 component
[in]hyst- Hysteresis
Returns
FctERR - error code
Here is the call graph for this function:

◆ MTCH6102_Set_Idle_Period()

FctERR MTCH6102_Set_Idle_Period ( const MTCH6102_t *const pCpnt,
const uint16_t period )

Set MTCH6102 idle period.

Parameters
[in]pCpnt- Pointer to MTCH6102 component
[in]period- Idle period
Returns
FctERR - error code
Here is the call graph for this function:

◆ MTCH6102_Set_Idle_Timeout()

FctERR MTCH6102_Set_Idle_Timeout ( const MTCH6102_t *const pCpnt,
const uint8_t timeout )
inline

Set MTCH6102 idle timeout.

Parameters
[in]pCpnt- Pointer to MTCH6102 component
[in]timeout- Idle timeout
Returns
FctERR - error code
Here is the call graph for this function:

◆ MTCH6102_Set_Large_Activation_Threshold()

FctERR MTCH6102_Set_Large_Activation_Threshold ( const MTCH6102_t *const pCpnt,
const uint16_t thr )
inline

Set MTCH6102 large activation threshold.

Parameters
[in]pCpnt- Pointer to MTCH6102 component
[in]thr- Large activation threshold
Returns
FctERR - error code
Here is the call graph for this function:

◆ MTCH6102_Set_Mode()

FctERR MTCH6102_Set_Mode ( const MTCH6102_t *const pCpnt,
const MTCH6102_MODE mode )

Set MTCH6102 gesture decoding.

Parameters
[in]pCpnt- Pointer to MTCH6102 component
[in]mode- Gesture decoding mode
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MTCH6102_Set_Scan_Count()

FctERR MTCH6102_Set_Scan_Count ( const MTCH6102_t *const pCpnt,
const uint8_t count )
inline

Set MTCH6102 scan count.

Parameters
[in]pCpnt- Pointer to MTCH6102 component
[in]count- Scan count
Returns
FctERR - error code
Here is the call graph for this function:

◆ MTCH6102_Set_Touch_Threshold()

FctERR MTCH6102_Set_Touch_Threshold ( const MTCH6102_t *const pCpnt,
const uint8_t xthr,
const uint8_t ythr )
inline

Set MTCH6102 touch threshold.

Parameters
[in]pCpnt- Pointer to MTCH6102 component
[in]xthr- Rx lines touch threshold
[in]ythr- Tx lines touch threshold
Returns
FctERR - error code
Here is the call graph for this function:

◆ MTCH6102_Store_To_Non_Volatile()

FctERR MTCH6102_Store_To_Non_Volatile ( const MTCH6102_t *const pCpnt)
inline

Write MTCH6102 parameters to non volatile storage.

Parameters
[in]pCpnt- Pointer to MTCH6102 component
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MTCH6102_SYNC_GPIO_Get()

bool MTCH6102_SYNC_GPIO_Get ( const MTCH6102_t *const pCpnt)

Synchro GPIO pin getter for MTCH6102.

Weak Functions
MTCH6102 Synchro GPIO pin getter may be user implemented if needed
Parameters
[in]pCpnt- Pointer to MTCH6102 component
Returns
SYNC pin state value (0: inactive, 1: active)
Here is the call graph for this function:

◆ MTCH6102_SYNC_GPIO_Init()

void MTCH6102_SYNC_GPIO_Init ( MTCH6102_t *const pCpnt,
GPIO_TypeDef *const GPIOx,
const uint16_t GPIO_Pin,
const GPIO_PinState GPIO_Active )

Synchro GPIO pin init for MTCH6102.

Weak Functions
MTCH6102 Synchro GPIO pin init may be user implemented if needed
Parameters
[in]pCpnt- Pointer to MTCH6102 component
[in]GPIOx- SYNC port
[in]GPIO_Pin- SYNC pin
[in]GPIO_ActiveSYNC pin active state
Here is the call graph for this function: