BPM example.
Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.
Functions | |
static void | ast_per_callback (void) |
AST interrupt handler. More... | |
static void | config_ast (void) |
Initialize AST to generate 1Hz counter. More... | |
static void | config_backup_wakeup (void) |
static void | config_buttons (void) |
static void | configure_console (void) |
Configure serial console. More... | |
static void | display_menu (void) |
Display the user menu on the terminal. More... | |
static void | eic_callback (void) |
EIC interrupt handler for push button interrupt. More... | |
int | main (void) |
Application entry point for BPM example. More... | |
Variables | |
static bool | ps_status = BPM_PS_1 |
|
static |
AST interrupt handler.
References ast_clear_interrupt_flag(), AST_INTERRUPT_PER, and ast_stop().
Referenced by config_ast().
|
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 main().
|
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_backup_pin(), bpm_enable_fast_wakeup(), bpm_enable_io_retention(), and bpm_enable_wakeup_source().
Referenced by main().
|
static |
References EIC_ASYNCH_MODE, eic_callback(), EIC_EDGE_FALLING_EDGE, eic_enable(), EIC_FILTER_DISABLED, EIC_LEVEL_LOW_LEVEL, eic_line_enable(), eic_line_set_callback(), eic_line_set_config(), and EIC_MODE_EDGE_TRIGGERED.
Referenced by main().
|
static |
Configure serial console.
References uart_rs232_options::baudrate, and stdio_serial_init().
Referenced by main().
|
static |
Display the user menu on the terminal.
Referenced by main().
|
static |
EIC interrupt handler for push button interrupt.
References ast_stop(), ast_write_counter_value(), eic_line_clear_interrupt(), eic_line_interrupt_is_pending(), sysclk_disable_peripheral_clock(), and sysclk_enable_peripheral_clock().
Referenced by config_buttons().
int main | ( | void | ) |
Application entry point for BPM example.
References ast_start(), board_init(), BOARD_NAME, bpm_configure_power_scaling(), bpm_get_status(), BPM_PS_0, BPM_PS_1, BPM_PSCM_CPU_NOT_HALT, bpm_sleep(), BPM_SM_BACKUP, BPM_SM_RET, BPM_SM_SLEEP_0, BPM_SM_SLEEP_1, BPM_SM_SLEEP_2, BPM_SM_SLEEP_3, BPM_SM_WAIT, config_ast(), config_backup_wakeup(), config_buttons(), configure_console(), delay_ms, display_menu(), ps_status, SLEEP_MODE_1, and sysclk_init().
Referenced by main(), and ui_lcd_refresh_txt().