@@ -3,7 +3,7 @@ Filename : qtm_acq_same54_0x000f_api.h
33Project : QTouch Modular Library
44Purpose : API for Acquisition module - SAME54/PTC
55------------------------------------------------------------------------------
6- Copyright (c) 2017 Microchip Inc. All rights reserved.
6+ Copyright (c) 2019 Microchip Inc. All rights reserved.
77------------------------------------------------------------------------------
88============================================================================*/
99
@@ -30,16 +30,16 @@ Copyright (c) 2017 Microchip Inc. All rights reserved.
3030#define CAL_CHRG_5TAU 3u
3131
3232#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
3434
3535#define NUM_PTC_XY_LINES 32u
3636
3737/* X line bit position */
3838#define X_NONE 0u
39- #define X_LINE (n ) ((uint32_t)(1u << (n)))
39+ #define X (n ) ((uint32_t)(1u << (n)))
4040
4141/* Y line bit position */
42- #define Y_LINE (n ) ((uint32_t)(1u << (n)))
42+ #define Y (n ) ((uint32_t)(1u << (n)))
4343
4444/* Extract Analog / Digital Gain */
4545#define NODE_GAIN_ANA (m ) (uint8_t)(((m)&0xF0u) >> 4u)
@@ -72,22 +72,20 @@ typedef enum tag_filter_level_t {
7272/* Touch library GAIN setting */
7373typedef enum tag_gain_t { GAIN_1 , GAIN_2 , GAIN_4 , GAIN_8 , GAIN_16 } gain_t ;
7474/* 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:
7776 * PRSC_DIV_SEL_2 sets PTC Clock to 2MHz
7877 * PRSC_DIV_SEL_4 sets PTC Clock to 1MHz
79- * PRSC_DIV_SEL_8 sets PTC Clock to 500KHz
8078 *
8179 */
8280typedef enum tag_prsc_div_sel_t {
83- PRSC_DIV_SEL_1 ,
8481 PRSC_DIV_SEL_2 ,
8582 PRSC_DIV_SEL_4 ,
8683 PRSC_DIV_SEL_8 ,
8784 PRSC_DIV_SEL_16 ,
8885 PRSC_DIV_SEL_32 ,
8986 PRSC_DIV_SEL_64 ,
90- PRSC_DIV_SEL_128
87+ PRSC_DIV_SEL_128 ,
88+ PRSC_DIV_SEL_256
9189} prsc_div_sel_t ;
9290
9391/**
@@ -192,6 +190,52 @@ typedef struct {
192190 uint8_t auto_scan_trigger ;
193191} qtm_auto_scan_config_t ;
194192
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+
195239/*----------------------------------------------------------------------------
196240 * prototypes
197241 *----------------------------------------------------------------------------*/
0 commit comments