Microchip® Advanced Software Framework

main_sam4l.c File Reference

Low Power Application.

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

#include "asf.h"

Macros

#define PRIM_NUMS   8
 
#define STRING_EOL   "\r"
 
#define STRING_HEADER
 

Functions

static void app_prime_number_run (void)
 
static void ast_per_callback (void)
 AST interrupt handler. More...
 
static void button_handler (void)
 
static void config_ast (void)
 Initialize AST to generate 1Hz counter. More...
 
static void config_backup_wakeup (void)
 
static void configure_button (void)
 
static void configure_console (void)
 Configure serial console. More...
 
static void display_menu_core (void)
 
int main (void)
 Low power application entry point. More...
 
static void test_active_mode (void)
 Test active mode. More...
 
static void test_backup_mode (void)
 
static void test_core (void)
 Test Core consumption. More...
 
static void test_retention_mode (void)
 
static void test_wait_mode (void)
 

Variables

volatile uint32_t g_ul_button_pressed = 0
 Button pressed flag. More...
 

#define PRIM_NUMS   8

Referenced by app_prime_number_run().

#define STRING_EOL   "\r"
#define STRING_HEADER
Value:
"-- Low Power Demo --\r\n" \
"-- "BOARD_NAME" --\r\n" \
"-- Compiled: "__DATE__" "__TIME__" --"STRING_EOL
#define STRING_EOL
Definition: main_sam4l.c:102
#define BOARD_NAME
Name string macro.
Definition: sam4l8_xplained_pro.h:86

Referenced by main().

static void app_prime_number_run ( void  )
static

References PRIM_NUMS.

Referenced by test_active_mode().

static void ast_per_callback ( void  )
static

AST interrupt handler.

References ast_clear_interrupt_flag(), AST_INTERRUPT_PER, and ast_stop().

Referenced by config_ast().

static void config_backup_wakeup ( void  )
static

Retain I/O lines after wakeup from backup. Disable to undo the previous retention state then enable.

References bpm_disable_io_retention(), bpm_enable_fast_wakeup(), bpm_enable_io_retention(), and bpm_enable_wakeup_source().

Referenced by test_core().

static void configure_console ( void  )
static
static void display_menu_core ( void  )
static

Referenced by test_core().

int main ( void  )

Low power application entry point.

Returns
Unused (ANSI-C compatibility).

References board_init(), configure_console(), STRING_HEADER, sysclk_init(), and test_core().

static void test_active_mode ( void  )
static

Test active mode.

References app_prime_number_run(), BUTTON_0_NAME, and g_ul_button_pressed.

Referenced by test_core().

static void test_backup_mode ( void  )
static
static void test_retention_mode ( void  )
static
static void test_wait_mode ( void  )
static

volatile uint32_t g_ul_button_pressed = 0

Button pressed flag.

Referenced by button_handler(), and test_active_mode().