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 |
Referenced by main().
|
static |
References PRIM_NUMS.
Referenced by test_active_mode().
|
static |
AST interrupt handler.
References ast_clear_interrupt_flag(), AST_INTERRUPT_PER, and ast_stop().
Referenced by config_ast().
|
static |
References ast_stop(), ast_write_counter_value(), BUTTON_0_EIC_LINE, eic_line_clear_interrupt(), eic_line_interrupt_is_pending(), and g_ul_button_pressed.
Referenced by configure_button().
|
static |
Initialize AST to generate 1Hz counter.
References ast_clear_interrupt_flag(), AST_COUNTER_MODE, ast_enable(), ast_enable_wakeup(), AST_INTERRUPT_PER, AST_OSC_1KHZ, ast_per_callback(), AST_PSEL_32KHZ_1HZ, ast_set_callback(), ast_set_config(), ast_stop(), AST_WAKEUP_PER, ast_write_periodic0_value(), ast_config::counter, ast_config::mode, osc_enable(), OSC_ID_OSC32, osc_is_ready(), ast_config::osc_type, osc_wait_ready(), and ast_config::psel.
Referenced by test_core().
|
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 |
References BUTTON_0_EIC_LINE, button_handler(), 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, and EIC_MODE_EDGE_TRIGGERED.
Referenced by test_core().
|
static |
Configure serial 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 |
Referenced by test_core().
int main | ( | void | ) |
Low power application entry point.
References board_init(), configure_console(), STRING_HEADER, sysclk_init(), and test_core().
|
static |
Test active mode.
References app_prime_number_run(), BUTTON_0_NAME, and g_ul_button_pressed.
Referenced by test_core().
|
static |
References ast_start(), delay_ms, SLEEPMGR_BACKUP, and sleepmgr_sleep().
Referenced by test_core().
|
static |
Test Core consumption.
References bpm_configure_power_scaling(), bpm_get_status(), BPM_PS_0, BPM_PS_1, CONF_UART, config_ast(), config_backup_wakeup(), configure_button(), display_menu_core(), test_active_mode(), test_backup_mode(), test_retention_mode(), test_wait_mode(), and usart_read().
Referenced by main().
|
static |
References ast_start(), BUTTON_0_NAME, delay_ms, SLEEPMGR_RET, and sleepmgr_sleep().
Referenced by test_core().
|
static |
References ast_start(), BUTTON_0_NAME, 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().