MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
BOD: Browned Out Detector

Overview

The MCUXpresso SDK provides a peripheral driver for the Browned Out Detector (BOD) module of MCUXpresso SDK devices.

Typical use case

Example use of BOD API.

int main(void)
{
bod_config_t config;
BOARD_InitHardware();
PRINTF("\r\nBOD example.\r\n");
/* Check Reset source(Brown-Down reset source will be set when voltage is less than the user-defined) */
{
PRINTF("Brown-Down reset occurred\r\n");
}
/* Clear reset source */
config.int_thr = kBOD_InterruptThreshold2; /*2.72V*/
config.reset_thr = kBOD_ResetThreshold2; /*2.0V*/
/*Init BOD module*/
BOD_Init(DEMO_BOD_BASE, &config);
NVIC_EnableIRQ(BOD_IRQn);
while (!g_BodIntFlags)
;
PRINTF("\r\nBOD interrupt. Input voltage is lower than 2.72V\r\n");
PRINTF("CPU will be reset when input voltage is lower than 2.0V\r\n");
while (1)
{
}
}

Files

file  fsl_bod.h
 

Data Structures

struct  bod_config_t
 Describes BOD configuration structure. More...
 

Enumerations

enum  bod_interrupt_threshold_t {
  kBOD_InterruptThreshold0 = 0U,
  kBOD_InterruptThreshold1,
  kBOD_InterruptThreshold2,
  kBOD_InterruptThreshold3
}
 BOD interrupt threshold voltages. More...
 
enum  bod_reset_threshold_t {
  kBOD_ResetThreshold0 = 0U,
  kBOD_ResetThreshold1,
  kBOD_ResetThreshold2,
  kBOD_ResetThreshold3
}
 BOD reset threshold voltages. More...
 
enum  bod_mode_t {
  kBOD_InterruptEnable = 1U,
  kBOD_ResetEnable = 2U
}
 

Functions

void BOD_Init (SYSCON_Type *base, const bod_config_t *config)
 Initializes the BOD with configuration. More...
 
void BOD_Deinit (SYSCON_Type *base)
 Disable the BOD module. More...
 
void BOD_Enable (SYSCON_Type *base, uint8_t mode)
 Enable the BOD module. More...
 
void BOD_Disable (SYSCON_Type *base, uint8_t mode)
 Disable the BOD module. More...
 
void BOD_GetDefaultConfig (bod_config_t *config)
 Gets the default configuration structure. More...
 

BOD Driver version

#define FSL_BOD_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))
 BOD driver version.
 

Data Structure Documentation

struct bod_config_t

Enumeration Type Documentation

Enumerator
kBOD_InterruptThreshold0 

trigger at 2.06V

kBOD_InterruptThreshold1 

trigger at 2.45V

kBOD_InterruptThreshold2 

trigger at 2.72V

kBOD_InterruptThreshold3 

trigger at 3.04V

Enumerator
kBOD_ResetThreshold0 

trigger at 1.5V

kBOD_ResetThreshold1 

trigger at 1.85V

kBOD_ResetThreshold2 

trigger at 2.0V

kBOD_ResetThreshold3 

trigger at 3.0V

enum bod_mode_t
Enumerator
kBOD_InterruptEnable 

interrupt enable

kBOD_ResetEnable 

reset enable

Function Documentation

void BOD_Init ( SYSCON_Type *  base,
const bod_config_t config 
)

This function configures the BOD module with the user-defined settings.

Parameters
baseBOD peripheral base address.
configpointer to configuration structure
void BOD_Deinit ( SYSCON_Type *  base)

This function disable the BOD module.

Parameters
baseBOD peripheral base address.
void BOD_Enable ( SYSCON_Type *  base,
uint8_t  mode 
)

This function enable the ACMP module.

Parameters
baseBOD peripheral base address.
modeSpecified the work mode to be enabled.The mode is a logical OR of the enumeration members. see bod_mode_t
void BOD_Disable ( SYSCON_Type *  base,
uint8_t  mode 
)

This function enable the BOD module.

Parameters
baseBOD peripheral base address.
modeSpecified the work mode to be disabled.The mode is a logical OR of the enumeration members. see bod_mode_t
void BOD_GetDefaultConfig ( bod_config_t config)

This function initializes the BOD configuration structure to a default value. The default values are: config->int_thr = kBOD_InterruptThreshold2; config->reset_thr = kBOD_ResetThreshold2;

Parameters
configPointer to configuration structure.