clocks.h File Reference
#include "pico.h"
#include "hardware/structs/clocks.h"

Go to the source code of this file.

Macros

#define KHZ   1000
 
#define MHZ   1000000
 
#define PARAM_ASSERTIONS_ENABLED_CLOCKS   0
 

Typedefs

typedef void(* resus_callback_t) (void)
 Resus callback function type. More...
 

Functions

void clocks_init (void)
 Initialise the clock hardware. More...
 
bool clock_configure (enum clock_index clk_index, uint32_t src, uint32_t auxsrc, uint32_t src_freq, uint32_t freq)
 Configure the specified clock. More...
 
void clock_stop (enum clock_index clk_index)
 Stop the specified clock. More...
 
uint32_t clock_get_hz (enum clock_index clk_index)
 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 (enum clock_index clk_index, 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 (uint gpio, uint src, uint div)
 Output an optionally divided clock to the specified gpio pin. More...
 
bool clock_configure_gpin (enum clock_index clk_index, uint gpio, uint32_t src_freq, uint32_t freq)
 Configure a clock to come from a gpio input. More...