Microchip® Advanced Software Framework

low_power_demo.c File Reference
#include <string.h>
#include <asf.h>
#include "conf_app.h"

Macros

#define _SYSTEM_MCU_REVISION_B   1
 
#define BUFFER_LEN   10
 
#define LED0_TOGGLE_TIME   200
 

Enumerations

enum  led_toggle_times {
  LED0_TOGGLE_2 = 2,
  LED0_TOGGLE_4 = 4,
  LED0_TOGGLE_6 = 6,
  LED0_TOGGLE_8 = 8
}
 LED0 toggles times. More...
 

Functions

static void configure_adc (void)
 Configure ADC to sample the internal scaled VCC. More...
 
static void configure_dma (void)
 Config DMA to make peripheral-to-memory transfer from the ADC to the HMCRAMLP memory. More...
 
static void configure_event (void)
 Configure EVENT to route RTC events to the ADC. More...
 
static void configure_extint_channel (void)
 Config external interrupt. More...
 
static void configure_rtc (void)
 Configure RTC as ADC sample timer. More...
 
static void configure_usart (void)
 Configure usart. More...
 
static void display_menu (void)
 Display menu. More...
 
static void dma_callback (void)
 DMA callback function for transfer complete. More...
 
static void extint_callback (void)
 
static void led_toggle_indication (uint32_t count)
 Toggles LED as an indication. More...
 
int main (void)
 
static void main_clock_select (const enum system_clock_source clock_source)
 Main clock source selection between DFLL and OSC16M. More...
 
static void main_clock_select_dfll (void)
 Setect DFLL as main clock source. More...
 
static void main_clock_select_osc16m (void)
 Setect OSC16M as main clock source. More...
 
static void test_active_mode (const enum system_performance_level performance_level)
 Active mode test case. More...
 
static void test_backup_mode (void)
 BACKUP mode test case. More...
 
static void test_idle_mode (void)
 Idle mode test case. More...
 
static void test_off_mode (void)
 OFF mode test case. More...
 
static void test_standby_mode_dynamic_power_sleepwalking (void)
 STANDBY mode test case:Dynamic Power SleepWalking. More...
 
static void test_standby_mode_static_power_sleepwalking (void)
 STANDBY mode test case: static power sleepwalking. More...
 

Variables

static struct adc_module adc_instance
 Support and FAQ: visit Microchip Support More...
 
static struct events_resource event
 
struct dma_resource example_resource
 
static struct rtc_module rtc_instance
 
DmacDescriptor example_descriptor SECTION_DMAC_DESCRIPTOR
 
static struct usart_module usart_instance
 

#define _SYSTEM_MCU_REVISION_B   1
#define BUFFER_LEN   10
#define LED0_TOGGLE_TIME   200

Referenced by led_toggle_indication().

LED0 toggles times.

Enumerator
LED0_TOGGLE_2 
LED0_TOGGLE_4 
LED0_TOGGLE_6 
LED0_TOGGLE_8 

static void display_menu ( void  )
static

Display menu.

Referenced by main().

static void dma_callback ( void  )
static

DMA callback function for transfer complete.

Referenced by configure_dma().

static void extint_callback ( void  )
static
static void led_toggle_indication ( uint32_t  count)
static
static void main_clock_select ( const enum system_clock_source  clock_source)
static
static void test_off_mode ( void  )
static

OFF mode test case.

References system_set_sleepmode(), system_sleep(), and SYSTEM_SLEEPMODE_OFF.

Referenced by main().

struct adc_module adc_instance
static

Support and FAQ: visit Microchip Support

Referenced by configure_adc(), and configure_dma().

struct events_resource event
static

Referenced by configure_event().

struct rtc_module rtc_instance
static

Referenced by configure_rtc().

uint16_t adc_rslt [BUFFER_LEN] SECTION_DMAC_DESCRIPTOR