@@ -3,7 +3,7 @@ Filename : qtm_acq_same54_0x000f_api.h
3
3
Project : QTouch Modular Library
4
4
Purpose : API for Acquisition module - SAME54/PTC
5
5
------------------------------------------------------------------------------
6
- Copyright (c) 2017 Microchip Inc. All rights reserved.
6
+ Copyright (c) 2019 Microchip Inc. All rights reserved.
7
7
------------------------------------------------------------------------------
8
8
============================================================================*/
9
9
@@ -30,16 +30,16 @@ Copyright (c) 2017 Microchip Inc. All rights reserved.
30
30
#define CAL_CHRG_5TAU 3u
31
31
32
32
#define RSEL_MAX_OPTION RSEL_VAL_200
33
- #define PRSC_MAX_OPTION PRSC_DIV_SEL_128
33
+ #define PRSC_MAX_OPTION PRSC_DIV_SEL_256
34
34
35
35
#define NUM_PTC_XY_LINES 32u
36
36
37
37
/* X line bit position */
38
38
#define X_NONE 0u
39
- #define X_LINE (n ) ((uint32_t)(1u << (n)))
39
+ #define X (n ) ((uint32_t)(1u << (n)))
40
40
41
41
/* Y line bit position */
42
- #define Y_LINE (n ) ((uint32_t)(1u << (n)))
42
+ #define Y (n ) ((uint32_t)(1u << (n)))
43
43
44
44
/* Extract Analog / Digital Gain */
45
45
#define NODE_GAIN_ANA (m ) (uint8_t)(((m)&0xF0u) >> 4u)
@@ -72,22 +72,20 @@ typedef enum tag_filter_level_t {
72
72
/* Touch library GAIN setting */
73
73
typedef enum tag_gain_t { GAIN_1 , GAIN_2 , GAIN_4 , GAIN_8 , GAIN_16 } gain_t ;
74
74
/* PTC clock prescale setting.
75
- * Example: if Generic clock input to PTC = 4MHz, then:
76
- * PRSC_DIV_SEL_1 sets PTC Clock to 4MHz
75
+ * For Example: if Generic clock input to PTC = 4MHz, then:
77
76
* PRSC_DIV_SEL_2 sets PTC Clock to 2MHz
78
77
* PRSC_DIV_SEL_4 sets PTC Clock to 1MHz
79
- * PRSC_DIV_SEL_8 sets PTC Clock to 500KHz
80
78
*
81
79
*/
82
80
typedef enum tag_prsc_div_sel_t {
83
- PRSC_DIV_SEL_1 ,
84
81
PRSC_DIV_SEL_2 ,
85
82
PRSC_DIV_SEL_4 ,
86
83
PRSC_DIV_SEL_8 ,
87
84
PRSC_DIV_SEL_16 ,
88
85
PRSC_DIV_SEL_32 ,
89
86
PRSC_DIV_SEL_64 ,
90
- PRSC_DIV_SEL_128
87
+ PRSC_DIV_SEL_128 ,
88
+ PRSC_DIV_SEL_256
91
89
} prsc_div_sel_t ;
92
90
93
91
/**
@@ -192,6 +190,52 @@ typedef struct {
192
190
uint8_t auto_scan_trigger ;
193
191
} qtm_auto_scan_config_t ;
194
192
193
+ #define DRIVEN_SHIELD_DUMMY_ACQ 3u
194
+
195
+ typedef void (* qtm_drivenshield_callback_t )(uint8_t csd , uint8_t sds , uint8_t prescaler , uint8_t volatile * ptr ,
196
+ uint8_t value );
197
+
198
+ /* Drivenshield status flag */
199
+ typedef struct qtm_drivenshield_config_tag {
200
+ uint8_t flags ;
201
+ } qtm_drivenshield_config_t ;
202
+
203
+ /*============================================================================
204
+ touch_ret_t qtm_drivenshield_setup(qtm_drivenshield_config_t* config);
205
+ ------------------------------------------------------------------------------
206
+ Purpose: Setup the drivenshield with settings from the user
207
+ Input : drivenshield_config_t setup in touch.c and touch.h
208
+ Output : touch_ret_t
209
+ Notes : Called by application to load the drivenshield operating parameters
210
+
211
+ ============================================================================*/
212
+ touch_ret_t qtm_drivenshield_setup (qtm_drivenshield_config_t * config );
213
+
214
+ /*============================================================================
215
+ void qtm_drivenshield_register_start_callback(qtm_drivenshield_callback_t callback);
216
+ ------------------------------------------------------------------------------
217
+ Purpose: Register the drivenshield Start callback with the touch library
218
+ Input : Pointer to the application function to start the event system
219
+ Output : touch_ret_t
220
+ Notes : The library initialises this with a null, if this remains the
221
+ library will function as normal, if this is not null then the
222
+ application will start the event system and call this callback before
223
+ start of touch measurement
224
+
225
+ ============================================================================*/
226
+ touch_ret_t qtm_drivenshield_register_start_callback (qtm_drivenshield_callback_t callback );
227
+
228
+ /*============================================================================
229
+ touch_ret_t qtm_drivenshield_deregister_start_callback(void);
230
+ ------------------------------------------------------------------------------
231
+ Purpose: De-register the drivenshield Start callback with the touch library
232
+ Input : None
233
+ Output : touch_ret_t
234
+ Notes : When this function is called driven shield functionality will stop
235
+
236
+ ============================================================================*/
237
+ touch_ret_t qtm_drivenshield_deregister_start_callback (void );
238
+
195
239
/*----------------------------------------------------------------------------
196
240
* prototypes
197
241
*----------------------------------------------------------------------------*/
0 commit comments