Skip to content

Commit

Permalink
cpu/nrf53: setup XL1 and XL2 pins for using external 32K oscillator i…
Browse files Browse the repository at this point in the history
…f needed

Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
  • Loading branch information
dylad committed Jul 6, 2023
1 parent 02c659f commit d158ddb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cpu/nrf53/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ static_assert((CLOCK_CORECLOCK == MHZ(128)) || CLOCK_CORECLOCK == MHZ(64));
/* For now, disable the unused network core */
NRF_RESET_S->NETWORK.FORCEOFF = 1;

#if defined(MODULE_PERIPH_RTT) && (CLOCK_LFCLK==CLOCK_LFCLKSRC_SRC_LFXO)
/* Enable P0.00 and P0.01 as XL1/XL2 if LXFO is selected */
NRF_P0_S->PIN_CNF[0] &= ~GPIO_PIN_CNF_MCUSEL_Msk;
NRF_P0_S->PIN_CNF[0] |= GPIO_PIN_CNF_MCUSEL_Peripheral << GPIO_PIN_CNF_MCUSEL_Pos;
NRF_P0_S->PIN_CNF[1] &= ~GPIO_PIN_CNF_MCUSEL_Msk;
NRF_P0_S->PIN_CNF[1] |= GPIO_PIN_CNF_MCUSEL_Peripheral << GPIO_PIN_CNF_MCUSEL_Pos;
#endif
/* call cortexm default initialization */
cortexm_init();

Expand Down

0 comments on commit d158ddb

Please sign in to comment.