Microchip® Advanced Software Framework

clock_example1_sam.c File Reference

Clock system example 1.

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

#include "asf.h"

Macros

#define EXAMPLE_LED_GPIO   LED4_GPIO
 

Functions

int main (void)
 Initialize the clock system and blink a LED at a constant 1 Hz frequency. 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...
 

Variables

volatile uint32_t ul_ms_ticks = 0
 

#define EXAMPLE_LED_GPIO   LED4_GPIO

Referenced by main().

int main ( void  )

Initialize the clock system and blink a LED at a constant 1 Hz frequency.

Returns
Unused (ANSI-C compatibility).

References board_init(), EXAMPLE_LED_GPIO, ioport_toggle_pin_level(), mdelay(), sysclk_get_cpu_hz(), and sysclk_init().

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

void SysTick_Handler ( void  )

Handler for System Tick interrupt.

Process System Tick Event and increments the ul_ms_ticks counter.

References ul_ms_ticks.

volatile uint32_t ul_ms_ticks = 0

Referenced by mdelay(), and SysTick_Handler().