Microchip® Advanced Software Framework

power.h File Reference

SAM C2x Power functionality.

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

#include <compiler.h>

Data Structures

struct  system_standby_config
 Standby configuration. More...
 
struct  system_voltage_references_config
 Voltage References System (VREF) Control configuration. More...
 
struct  system_voltage_regulator_config
 Voltage Regulator System (VREG) Control configuration. More...
 

Enumerations

enum  system_sleepmode {
  SYSTEM_SLEEPMODE_IDLE_0 = PM_SLEEPCFG_SLEEPMODE(0),
  SYSTEM_SLEEPMODE_IDLE_1 = PM_SLEEPCFG_SLEEPMODE(0x1),
  SYSTEM_SLEEPMODE_IDLE_2 = PM_SLEEPCFG_SLEEPMODE(0x2),
  SYSTEM_SLEEPMODE_STANDBY = PM_SLEEPCFG_SLEEPMODE(0x4)
}
 Device sleep modes. More...
 
enum  system_voltage_reference {
  SYSTEM_VOLTAGE_REFERENCE_TEMPSENSE,
  SYSTEM_VOLTAGE_REFERENCE_OUTPUT
}
 Voltage reference. More...
 
enum  system_voltage_references_sel {
  SYSTEM_VOLTAGE_REFERENCE_1V024 = SUPC_VREF_SEL_1V024_Val,
  SYSTEM_VOLTAGE_REFERENCE_2V048 = SUPC_VREF_SEL_2V048_Val,
  SYSTEM_VOLTAGE_REFERENCE_4V096 = SUPC_VREF_SEL_4V096_Val
}
 Voltage reference value for ADC/DAC. More...
 
enum  system_vreg_switch_mode {
  SYSTEM_VREG_SWITCH_AUTO = PM_STDBYCFG_VREGSMOD_AUTO_Val,
  SYSTEM_VREG_SWITCH_PERFORMANCE = PM_STDBYCFG_VREGSMOD_PERFORMANCE_Val,
  SYSTEM_VREG_SWITCH_LP = PM_STDBYCFG_VREGSMOD_LP_Val
}
 Voltage Regulator switch in Standby mode. More...
 

Functions

Voltage Regulator
static void system_voltage_regulator_get_config_defaults (struct system_voltage_regulator_config *const config)
 Retrieve the default configuration for voltage regulator. More...
 
static void system_voltage_regulator_set_config (struct system_voltage_regulator_config *const config)
 Configure voltage regulator. More...
 
static void system_voltage_regulator_enable (void)
 Enable the selected voltage regulator. More...
 
static void system_voltage_regulator_disable (void)
 Disable the selected voltage regulator. More...
 
Voltage References
static void system_voltage_reference_get_config_defaults (struct system_voltage_references_config *const config)
 Retrieve the default configuration for voltage reference. More...
 
static void system_voltage_reference_set_config (struct system_voltage_references_config *const config)
 Configure voltage reference. More...
 
static void system_voltage_reference_enable (const enum system_voltage_reference vref)
 Enable the selected voltage reference. More...
 
static void system_voltage_reference_disable (const enum system_voltage_reference vref)
 Disable the selected voltage reference. More...
 
Device Sleep Control
static void system_set_sleepmode (const enum system_sleepmode sleep_mode)
 Set the sleep mode of the device. More...
 
static void system_sleep (void)
 Put the system to sleep waiting for interrupt. More...
 
Standby Configuration
static void system_standby_get_config_defaults (struct system_standby_config *const config)
 Retrieve the default configuration for standby. More...
 
static void system_standby_set_config (struct system_standby_config *const config)
 Configure standby mode. More...