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

AT42QT1244 Driver procedures. More...

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

Data Structures

struct  AT42QT1244_t
 AT42QT1244 user interface struct. More...
 

Functions

FctERR AT42QT1244_Init_Sequence (AT42QT1244_t *const pCpnt)
 Initialization Sequence for AT42QT1244 peripheral.
 
void AT42QT1244_Set_Reset_Time (AT42QT1244_t *const pCpnt)
 Set last reset time for AT42QT1244 peripheral.
 
void AT42QT1244_Delay_PowerOn (const AT42QT1244_t *const pCpnt)
 100ms delay generator for AT42QT1244 peripheral
 
uint16_t AT42QT1244_crc16 (uint16_t crc, const uint8_t data)
 16bits CRC calculation for AT42QT1244
 
FctERR AT42QT1244_Calibrate_Freq_Hopping (AT42QT1244_t *const pCpnt, uint16_t *const hcrc)
 Frequencies calibration for AT42QT1244 peripheral.
 
FctERR AT42QT1244_Calibrate_Low_Level (AT42QT1244_t *const pCpnt)
 Low level calibration for AT42QT1244 peripheral.
 
FctERR AT42QT1244_Calibrate_All_Keys (AT42QT1244_t *const pCpnt)
 All keys calibration for AT42QT1244 peripheral.
 
FctERR AT42QT1244_Calibrate_Key (AT42QT1244_t *const pCpnt, uint8_t Key)
 Key calibration for AT42QT1244 peripheral.
 
FctERR AT42QT1244_handler (AT42QT1244_t *const pCpnt)
 Handler for AT42QT1244 peripheral.
 
FctERR AT42QT1244_handler_it (AT42QT1244_t *const pCpnt)
 Handler for AT42QT1244 peripheral GPIO interrupt.
 
FctERR AT42QT1244_handler_all (void)
 Handler for all AT42QT1244 peripherals.
 
FctERR AT42QT1244_handler_it_all (void)
 Handler for all AT42QT1244 peripherals GPIO interrupt.
 

Variables

AT42QT1244_t AT42QT1244 [I2C_AT42QT1244_NB]
 AT42QT1244 User structure.
 

Detailed Description

AT42QT1244 Driver procedures.

Author
SMFSW

AT42QT1244: 24-key QMatrix FMEA IEC/EN/UL60730 Touch Sensor

Function Documentation

◆ AT42QT1244_Calibrate_All_Keys()

FctERR AT42QT1244_Calibrate_All_Keys ( AT42QT1244_t *const pCpnt)

All keys calibration for AT42QT1244 peripheral.

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

◆ AT42QT1244_Calibrate_Freq_Hopping()

FctERR AT42QT1244_Calibrate_Freq_Hopping ( AT42QT1244_t *const pCpnt,
uint16_t *const hcrc )

Frequencies calibration for AT42QT1244 peripheral.

Parameters
[in]pCpnt- Pointer to AT42QT1244 component
[in,out]hcrc- Pointer to resulting CRC value
Returns
FctERR - error code
Here is the call graph for this function:

◆ AT42QT1244_Calibrate_Key()

FctERR AT42QT1244_Calibrate_Key ( AT42QT1244_t *const pCpnt,
uint8_t Key )

Key calibration for AT42QT1244 peripheral.

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

◆ AT42QT1244_Calibrate_Low_Level()

FctERR AT42QT1244_Calibrate_Low_Level ( AT42QT1244_t *const pCpnt)

Low level calibration for AT42QT1244 peripheral.

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

◆ AT42QT1244_crc16()

uint16_t AT42QT1244_crc16 ( uint16_t crc,
const uint8_t data )

16bits CRC calculation for AT42QT1244

16bits crc calculation. Initial crc entry must be 0. The message is not augmented with 'zero' bits. polynomial = X16 + X15 + X2 + 1 Repeat this function for each data block byte, folding the result back into the call parameter crc

Parameters
[in]crc- current crc value
[in]data- new data for crc
Returns
New CRC value
Here is the caller graph for this function:

◆ AT42QT1244_Delay_PowerOn()

void AT42QT1244_Delay_PowerOn ( const AT42QT1244_t *const pCpnt)

