v2.0.0
Macros | Typedefs | Functions
clocks.h File Reference
`#include "pico.h"`
`#include "hardware/structs/clocks.h"`
Include dependency graph for clocks.h:

Go to the source code of this file.

## Macros
#define | KHZ 1000
#define | MHZ 1000000
#define | PLL_COMMON_REFDIV 1
#define | PLL_SYS_REFDIV PLL_COMMON_REFDIV
#define | PLL_USB_REFDIV PLL_COMMON_REFDIV
#define | PARAM_ASSERTIONS_ENABLED_HARDWARE_CLOCKS 0

## Typedefs
typedef clock_num_t | clock_handle_t
typedef void(* | resus_callback_t) (void)
| Resus callback function type. More...

## Functions
bool | clock_configure (clock_handle_t clock, uint32_t src, uint32_t auxsrc, uint32_t src_freq, uint32_t freq)
| Configure the specified clock. More...
void | clock_configure_undivided (clock_handle_t clock, uint32_t src, uint32_t auxsrc, uint32_t src_freq)
| Configure the specified clock to use the undividded input source. More...
void | clock_configure_int_divider (clock_handle_t clock, uint32_t src, uint32_t auxsrc, uint32_t src_freq, uint32_t int_divider)
| Configure the specified clock to use the undividded input source. More...
void | clock_stop (clock_handle_t clock)
| Stop the specified clock. More...
uint32_t | clock_get_hz (clock_handle_t clock)
| Get the current frequency of the specified clock. More...
uint32_t | frequency_count_khz (uint src)
| Measure a clocks frequency using the Frequency counter. More...
void | clock_set_reported_hz (clock_handle_t clock, uint hz)
| Set the "current frequency" of the clock as reported by clock_get_hz without actually changing the clock. More...
static float | frequency_count_mhz (uint src)
void | clocks_enable_resus (resus_callback_t resus_callback)
| Enable the resus function. Restarts clk_sys if it is accidentally stopped. More...
void | clock_gpio_init_int_frac (uint gpio, uint src, uint32_t div_int, uint8_t div_frac)
| Output an optionally divided clock to the specified gpio pin. More...
static void | clock_gpio_init (uint gpio, uint src, float div)
| Output an optionally divided clock to the specified gpio pin. More...
bool | clock_configure_gpin (clock_handle_t clock, uint gpio, uint32_t src_freq, uint32_t freq)
| Configure a clock to come from a gpio input. More...
void | set_sys_clock_48mhz (void)
| Initialise the system clock to 48MHz. More...
void | set_sys_clock_pll (uint32_t vco_freq, uint post_div1, uint post_div2)
| Initialise the system clock. More...
bool | check_sys_clock_hz (uint32_t freq_hz, uint *vco_freq_out, uint *post_div1_out, uint *post_div2_out)
| Check if a given system clock frequency is valid/attainable. More...
bool | check_sys_clock_khz (uint32_t freq_khz, uint *vco_freq_out, uint *post_div1_out, uint *post_div2_out)
| Check if a given system clock frequency is valid/attainable. More...
static bool | set_sys_clock_hz (uint32_t freq_hz, bool required)
| Attempt to set a system clock frequency in hz. More...
static bool | set_sys_clock_khz (uint32_t freq_khz, bool required)
| Attempt to set a system clock frequency in khz. More...