Microchip® Advanced Software Framework

sam0/applications/getting-started/main.c File Reference

Getting Started Application.

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

#include "asf.h"
#include "stdio_serial.h"
#include "conf_uart_serial.h"

Macros

#define STRING_EOL   "\r"
 
#define STRING_HEADER
 
#define TC_COUNT_VALUE   55535
 

Functions

static void configure_console (void)
 Configure UART console. More...
 
static void configure_eic_callback (void)
 Configures and registers the External Interrupt callback function with the driver. More...
 
static void configure_extint (void)
 Configures the External Interrupt Controller to detect changes in the board button state. More...
 
static void configure_tc (void)
 Configures TC function with the driver. More...
 
static void configure_tc_callbacks (void)
 Registers TC callback function with the driver. More...
 
static void extint_callback (void)
 Callback function for the EXTINT driver, called when an external interrupt detection occurs. More...
 
int main (void)
 getting-started Application entry point. More...
 
static void tc_callback_to_counter (struct tc_module *const module_inst)
 TC Callback function. More...
 
static void update_led_state (void)
 

Variables

static struct usart_module cdc_uart_module
 
static struct tc_module tc_instance
 

#define STRING_EOL   "\r"
#define STRING_HEADER
Value:
"-- Getting Started Example --\r\n" \
"-- "BOARD_NAME" --\r\n" \
"-- Compiled: "__DATE__" "__TIME__" --\r\n" \
"-- Pressing and release button SW0 should make LED0 on and off --"STRING_EOL
#define BOARD_NAME
Definition: app_init.h:140
#define STRING_EOL
Definition: sam0/applications/getting-started/main.c:85

Referenced by main().

#define TC_COUNT_VALUE   55535

static void configure_eic_callback ( void  )
static

Configures and registers the External Interrupt callback function with the driver.

References extint_callback(), EXTINT_CALLBACK_TYPE_DETECT, extint_chan_enable_callback(), and extint_register_callback().

Referenced by main().

static void configure_extint ( void  )
static
static void configure_tc ( void  )
static
static void configure_tc_callbacks ( void  )
static

Registers TC callback function with the driver.

References TC_CALLBACK_OVERFLOW, tc_callback_to_counter(), tc_enable_callback(), tc_instance, and tc_register_callback().

static void extint_callback ( void  )
static

Callback function for the EXTINT driver, called when an external interrupt detection occurs.

References update_led_state().

Referenced by configure_eic_callback().

static void tc_callback_to_counter ( struct tc_module *const  module_inst)
static

TC Callback function.

References count, printf, TC_COUNT_VALUE, and tc_set_count_value().

Referenced by configure_tc_callbacks().

static void update_led_state ( void  )
static

struct usart_module cdc_uart_module
static
struct tc_module tc_instance
static