Clock system example 3.
Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.
Macros | |
#define | GCLK_ID GENCLK_PCK_0 |
Programmable Clock ID for the example by default. More... | |
Functions | |
int | main (void) |
Switch between various system clock sources and prescalers at run time. More... | |
static void | mdelay (uint32_t ul_dly_ticks) |
Wait for the given number of milliseconds (using the ul_ms_ticks generated by the SAM microcontroller system tick). More... | |
void | SysTick_Handler (void) |
Handler for System Tick interrupt. More... | |
static void | wait_for_switches (void) |
Wait for user push the button. More... | |
Variables | |
volatile uint32_t | ul_ms_ticks = 0 |
#define GCLK_ID GENCLK_PCK_0 |
Programmable Clock ID for the example by default.
Referenced by main().
int main | ( | void | ) |
Switch between various system clock sources and prescalers at run time.
References board_init(), GCLK_ID, GCLK_PIN, GCLK_PIN_MUX, genclk_config_defaults(), genclk_config_set_divider(), genclk_config_set_source(), genclk_enable(), GENCLK_PCK_PRES_1, GENCLK_PCK_PRES_2, GENCLK_PCK_SRC_MAINCK_8M_RC, GENCLK_PCK_SRC_MAINCK_XTAL, GENCLK_PCK_SRC_PLLACK, GENCLK_PCK_SRC_SLCK_RC, ioport_disable_pin(), ioport_set_pin_mode(), osc_disable(), osc_enable(), OSC_MAINCK_8M_RC, OSC_MAINCK_XTAL, osc_wait_ready(), sysclk_enable_peripheral_clock(), sysclk_init(), SYSCLK_PRES_1, SYSCLK_PRES_2, sysclk_set_prescalers(), sysclk_set_source(), SYSCLK_SRC_MAINCK_8M_RC, SYSCLK_SRC_MAINCK_XTAL, SYSCLK_SRC_SLCK_RC, and wait_for_switches().
|
static |
Wait for the given number of milliseconds (using the ul_ms_ticks generated by the SAM microcontroller system tick).
ul_dly_ticks | Delay to wait for, in milliseconds. |
References ul_ms_ticks.
Referenced by wait_for_switches().
void SysTick_Handler | ( | void | ) |
Handler for System Tick interrupt.
Process System Tick Event Increments the ul_ms_ticks counter.
References ul_ms_ticks.
|
static |
Wait for user push the button.
References ioport_get_pin_level(), and mdelay().
Referenced by main().
volatile uint32_t ul_ms_ticks = 0 |