This graph shows which files directly or indirectly include this file:
The functions are as follows:
User Exposed Functions:
tcapAD7147_Init tcapAD7147_touchGet tcapAD7147_touchEventGet tcapAD7147_Release
Data Structures:
tcapAD7147_t : state structure
Enums:
tcapAD7147_powerMode : Power modes for the device tcapAD7147_lowPowerConversionDelay : The Low power conversion delay tcapAD7147_decimation : The deciamtion tcapAD7147_CDCBais : CDC Bais percentage tcapAD7147_averageFPSkip : Average samples to skip in full power mode tcapAD7147_averageLPSkip : Average samples to skip in low power mode tcapAD7147_CINConnectionSetup : CIN connection setup tcapAD7147_SEConnectionSetup : Stage connection setup
Organization: The Learning Labs
Tested: Compiler bfin-elf-gcc; Output format Bare Metal Elf; Target TLL6527M V1.2
Revised: 20120405, Author: Karthikeyan. G.A.: Cleaned up, modified boiler plate
Revised: 20120404, Author: Karthikeyan. G.A., Notes: Added the support for the eventGet to report touch and release events.
Created: 20120317, Author: Karthikeyan. G.A., Notes: Created the Initial Version
References:
1. AD7147 CapTouch Programmable Controller for Single-Electrode Capacitance Sensors datasheet Rev. D
#define AD7147_BUTTON_NAME_MAX_LEN 20 |
#define AD7147_NUM_BANK2_REG 96 |
#define AD7147_NUM_BUTTONS 13 |
#define AD7147_REG_AMB_COMP_CTRL0 0x002 |
#define AD7147_REG_AMB_COMP_CTRL1 0x003 |
#define AD7147_REG_AMB_COMP_CTRL2 0x004 |
#define AD7147_REG_CDC_RESULT_S0 0x00B |
#define AD7147_REG_CDC_RESULT_S1 0x00C |
#define AD7147_REG_CDC_RESULT_S10 0x015 |
#define AD7147_REG_CDC_RESULT_S11 0x016 |
#define AD7147_REG_CDC_RESULT_S2 0x00D |
#define AD7147_REG_CDC_RESULT_S3 0x00E |
#define AD7147_REG_CDC_RESULT_S4 0x00F |
#define AD7147_REG_CDC_RESULT_S5 0x010 |
#define AD7147_REG_CDC_RESULT_S6 0x011 |
#define AD7147_REG_CDC_RESULT_S7 0x012 |
#define AD7147_REG_CDC_RESULT_S8 0x013 |
#define AD7147_REG_CDC_RESULT_S9 0x014 |
#define AD7147_REG_DEV_ID 0x017 |
#define AD7147_REG_PROXIMITY_STATUS 0x042 |
#define AD7147_REG_PWR_CONTROL 0x000 |
#define AD7147_REG_STAGE_CAL_EN 0x001 |
#define AD7147_REG_STAGE_COMPLETE_INT_ENABLE 0x007 |
#define AD7147_REG_STAGE_COMPLETE_INT_STATUS 0x00A |
#define AD7147_REG_STAGE_HIGH_INT_ENABLE 0x006 |
#define AD7147_REG_STAGE_HIGH_INT_STATUS 0x009 |
#define AD7147_REG_STAGE_LOW_INT_ENABLE 0x005 |
#define AD7147_REG_STAGE_LOW_INT_STATUS 0x008 |
#define AD7147_REG_STAGEx_AFE_OFFSET | ( | x | ) | ((int)(0x082 + x * 8)) |
#define AD7147_REG_STAGEx_CONNECTION1 | ( | x | ) | ((int)(0x080 + x * 8)) |
#define AD7147_REG_STAGEx_CONNECTION2 | ( | x | ) | ((int)(0x081 + x * 8)) |
#define AD7147_REG_STAGEx_OFFSET_HIGH | ( | x | ) | ((int)(0x085 + x * 8)) |
#define AD7147_REG_STAGEx_OFFSET_HIGH_CLAMP | ( | x | ) | ((int)(0x086 + x * 8)) |
#define AD7147_REG_STAGEx_OFFSET_LOW | ( | x | ) | ((int)(0x084 + x * 8)) |
#define AD7147_REG_STAGEx_OFFSET_LOW_CLAMP | ( | x | ) | ((int)(0x087 + x * 8)) |
#define AD7147_REG_STAGEx_SENSITIVITY | ( | x | ) | ((int)(0x083 + x * 8)) |
#define AD7147_SHIFT_AVG_FP_SKIP 12 |
#define AD7147_SHIFT_AVG_LP_SKIP 14 |
#define AD7147_SHIFT_CDC_BIAS 14 |
#define AD7147_SHIFT_CINx_CONNECTION_SETUP | ( | x | ) | ((int)(x<7?x*2:(x-7)*2)) |
#define AD7147_SHIFT_CONV_RESET 15 |
#define AD7147_SHIFT_DECIMATION 8 |
#define AD7147_SHIFT_EXT_SOURCE 12 |
#define AD7147_SHIFT_FF_SKIP_CNT 0 |
#define AD7147_SHIFT_FORCED_CAL 14 |
#define AD7147_SHIFT_FP_PROXIMITY_CNT 4 |
#define AD7147_SHIFT_FP_PROXIMITY_RECAL |
#define AD7147_SHIFT_GPIO_INPUT_CONFIG 14 |
#define AD7147_SHIFT_GPIO_INT 12 |
#define AD7147_SHIFT_GPIO_SETUP 12 |
#define AD7147_SHIFT_LP_CONV_DELAY 2 |
#define AD7147_SHIFT_LP_PROXIMITY_CNT 8 |
#define AD7147_SHIFT_LP_PROXIMITY_RECAL |
#define AD7147_SHIFT_NEG_AFE_OFFSET 0 |
#define AD7147_SHIFT_NEG_AFE_OFFSET_DISABLE 14 |
#define AD7147_SHIFT_NEG_AFE_OFFSET_SWAP 7 |
#define AD7147_SHIFT_NEG_PEAK_DETECT 4 |
#define AD7147_SHIFT_NEG_THRESHOLD_SENSITIVITY 0 |
#define AD7147_SHIFT_NT_POL 11 |
#define AD7147_SHIFT_POS_AFE_OFFSET 8 |
#define AD7147_SHIFT_POS_AFE_OFFSET_DISABLE 15 |
#define AD7147_SHIFT_POS_AFE_OFFSET_SWAP 15 |
#define AD7147_SHIFT_POS_PEAK_DETECT 12 |
#define AD7147_SHIFT_POS_THRESHOLD_SENSITIVITY 8 |
#define AD7147_SHIFT_POWER_MODE 0 |
#define AD7147_SHIFT_PROXIMITY_DETECTION_RATE 8 |
#define AD7147_SHIFT_PROXIMITY_RECAL_LVL 0 |
#define AD7147_SHIFT_PWR_DOWN_TIMEOUT 12 |
#define AD7147_SHIFT_SE_CONNECTION_SETUP 12 |
#define AD7147_SHIFT_SEQUENCE_STAGE_NUM 4 |
#define AD7147_SHIFT_SLOW_FILTER_UPDATE_LVL 14 |
#define AD7147_SHIFT_STAGEx x |
#define AD7147_SHIFT_SW_RESET 10 |
#define TLL7UIQ35_SHIFT_TCAP_PB1_CIN 0 |
#define TLL7UIQ35_SHIFT_TCAP_PB2_CIN 2 |
#define TLL7UIQ35_SHIFT_TCAP_PB3_CIN 4 |
#define TLL7UIQ35_SHIFT_TCAP_PB4_CIN 6 |
#define TLL7UIQ35_SHIFT_TCAP_PB5_CIN 10 |
#define TLL7UIQ35_SHIFT_TCAP_WHEEL_0_CIN 8 |
#define TLL7UIQ35_SHIFT_TCAP_WHEEL_1_CIN 10 |
#define TLL7UIQ35_SHIFT_TCAP_WHEEL_2_CIN 12 |
#define TLL7UIQ35_SHIFT_TCAP_WHEEL_3_CIN 0 |
#define TLL7UIQ35_SHIFT_TCAP_WHEEL_4_CIN 2 |
#define TLL7UIQ35_SHIFT_TCAP_WHEEL_5_CIN 4 |
#define TLL7UIQ35_SHIFT_TCAP_WHEEL_6_CIN 6 |
#define TLL7UIQ35_SHIFT_TCAP_WHEEL_7_CIN 8 |
#define TLL7UIQ35_TCAP_PB1 0x0001 |
#define TLL7UIQ35_TCAP_PB1_CIN 0 |
#define TLL7UIQ35_TCAP_PB2 0x0002 |
#define TLL7UIQ35_TCAP_PB2_CIN 1 |
#define TLL7UIQ35_TCAP_PB3 0x0004 |
#define TLL7UIQ35_TCAP_PB3_CIN 2 |
#define TLL7UIQ35_TCAP_PB4 0x0008 |
#define TLL7UIQ35_TCAP_PB4_CIN 3 |
#define TLL7UIQ35_TCAP_PB5 0x1000 |
#define TLL7UIQ35_TCAP_PB5_CIN 12 |
#define TLL7UIQ35_TCAP_WHEEL_0 0x0010 |
#define TLL7UIQ35_TCAP_WHEEL_0_CIN 4 |
#define TLL7UIQ35_TCAP_WHEEL_1 0x0020 |
#define TLL7UIQ35_TCAP_WHEEL_1_CIN 5 |
#define TLL7UIQ35_TCAP_WHEEL_2 0x0040 |
#define TLL7UIQ35_TCAP_WHEEL_2_CIN 6 |
#define TLL7UIQ35_TCAP_WHEEL_3 0x0080 |
#define TLL7UIQ35_TCAP_WHEEL_3_CIN 7 |
#define TLL7UIQ35_TCAP_WHEEL_4 0x0100 |
#define TLL7UIQ35_TCAP_WHEEL_4_CIN 8 |
#define TLL7UIQ35_TCAP_WHEEL_5 0x0200 |
#define TLL7UIQ35_TCAP_WHEEL_5_CIN 9 |
#define TLL7UIQ35_TCAP_WHEEL_6 0x0400 |
#define TLL7UIQ35_TCAP_WHEEL_6_CIN 10 |
#define TLL7UIQ35_TCAP_WHEEL_7 0x0800 |
#define TLL7UIQ35_TCAP_WHEEL_7_CIN 11 |
enum tcapAD7147_CDCBais |
enum tcapAD7147_powerMode |
int tcapAD7147_Init | ( | tcapAD7147_t * | state, | |
unsigned char | slaveAddress, | |||
enum tcapAD7147_powerMode | powerMode | |||
) |
tcapAD7147_Init This functions initializes the device with default values provided.
Other registers are written with default setting. The registers are set as a bulk if their addresses are continuous.
Pre-conditions: Nothing
Post-Conditions: The device will be powered up following the power up sequence. The device is initialised with values such that all PB1 to PB4 is mapped to Stage 0 to Stage 3 of the device and wheel 0 through wheel 7 is mapped to Stage 4 through Stage 11 and PB5 is mapped to Stage 0. PB1 and PB5 are mapped to Stage0 such that a PB5 is conncected to negative and PB1 is connected to positive of Stage 0. Thus except PB5 all others will trigger a High interrupt while PB5 will trigger a Low interrupt.
state | tcapAD7147_t The state variable of the device | |
slaveAddress | unsigned char The slave address of AD7147 device. | |
powerMode | enum tcapAD7147_powerMode The power mode in which the AD7147 has to be put to. Normal or low power. |
slaveAddress | stores the state of AD7147 device |
powerMode | slave address of the AD7147 device The power mode to be set for the AD7147 chip |
int tcapAD7147_release | ( | tcapAD7147_t * | state | ) |
tcapAD7147_Release This functions switches off the device.
Pre-conditions: The device should have been initialised using the init function
Post-Conditions: The device will be powered off and no longer will respond to the interrupt
state | tcapAD7147_t The state variable of the device |
int tcapAD7147_touchEventGet | ( | tcapAD7147_t * | state | ) |
tcapAD7147_touchEventGet This function busy waits till there is a change in the state of the touch cap buttons and then reports back the values of the buttons and the buttons which has caused the change in state of the touch cap.
Pre-conditions: The device should have been initialised using the init function
Post-Conditions: The button change status and values are updated in the state variable
state | tcapAD7147_t The state variable of the device |
int tcapAD7147_touchGet | ( | tcapAD7147_t * | state | ) |
tcapAD7147_touchGet This function reads (no wait) the values of the buttons and updates the state variable.
Pre-conditions: The device should have been initialised using the init function
Post-Conditions: The button values are updated in the state variable
state | tcapAD7147_t The state variable of the device |