Getting Started Application.
Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.
#include "asf.h"
Macros | |
#define | BLINK_PERIOD 1000 |
LED0 blink time, in ms. More... | |
#define | STRING_EOL "\r" |
#define | STRING_HEADER |
Functions | |
static void | configure_button (void) |
Configure push button 0 to generate an EIC interrupt. More... | |
static void | configure_console (void) |
Configure UART console. More... | |
static void | configure_tc (void) |
Configure Timer Counter 0 to generate an interrupt every 200ms. More... | |
int | main (void) |
getting-started Application entry point. More... | |
static void | mdelay (uint32_t ul_dly_ticks) |
Waits for the given number of milliseconds (using the g_ul_ms_ticks generated by the SAM's microcontrollers's system tick). More... | |
static void | set_toggle_flag (void) |
Interrupt handler for EIC interrupt. More... | |
void | SysTick_Handler (void) |
Handler for System Tick interrupt. More... | |
void | TC00_Handler (void) |
Interrupt handler for TC00 interrupt. More... | |
Variables | |
volatile uint32_t | g_b_led0_active = 1 |
LED0 blinking control. More... | |
volatile uint32_t | g_ul_ms_ticks = 0 |
Global g_ul_ms_ticks in milliseconds since start of application. More... | |
#define BLINK_PERIOD 1000 |
LED0 blink time, in ms.
Referenced by main().
#define STRING_EOL "\r" |
#define STRING_HEADER |
Referenced by main().
|
static |
Configure push button 0 to generate an EIC interrupt.
References eic_line_config::eic_async, EIC_ASYNCH_MODE, eic_line_config::eic_edge, EIC_EDGE_FALLING_EDGE, eic_enable(), eic_line_config::eic_filter, EIC_FILTER_DISABLED, eic_line_config::eic_level, EIC_LEVEL_LOW_LEVEL, eic_line_enable(), eic_line_set_callback(), eic_line_set_config(), eic_line_config::eic_mode, EIC_MODE_EDGE_TRIGGERED, GPIO_PUSH_BUTTON_EIC_IRQ, GPIO_PUSH_BUTTON_EIC_LINE, and set_toggle_flag().
Referenced by main().
|
static |
Configure UART console.
References uart_rs232_options::baudrate, CONF_UART, CONF_UART_BAUDRATE, CONF_UART_CHAR_LENGTH, CONF_UART_PARITY, CONF_UART_STOP_BITS, and stdio_serial_init().
Referenced by main().
|
static |
Configure Timer Counter 0 to generate an interrupt every 200ms.
References sysclk_enable_peripheral_clock(), sysclk_get_cpu_hz(), tc_enable_interrupt(), tc_find_mck_divisor(), tc_init(), tc_start(), and tc_write_rc().
Referenced by main().
int main | ( | void | ) |
getting-started Application entry point.
References BLINK_PERIOD, board_init(), BUTTON_0_NAME, configure_button(), configure_console(), configure_tc(), g_b_led0_active, LED0, LED_Toggle, mdelay(), STRING_HEADER, sysclk_get_cpu_hz(), and sysclk_init().
|
static |
Waits for the given number of milliseconds (using the g_ul_ms_ticks generated by the SAM's microcontrollers's system tick).
ul_dly_ticks | Delay to wait for, in milliseconds. |
References g_ul_ms_ticks.
Referenced by main().
|
static |
Interrupt handler for EIC interrupt.
References eic_line_clear_interrupt(), eic_line_interrupt_is_pending(), g_b_led0_active, GPIO_PUSH_BUTTON_EIC_LINE, LED0, and LED_Off.
Referenced by configure_button().
void SysTick_Handler | ( | void | ) |
Handler for System Tick interrupt.
Process System Tick Event Increments the g_ul_ms_ticks counter.
References g_ul_ms_ticks.
void TC00_Handler | ( | void | ) |
Interrupt handler for TC00 interrupt.
References tc_get_status(), and UNUSED.
volatile uint32_t g_b_led0_active = 1 |
LED0 blinking control.
Referenced by main(), and set_toggle_flag().
volatile uint32_t g_ul_ms_ticks = 0 |
Global g_ul_ms_ticks in milliseconds since start of application.
Referenced by mdelay(), and SysTick_Handler().