Microchip® Advanced Software Framework

sam_low_power/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 BOARD_NAME
Definition: inc/app_init.h:140
#define STRING_EOL
Definition: sam_low_power/main_sam4l.c:102

Referenced by main().

static void app_prime_number_run ( void  )
static

References PRIM_NUMS.

Referenced by main(), and 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 button_handler ( void  )
static
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

Configure serial console.

References uart_rs232_options::baudrate, and stdio_serial_init().

Referenced by main().

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(), and g_ul_button_pressed.

Referenced by test_core().

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

References ast_start(), delay_ms, SLEEPMGR_RET, and sleepmgr_sleep().

Referenced by test_core().

static void test_wait_mode ( void  )
static

References ast_start(), delay_ms, sleepmgr_sleep(), and SLEEPMGR_WAIT.

Referenced by test_core().

volatile uint32_t g_ul_button_pressed = 0

Button pressed flag.

Referenced by button_handler(), and test_active_mode().