libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
CLOCK peripheral API

Access functions for the NRF51 Clock Controller More...

Collaboration diagram for CLOCK peripheral API:

Functions

void clock_set_xtal_freq (enum clock_xtal_freq freq)
 Select nominal frequency of external crystal for HFCLK. More...
 
void clock_start_lfclk (bool wait)
 Start Low Frequency Clock. More...
 
void clock_stop_lfclk ()
 Stop Low Frequency Clock. More...
 
void clock_start_hfclk (bool wait)
 Start High Frequency Crystal Oscillator. More...
 
void clock_stop_hfclk ()
 Stop High Frequency Crystal Oscillator. More...
 
void clock_set_lfclk_src (enum clock_lfclk_src lfclk_src)
 Low Frequency Clock Source. More...
 

Detailed Description

Access functions for the NRF51 Clock Controller

Access functions for the Clock Controller

LGPL License Terms libopencm3 License

Author
© 2016 Roel Postelmans

LGPL License Terms libopencm3 License

Author
© 2016 Maxim Sloyko maxim.nosp@m.s@go.nosp@m.ogle..nosp@m.com
© 2021 Eduard Drusa <ventyl86 at netkosice dot sk>

Function Documentation

◆ clock_set_lfclk_src()

void clock_set_lfclk_src ( enum clock_lfclk_src  lfclk_src)

Low Frequency Clock Source.

Parameters
[in]lfclk_srcenum clock_lfclk_src

Definition at line 78 of file clock_common.c.

References CLOCK_LFCLKSRC.

◆ clock_set_xtal_freq()

void clock_set_xtal_freq ( enum clock_xtal_freq  freq)

Select nominal frequency of external crystal for HFCLK.

This register has to match the actual crystal used in design to enable correct behaviour.

Parameters
[in]freqenum clock_xtal_freq

Definition at line 40 of file clock.c.

References CLOCK_XTALFREQ.

◆ clock_start_hfclk()

void clock_start_hfclk ( bool  wait)

Start High Frequency Crystal Oscillator.

Oscillator needs to be running for the radio to work.

Parameters
[in]waitbool If true, will busy wait for the clock to start.

Definition at line 60 of file clock_common.c.

References CLOCK_HFCLKSTAT, CLOCK_HFCLKSTAT_STATE, CLOCK_TASK_HFCLKSTART, and PERIPH_TRIGGER_TASK.

◆ clock_start_lfclk()

void clock_start_lfclk ( bool  wait)

Start Low Frequency Clock.

Parameters
[in]waitbool: If true, will busy wait for the clock to start.

Definition at line 40 of file clock_common.c.

References CLOCK_LFCLKSTAT, CLOCK_LFCLKSTAT_STATE, CLOCK_TASK_LFCLKSTART, and PERIPH_TRIGGER_TASK.

◆ clock_stop_hfclk()

void clock_stop_hfclk ( void  )

Stop High Frequency Crystal Oscillator.

Definition at line 69 of file clock_common.c.

References CLOCK_TASK_HFCLKSTOP, and PERIPH_TRIGGER_TASK.

◆ clock_stop_lfclk()

void clock_stop_lfclk ( void  )

Stop Low Frequency Clock.

Definition at line 49 of file clock_common.c.

References CLOCK_TASK_LFCLKSTOP, and PERIPH_TRIGGER_TASK.