100ms delay generator for AT42QT1244 peripheral

Warning
Delay is in blocking mode (only interrupts will run) and can take up to 100ms
Parameters
[in]pCpnt- Pointer to AT42QT1244 component
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AT42QT1244_handler()

FctERR AT42QT1244_handler ( AT42QT1244_t *const pCpnt)

Handler for AT42QT1244 peripheral.

Weak Functions
AT42QT1244 handler may be user implemented to suit custom needs
Note
May be called periodically to handle AT42QT1244 tasks
Alternately may be called when event occurs on AT42QT1244 pin (or by calling AT42QT1244_handler_it instead)
Parameters
[in]pCpnt- Pointer to AT42QT1244 component
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AT42QT1244_handler_all()

FctERR AT42QT1244_handler_all ( void )

Handler for all AT42QT1244 peripherals.

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

◆ AT42QT1244_handler_it()

FctERR AT42QT1244_handler_it ( AT42QT1244_t *const pCpnt)

Handler for AT42QT1244 peripheral GPIO interrupt.

Note
AT42QT1244_CHANGE_GPIO_Init has to be called at init before using interrupt handler function
Weak Functions
AT42QT1244 GPIO interrupt handler may be user implemented to suit custom needs
Note
May be called periodically to handle AT42QT1244 tasks through interrupts
Parameters
[in]pCpnt- Pointer to AT42QT1244 component
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AT42QT1244_handler_it_all()

FctERR AT42QT1244_handler_it_all ( void )

Handler for all AT42QT1244 peripherals GPIO interrupt.

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

◆ AT42QT1244_Init_Sequence()

FctERR AT42QT1244_Init_Sequence ( AT42QT1244_t *const pCpnt)

Initialization Sequence for AT42QT1244 peripheral.

Weak Functions
AT42QT1244 Init sequence may be user implemented if custom initialization sequence needed
Parameters
[in]pCpnt- Pointer to AT42QT1244 component
Returns
FctERR - error code
// Example: Setup the component to disable unused keys (last 14 ones)
if (err == ERROR_OK)
{
const uint8_t idx = pCpnt - AT42QT1244;
const uint16_t HCRC = NVM_Get_AT42QT1244_HCRC(idx); // USER IMPLEMENTED: Get previously computed HCRC from host to check against component one
if (HCRC != (MAKEWORD(DATA[0], DATA[1]))) // HCRC mismatch between host and component, setup needs to be performed
{
const uint8_t DATA[14] = { 0 };
err |= AT42QT1244_Send_Setup(pCpnt, DATA, AT42QT__SETUP_KEYS_MODE_10, sizeof(DATA));
// Some issues encountered while writing setup block (reason unidentified), resetting the MCU and trying to write again seems to solve issue
if (err != ERROR_OK) { NVIC_SystemReset(); }
else
{
NVM_Save_AT42QT1244_HCRC(idx, crc); // USER IMPLEMENTED: Save new HCRC to host non-volatile memory
NVIC_SystemReset(); // Ensure CRC is properly written in NVM (not relying on interrupts) before reset
}
}
}
@ AT42QT__SETUP_KEYS_MODE_10
Definition AT42QT1244.h:104
FctERR AT42QT1244_Reset(AT42QT1244_t *const pCpnt)
Reset command for AT42QT1244 peripheral.
Definition AT42QT1244_ex.c:102
FctERR AT42QT1244_Send_Setup(AT42QT1244_t *const pCpnt, uint16_t *const hcrc, const uint8_t *setup, const uint8_t addr, const uint8_t nb)
Send setup parameters to AT42QT1244 peripheral.
Definition AT42QT1244_ex.c:29
AT42QT1244_t AT42QT1244[I2C_AT42QT1244_NB]
AT42QT1244 User structure.
Definition AT42QT1244_proc.c:18
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AT42QT1244_Set_Reset_Time()

void AT42QT1244_Set_Reset_Time ( AT42QT1244_t *const pCpnt)
inline

Set last reset time for AT42QT1244 peripheral.

Here is the caller graph for this function:

Variable Documentation

◆ AT42QT1244

AT42QT1244_t AT42QT1244[I2C_AT42QT1244_NB]
extern

AT42QT1244 User structure.