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

MTCH6102 Driver procedures. More...

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

Data Structures

struct  MTCH6102_raw_gest
 
struct  MTCH6102_gest
 
struct  MTCH6102_t
 MTCH6102 user interface struct. More...
 

Macros

#define MTCH6102_CARTESIAN_CENTERED
 Define MTCH6102 to use default Cartesian reference centered on pad (using demo board routing)
 

Functions

FctERR MTCH6102_Init_Sequence (MTCH6102_t *const pCpnt)
 Initialization Sequence for MTCH6102 peripheral.
 
FctERR MTCH6102_Configure (MTCH6102_t *const pCpnt, const bool store_to_nv, const uint16_t active_per, const uint16_t idle_per, const MTCH6102_FILTER_TYPE filter, const uint8_t filter_str, const MTCH6102_FILTER_TYPE base_filter, const uint8_t base_filter_str, const uint8_t rx, const uint8_t tx)
 Configure MTCH6102 parameters needing configure step.
 
void MTCH6102_Set_Grid (MTCH6102_t *const pCpnt)
 Set MTCH6102 grid min & max values.
 
FctERR MTCH6102_Set_Compensation (MTCH6102_t *const pCpnt)
 Calculates compensation values regarding read values and writes them to MTCH6102.
 
void MTCH6102_Set_RxTx_Direction (MTCH6102_t *const pCpnt, const bool rx_dw, const bool tx_dw)
 Set MTCH6102 Tx Direction.
 
void MTCH6102_Set_Centered_Coord (MTCH6102_t *const pCpnt, const bool centered)
 Set MTCH6102 coordinates reference.
 
void MTCH6102_Set_Rotation (MTCH6102_t *const pCpnt, const int16_t angle)
 Set MTCH6102 coordinates rotation.
 
FctERR MTCH6102_Get_MFG_Results (MTCH6102_t *const pCpnt, uint32_t *const res)
 Get manufacturing test results.
 
void MTCH6102_decode_touch_datas (MTCH6102_t *const pCpnt, const MTCH6102_raw_gest *const dat)
 Decode raw MTCH6102 datas to touch datas.
 
FctERR MTCH6102_gesture_to_str (char *const str, const MTCH6102_GESTURE_STATE state)
 Get gesture string from gesture data.
 
FctERR MTCH6102_diag_to_str (char *const str, const MTCH6102_GESTURE_DIAGNOSTIC diag)
 Get diagnostic string from diagnostic data.
 
FctERR MTCH6102_handler (MTCH6102_t *const pCpnt)
 Handler for MTCH6102 peripheral.
 
FctERR MTCH6102_handler_it (MTCH6102_t *const pCpnt)
 Handler for MTCH6102 peripheral GPIO interrupt.
 
FctERR MTCH6102_handler_all (void)
 Handler for all MTCH6102 peripherals.
 
FctERR MTCH6102_handler_it_all (void)
 Handler for all MTCH6102 peripherals GPIO interrupt.
 

Variables

MTCH6102_t MTCH6102 [I2C_MTCH6102_NB]
 MTCH6102 User structure.
 

Detailed Description

MTCH6102 Driver procedures.

Author
SMFSW

MTCH6102: Low-Power Projected Capacitive Touch Controller

Macro Definition Documentation

◆ MTCH6102_CARTESIAN_CENTERED

#define MTCH6102_CARTESIAN_CENTERED

Define MTCH6102 to use default Cartesian reference centered on pad (using demo board routing)

Function Documentation

◆ MTCH6102_Configure()

FctERR MTCH6102_Configure ( MTCH6102_t *const pCpnt,
const bool store_to_nv,
const uint16_t active_per,
const uint16_t idle_per,
const MTCH6102_FILTER_TYPE filter,
const uint8_t filter_str,
const MTCH6102_FILTER_TYPE base_filter,
const uint8_t base_filter_str,
const uint8_t rx,
const uint8_t tx )

Configure MTCH6102 parameters needing configure step.

Parameters
[in,out]pCpnt- Pointer to MTCH6102 component
[in]store_to_nv- Store to non-volatile memory after configuration
[in]active_per- Active period value
[in]idle_per- Idle period value
[in]filter- Filter type
[in]filter_str- Filter strength
[in]base_filter- Base filter type
[in]base_filter_str- Base filter strength
[in]rx- Number of RX lines
[in]tx- Number of TX lines
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MTCH6102_decode_touch_datas()

void MTCH6102_decode_touch_datas ( MTCH6102_t *const pCpnt,
const MTCH6102_raw_gest *const dat )

Decode raw MTCH6102 datas to touch datas.

Warning
You would have to use MTCH6102_Set_RxTx_Direction to change behavior (complementing default demo board design to complement Tx to a Cartesian reference for example)
Parameters
[in]pCpnt- Pointer to MTCH6102 component
[in]dat- Raw touch datas
Here is the caller graph for this function:

◆ MTCH6102_diag_to_str()

