Skip to content

Commit 1fe2e53

Browse files
committed
asf4 config: Activate clock generator 5
Activate an unused clock generator with source DFLL (48Mhz) and divisor 6 to generate 8Mhz. This is useful for running ADCs (max frequency for ADC) and for running the sd-card clock that otherwise introduces a lot of noise to the ADC. The ADC is what measures touch.
1 parent 10a93ea commit 1fe2e53

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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>

0 commit comments

Comments
 (0)