Microchip® Advanced Software Framework

bod_feature.h File Reference

SAM Brown Out Detector Driver.

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

Data Structures

struct  bodvdd_config
 Configuration structure for a BODVDD module. More...
 

Enumerations

enum  bodvdd_action {
  BODVDD_ACTION_NONE = SUPC_BODVDD_ACTION(0),
  BODVDD_ACTION_RESET = SUPC_BODVDD_ACTION(1),
  BODVDD_ACTION_INTERRUPT = SUPC_BODVDD_ACTION(2),
  BODVDD_ACTION_BACKUP = SUPC_BODVDD_ACTION(3)
}
 Brown Out Detector detection actions. More...
 
enum  bodvdd_mode_in_active {
  BODVDD_ACTCFG_CONTINUOUS = 0,
  BODVDD_ACTCFG_SAMPLED = SUPC_BODVDD_ACTCFG
}
 Brown Out Detector sampling modes in active sleep mode. More...
 
enum  bodvdd_mode_in_standby {
  BODVDD_STDBYCFG_CONTINUOUS = 0,
  BODVDD_STDBYCFG_SAMPLED = SUPC_BODVDD_STDBYCFG
}
 Brown Out Detector sampling modes in standby sleep mode. More...
 
enum  bodvdd_prescale {
  BODVDD_PRESCALE_DIV_2 = SUPC_BODVDD_PSEL(0),
  BODVDD_PRESCALE_DIV_4 = SUPC_BODVDD_PSEL(1),
  BODVDD_PRESCALE_DIV_8 = SUPC_BODVDD_PSEL(2),
  BODVDD_PRESCALE_DIV_16 = SUPC_BODVDD_PSEL(3),
  BODVDD_PRESCALE_DIV_32 = SUPC_BODVDD_PSEL(4),
  BODVDD_PRESCALE_DIV_64 = SUPC_BODVDD_PSEL(5),
  BODVDD_PRESCALE_DIV_128 = SUPC_BODVDD_PSEL(6),
  BODVDD_PRESCALE_DIV_256 = SUPC_BODVDD_PSEL(7),
  BODVDD_PRESCALE_DIV_512 = SUPC_BODVDD_PSEL(8),
  BODVDD_PRESCALE_DIV_1024 = SUPC_BODVDD_PSEL(9),
  BODVDD_PRESCALE_DIV_2048 = SUPC_BODVDD_PSEL(10),
  BODVDD_PRESCALE_DIV_4096 = SUPC_BODVDD_PSEL(11),
  BODVDD_PRESCALE_DIV_8192 = SUPC_BODVDD_PSEL(12),
  BODVDD_PRESCALE_DIV_16384 = SUPC_BODVDD_PSEL(13),
  BODVDD_PRESCALE_DIV_32768 = SUPC_BODVDD_PSEL(14),
  BODVDD_PRESCALE_DIV_65536 = SUPC_BODVDD_PSEL(15)
}
 Brown Out Detector input clock prescale values. More...
 

Functions

Configuration and Initialization
static void bodvdd_get_config_defaults (struct bodvdd_config *const conf)
 Get default BODVDD configuration. More...
 
enum status_code bodvdd_set_config (struct bodvdd_config *const conf)
 Configure a Brown Out Detector module. More...
 
static enum status_code bodvdd_enable (void)
 Enables a configured BODVDD module. More...
 
static enum status_code bodvdd_disable (void)
 Disables an enabled BODVDD module. More...
 
static bool bodvdd_is_detected (void)
 Checks if the BODVDD low voltage detection has occurred. More...
 
static void bodvdd_clear_detected (void)
 Clears the low voltage detection state of the BODVDD. More...