gossamer 0.0.1
a very lightweight app framework for SAMD and SAML chips
|
Functions for configuring the system and putting it in standby mode. More...
Functions | |
void | sys_init (void) |
Initializes the system clocks and performs any required system-wide setup. | |
uint32_t | get_cpu_frequency (void) |
Gets the CPU frequency. | |
bool | set_cpu_frequency (uint32_t freq) |
Sets the CPU frequency. | |
void | _enable_48mhz_gclk1 (void) |
Enables the 48 MHz clock on GCLK1 for USB operation. | |
void | _enter_standby_mode (void) |
Enters the low-power STANDBY mode. Does not return until an interrupt fires. | |
Functions for configuring the system and putting it in standby mode.
void _enable_48mhz_gclk1 | ( | void | ) |
Enables the 48 MHz clock on GCLK1 for USB operation.
This function is called by the USB stack when it is initialized.
void _enter_standby_mode | ( | void | ) |
Enters the low-power STANDBY mode. Does not return until an interrupt fires.
You should not generally need to call this function; at the end of every app_loop invocation, the main run loop enters standby mode if your app indicated that it was appropriate.
uint32_t get_cpu_frequency | ( | void | ) |
Gets the CPU frequency.
set_cpu_frequency
bool set_cpu_frequency | ( | uint32_t | freq | ) |
Sets the CPU frequency.
freq | one of 1000000, 2000000, 4000000, 8000000, 12000000 or 16000000. |
Supported CPU frequencies vary from chip to chip:
void sys_init | ( | void | ) |
Initializes the system clocks and performs any required system-wide setup.
Gossamer aims for consistency at system startup, no matter which chip you are working with. To that end:
usb_init
function will claim GCLK1 for the 48 MHz DFLL clock.