FctERR MTCH6102_diag_to_str ( char *const str,
const MTCH6102_GESTURE_DIAGNOSTIC diag )

Get diagnostic string from diagnostic data.

Parameters
[in,out]str- Pointer to output string
[in,out]diag- Raw datas
Returns
FctERR - error code
Here is the caller graph for this function:

◆ MTCH6102_gesture_to_str()

FctERR MTCH6102_gesture_to_str ( char *const str,
const MTCH6102_GESTURE_STATE state )

Get gesture string from gesture data.

Parameters
[in,out]str- Pointer to output string
[in,out]state- Raw datas
Returns
FctERR - error code
Here is the caller graph for this function:

◆ MTCH6102_Get_MFG_Results()

FctERR MTCH6102_Get_MFG_Results ( MTCH6102_t *const pCpnt,
uint32_t *const res )

Get manufacturing test results.

Parameters
[in]pCpnt- Pointer to MTCH6102 component
[in,out]res- Channels shorted to GND in least significant 16b ; Channels shorted to Vdd in most significant 16b
Returns
FctERR - error code
Here is the call graph for this function:

◆ MTCH6102_handler()

FctERR MTCH6102_handler ( MTCH6102_t *const pCpnt)

Handler for MTCH6102 peripheral.

Weak Functions
MTCH6102 handler may be user implemented to suit custom needs
Note
May be called periodically to handle MTCH6102 tasks
Alternately may be called when event occurs on MTCH6102 pin (or by calling MTCH6102_handler_it instead)
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_handler_all()

FctERR MTCH6102_handler_all ( void )

Handler for all MTCH6102 peripherals.

Note
May be called periodically to handle all MTCH6102 tasks
Returns
FctERR - error code
Here is the call graph for this function:

◆ MTCH6102_handler_it()

FctERR MTCH6102_handler_it ( MTCH6102_t *const pCpnt)

Handler for MTCH6102 peripheral GPIO interrupt.

Note
MTCH6102_INT_GPIO_Init has to be called at init before using interrupt handler function
Weak Functions
MTCH6102 GPIO interrupt handler may be user implemented to suit custom needs
Note
May be called periodically to handle MTCH6102 tasks through interrupts
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_handler_it_all()

FctERR MTCH6102_handler_it_all ( void )

Handler for all MTCH6102 peripherals GPIO interrupt.

Note
MTCH6102_INT_GPIO_Init has to be called at init before using interrupt handler function
May be called periodically to handle all MTCH6102 tasks
Returns
FctERR - error code
Here is the call graph for this function:

◆ MTCH6102_Init_Sequence()

FctERR MTCH6102_Init_Sequence ( MTCH6102_t *const pCpnt)

Initialization Sequence for MTCH6102 peripheral.

Weak Functions
MTCH6102 Init sequence may be user implemented if custom initialization sequence needed
Parameters
[in,out]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_Set_Centered_Coord()

void MTCH6102_Set_Centered_Coord ( MTCH6102_t *const pCpnt,
const bool centered )
inline

Set MTCH6102 coordinates reference.

Parameters
[in,out]pCpnt- Pointer to MTCH6102 component
[in]centered- false: reference in the corner / true: reference in the middle of the pad
Here is the caller graph for this function:

◆ MTCH6102_Set_Compensation()

FctERR MTCH6102_Set_Compensation ( MTCH6102_t *const pCpnt)

Calculates compensation values regarding read values and writes them to MTCH6102.

Note
Beware, averaging is done through all read values, not picking a repeated value (this may not suit your needs, but it appeared that the average result was close to repeated values on custom capacitive board)
Parameters
[in]pCpnt- Pointer to MTCH6102 component
Returns
FctERR - error code
Here is the call graph for this function:

◆ MTCH6102_Set_Grid()

void MTCH6102_Set_Grid ( MTCH6102_t *const pCpnt)

Set MTCH6102 grid min & max values.

Parameters
[in,out]pCpnt- Pointer to MTCH6102 component
Here is the caller graph for this function:

◆ MTCH6102_Set_Rotation()

void MTCH6102_Set_Rotation ( MTCH6102_t *const pCpnt,
const int16_t angle )
inline

Set MTCH6102 coordinates rotation.

Parameters
[in,out]pCpnt- Pointer to MTCH6102 component
[in]angle- Rotation angle (in degrees, counter clockwise)
Here is the caller graph for this function:

◆ MTCH6102_Set_RxTx_Direction()

void MTCH6102_Set_RxTx_Direction ( MTCH6102_t *const pCpnt,
const bool rx_dw,
const bool tx_dw )
inline

Set MTCH6102 Tx Direction.

Parameters
[in,out]pCpnt- Pointer to MTCH6102 component
[in]rx_dw- false: rx0 origin left / true: rx0 origin right
[in]tx_dw- false: tx0 origin up / true: tx0 origin down
Here is the caller graph for this function:

Variable Documentation

◆ MTCH6102

MTCH6102_t MTCH6102[I2C_MTCH6102_NB]
extern

MTCH6102 User structure.