Microchip® Advanced Software Framework

clock_example3_sam.c File Reference

Clock system example 3.

Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.

#include "asf.h"
#include "genclk.h"
#include "conf_board.h"
#include "conf_example3.h"

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().

static void mdelay ( uint32_t  ul_dly_ticks)
static

Wait for the given number of milliseconds (using the ul_ms_ticks generated by the SAM microcontroller system tick).

Parameters
ul_dly_ticksDelay 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 void wait_for_switches ( void  )
static

Wait for user push the button.

References ioport_get_pin_level(), and mdelay().

Referenced by main().

volatile uint32_t ul_ms_ticks = 0