Skip to content

Commit 478a807

Browse files
committed
wip
1 parent dea7eff commit 478a807

18 files changed

+290
-784
lines changed

external/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ if(CMAKE_CROSSCOMPILING)
154154
set_property(TARGET asf4-drivers PROPERTY INTERFACE_LINK_LIBRARIES "")
155155

156156
find_library(QTOUCHLIB_A qtm_acq_samd51_0x000f PATHS asf4-drivers/qtouch/lib/gcc NO_CMAKE_FIND_ROOT_PATH)
157-
find_library(QTOUCHLIB_B qtm_binding_layer_cm4_0x0005 PATHS asf4-drivers/qtouch/lib/gcc NO_CMAKE_FIND_ROOT_PATH)
157+
find_library(QTOUCHLIB_B qtm_scroller_cm4_0x000b PATHS asf4-drivers/qtouch/lib/gcc NO_CMAKE_FIND_ROOT_PATH)
158158
find_library(QTOUCHLIB_T qtm_touch_key_cm4_0x0002 PATHS asf4-drivers/qtouch/lib/gcc NO_CMAKE_FIND_ROOT_PATH)
159159

160160
add_library(cryptoauthlib

external/asf4-drivers/Config/hpl_gclk_config.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@
387387
// <i> Indicates whether generic clock 5 configuration is enabled or not
388388
// <id> enable_gclk_gen_5
389389
#ifndef CONF_GCLK_GENERATOR_5_CONFIG
390-
#define CONF_GCLK_GENERATOR_5_CONFIG 0
390+
#define CONF_GCLK_GENERATOR_5_CONFIG 1
391391
#endif
392392

393393
// <h> Generic Clock Generator Control
@@ -404,7 +404,7 @@
404404
// <i> This defines the clock source for generic clock generator 5
405405
// <id> gclk_gen_5_oscillator
406406
#ifndef CONF_GCLK_GEN_5_SOURCE
407-
#define CONF_GCLK_GEN_5_SOURCE GCLK_GENCTRL_SRC_GCLKGEN1
407+
#define CONF_GCLK_GEN_5_SOURCE GCLK_GENCTRL_SRC_DFLL
408408
#endif
409409

410410
// <q> Run in Standby
@@ -446,15 +446,15 @@
446446
// <i> Indicates whether Generic Clock Generator Enable is enabled or not
447447
// <id> gclk_arch_gen_5_enable
448448
#ifndef CONF_GCLK_GEN_5_GENEN
449-
#define CONF_GCLK_GEN_5_GENEN 0
449+
#define CONF_GCLK_GEN_5_GENEN 1
450450
#endif
451451
// </h>
452452

453453
//<h> Generic Clock Generator Division
454454
//<o> Generic clock generator 5 division <0x0000-0xFFFF>
455455
// <id> gclk_gen_5_div
456456
#ifndef CONF_GCLK_GEN_5_DIV
457-
#define CONF_GCLK_GEN_5_DIV 62
457+
#define CONF_GCLK_GEN_5_DIV 6
458458
#endif
459459
// </h>
460460
// </e>

external/asf4-drivers/Config/peripheral_clk_config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@
3333

3434
// <i> Select the clock source for ADC.
3535
#ifndef CONF_GCLK_ADC0_SRC
36-
#define CONF_GCLK_ADC0_SRC GCLK_PCHCTRL_GEN_GCLK2_Val
36+
#define CONF_GCLK_ADC0_SRC GCLK_PCHCTRL_GEN_GCLK5_Val
3737
#endif
3838

3939
/**
4040
* \def CONF_GCLK_ADC0_FREQUENCY
4141
* \brief ADC0's Clock frequency
4242
*/
4343
#ifndef CONF_GCLK_ADC0_FREQUENCY
44-
#define CONF_GCLK_ADC0_FREQUENCY 12000000
44+
#define CONF_GCLK_ADC0_FREQUENCY 8000000
4545
#endif
4646

4747
/**

external/asf4-drivers/qtouch/include/qtm_acq_samd51_0x000f_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Filename : qtm_acq_samd51_0x000f_api.h
33
Project : QTouch Modular Library
44
Purpose : API for Acquisition module - SAMD51/PTC
55
------------------------------------------------------------------------------
6-
Copyright (c) 2017 Microchip Inc. All rights reserved.
6+
Copyright (c) 2019 Microchip Inc. All rights reserved.
77
------------------------------------------------------------------------------
88
============================================================================*/
99

external/asf4-drivers/qtouch/include/qtm_acq_same54_0x000f_api.h

Lines changed: 53 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Filename : qtm_acq_same54_0x000f_api.h
33
Project : QTouch Modular Library
44
Purpose : 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 */
7373
typedef 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
*/
8280
typedef 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

Comments
 (0)