Browse Source

runtime/atsamd51x: use PCHCTRL_GCLK_SERCOMX_SLOW for setting clocks on all SERCOM ports

Signed-off-by: deadprogram <ron@hybridgroup.com>
pull/1331/head
deadprogram 4 years ago
committed by Ron Evans
parent
commit
222977a642
  1. 3
      src/device/sam/atsamd51x-bitfields.go
  2. 2
      src/runtime/runtime_atsamd51g19.go
  3. 2
      src/runtime/runtime_atsamd51j19.go
  4. 2
      src/runtime/runtime_atsamd51j20.go
  5. 2
      src/runtime/runtime_atsamd51p19.go

3
src/device/sam/atsamd51x-bitfields.go

@ -17,7 +17,8 @@ const (
PCHCTRL_GCLK_OSCCTRL_FDPLL1_32K = 3
PCHCTRL_GCLK_SDHC0_SLOW = 3
PCHCTRL_GCLK_SDHC1_SLOW = 3
// GCLK_SERCOM[0..7]_SLOW = 3
PCHCTRL_GCLK_SERCOMX_SLOW = 3 // GCLK_SERCOM[0..7]_SLOW = 3
// FDPLL0 = 3 // 32KHz clock for internal lock timer
// FDPLL1 = 3 //32KHz clock for internal lock timer
// SDHC0 = 3 // Slow

2
src/runtime/runtime_atsamd51g19.go

@ -13,7 +13,7 @@ func initSERCOMClocks() {
sam.GCLK_PCHCTRL_CHEN)
// sets the "slow" clock shared by all SERCOM
sam.GCLK.PCHCTRL[sam.PCHCTRL_GCLK_SDHC1_SLOW].Set((sam.GCLK_PCHCTRL_GEN_GCLK1 << sam.GCLK_PCHCTRL_GEN_Pos) |
sam.GCLK.PCHCTRL[sam.PCHCTRL_GCLK_SERCOMX_SLOW].Set((sam.GCLK_PCHCTRL_GEN_GCLK1 << sam.GCLK_PCHCTRL_GEN_Pos) |
sam.GCLK_PCHCTRL_CHEN)
// Turn on clock to SERCOM1

2
src/runtime/runtime_atsamd51j19.go

@ -13,7 +13,7 @@ func initSERCOMClocks() {
sam.GCLK_PCHCTRL_CHEN)
// sets the "slow" clock shared by all SERCOM
sam.GCLK.PCHCTRL[sam.PCHCTRL_GCLK_SDHC1_SLOW].Set((sam.GCLK_PCHCTRL_GEN_GCLK1 << sam.GCLK_PCHCTRL_GEN_Pos) |
sam.GCLK.PCHCTRL[sam.PCHCTRL_GCLK_SERCOMX_SLOW].Set((sam.GCLK_PCHCTRL_GEN_GCLK1 << sam.GCLK_PCHCTRL_GEN_Pos) |
sam.GCLK_PCHCTRL_CHEN)
// Turn on clock to SERCOM1

2
src/runtime/runtime_atsamd51j20.go

@ -13,7 +13,7 @@ func initSERCOMClocks() {
sam.GCLK_PCHCTRL_CHEN)
// sets the "slow" clock shared by all SERCOM
sam.GCLK.PCHCTRL[sam.PCHCTRL_GCLK_SDHC1_SLOW].Set((sam.GCLK_PCHCTRL_GEN_GCLK1 << sam.GCLK_PCHCTRL_GEN_Pos) |
sam.GCLK.PCHCTRL[sam.PCHCTRL_GCLK_SERCOMX_SLOW].Set((sam.GCLK_PCHCTRL_GEN_GCLK1 << sam.GCLK_PCHCTRL_GEN_Pos) |
sam.GCLK_PCHCTRL_CHEN)
// Turn on clock to SERCOM1

2
src/runtime/runtime_atsamd51p19.go

@ -13,7 +13,7 @@ func initSERCOMClocks() {
sam.GCLK_PCHCTRL_CHEN)
// sets the "slow" clock shared by all SERCOM
sam.GCLK.PCHCTRL[sam.PCHCTRL_GCLK_SDHC1_SLOW].Set((sam.GCLK_PCHCTRL_GEN_GCLK1 << sam.GCLK_PCHCTRL_GEN_Pos) |
sam.GCLK.PCHCTRL[sam.PCHCTRL_GCLK_SERCOMX_SLOW].Set((sam.GCLK_PCHCTRL_GEN_GCLK1 << sam.GCLK_PCHCTRL_GEN_Pos) |
sam.GCLK_PCHCTRL_CHEN)
// Turn on clock to SERCOM1

Loading…
Cancel
Save