MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
ANACTRL: Analog Control Driver

ANACTRL function groups

More...

Overview

Function groups

The ANACTRL driver supports initialization/configuration/operation for optimization/customization purpose.

Initialization and deinitialization

This function group is to enable/disable the clock for the ANACTRL module.

Set oscillators

The function ANACTRL_SetFro192M sets the on-chip high-speed Free Running Oscillator. The function ANACTRL_GetDefaultFro192MConfig() gets the default configuration.

The function ANACTRL_SetXo32M sets the 32 MHz Crystal oscillator. The function ANACTRL_GetDefaultXo32MConfig() gets the default configuration.

Measure Frequency

This function measures the target frequency according to the reference frequency.

Interrupt

Provides functions to enable/disable/clear ANACTRL interrupts.

Status

Provides functions to get the ANACTRL status.

Data Structures

struct  anactrl_fro192M_config_t
 Configuration for FRO192M. More...
 
struct  anactrl_xo32M_config_t
 Configuration for XO32M. More...
 

Macros

#define FSL_ANACTRL_DRIVER_VERSION   (MAKE_VERSION(2, 3, 0)) /*!< Version 2.3.0. */`
 ANACTRL driver version. More...
 

Enumerations

enum  _anactrl_interrupt_flags {
  kANACTRL_BodVDDMainFlag = ANACTRL_BOD_DCDC_INT_STATUS_BODVDDMAIN_STATUS_MASK,
  kANACTRL_BodVDDMainInterruptFlag,
  kANACTRL_BodVDDMainPowerFlag = ANACTRL_BOD_DCDC_INT_STATUS_BODVDDMAIN_VAL_MASK,
  kANACTRL_BodCoreFlag = ANACTRL_BOD_DCDC_INT_STATUS_BODCORE_STATUS_MASK,
  kANACTRL_BodCoreInterruptFlag = ANACTRL_BOD_DCDC_INT_STATUS_BODCORE_INT_STATUS_MASK,
  kANACTRL_BodCorePowerFlag = ANACTRL_BOD_DCDC_INT_STATUS_BODCORE_VAL_MASK,
  kANACTRL_DcdcFlag = ANACTRL_BOD_DCDC_INT_STATUS_DCDC_STATUS_MASK,
  kANACTRL_DcdcInterruptFlag = ANACTRL_BOD_DCDC_INT_STATUS_DCDC_INT_STATUS_MASK,
  kANACTRL_DcdcPowerFlag = ANACTRL_BOD_DCDC_INT_STATUS_DCDC_VAL_MASK
}
 ANACTRL interrupt flags. More...
 
enum  _anactrl_interrupt {
  kANACTRL_BodVDDMainInterruptEnable = ANACTRL_BOD_DCDC_INT_CTRL_BODVDDMAIN_INT_ENABLE_MASK,
  kANACTRL_BodCoreInterruptEnable = ANACTRL_BOD_DCDC_INT_CTRL_BODCORE_INT_ENABLE_MASK,
  kANACTRL_DcdcInterruptEnable = ANACTRL_BOD_DCDC_INT_CTRL_DCDC_INT_ENABLE_MASK
}
 ANACTRL interrupt control. More...
 
enum  _anactrl_flags {
  kANACTRL_FlashPowerDownFlag = ANACTRL_ANALOG_CTRL_STATUS_FLASH_PWRDWN_MASK,
  kANACTRL_FlashInitErrorFlag = ANACTRL_ANALOG_CTRL_STATUS_FLASH_INIT_ERROR_MASK
}
 ANACTRL status flags. More...
 
enum  _anactrl_osc_flags {
  kANACTRL_OutputClkValidFlag = ANACTRL_FRO192M_STATUS_CLK_VALID_MASK,
  kANACTRL_CCOThresholdVoltageFlag = ANACTRL_FRO192M_STATUS_ATB_VCTRL_MASK,
  kANACTRL_XO32MOutputReadyFlag = ANACTRL_XO32M_STATUS_XO_READY_MASK << 16U
}
 ANACTRL FRO192M and XO32M status flags. More...
 

Initialization and deinitialization

void ANACTRL_Init (ANACTRL_Type *base)
 Initializes the ANACTRL mode, the module's clock will be enabled by invoking this function. More...
 
void ANACTRL_Deinit (ANACTRL_Type *base)
 De-initializes ANACTRL module, the module's clock will be disabled by invoking this function. More...
 

Set oscillators

void ANACTRL_SetFro192M (ANACTRL_Type *base, const anactrl_fro192M_config_t *config)
 Configs the on-chip high-speed Free Running Oscillator(FRO192M), such as enabling/disabling 12 MHZ clock output and enable/disable 96MHZ clock output. More...
 
void ANACTRL_GetDefaultFro192MConfig (anactrl_fro192M_config_t *config)
 Gets the default configuration of FRO192M. More...
 
void ANACTRL_SetXo32M (ANACTRL_Type *base, const anactrl_xo32M_config_t *config)
 Configs the 32 MHz Crystal oscillator(High-speed crystal oscillator), such as enable/disable output to CPU system, and so on. More...
 
void ANACTRL_GetDefaultXo32MConfig (anactrl_xo32M_config_t *config)
 Gets the default configuration of XO32M. More...
 

Interrupt Interface

static void ANACTRL_EnableInterrupts (ANACTRL_Type *base, uint32_t mask)
 Enables the ANACTRL interrupts. More...
 
static void ANACTRL_DisableInterrupts (ANACTRL_Type *base, uint32_t mask)
 Disables the ANACTRL interrupts. More...
 
static void ANACTRL_ClearInterrupts (ANACTRL_Type *base, uint32_t mask)
 Clears the ANACTRL interrupts. More...
 

Status Interface

static uint32_t ANACTRL_GetStatusFlags (ANACTRL_Type *base)
 Gets ANACTRL status flags. More...
 
static uint32_t ANACTRL_GetOscStatusFlags (ANACTRL_Type *base)
 Gets ANACTRL oscillators status flags. More...
 
static uint32_t ANACTRL_GetInterruptStatusFlags (ANACTRL_Type *base)
 Gets ANACTRL interrupt status flags. More...
 

Data Structure Documentation

struct anactrl_fro192M_config_t

This structure holds the configuration settings for the on-chip high-speed Free Running Oscillator. To initialize this structure to reasonable defaults, call the ANACTRL_GetDefaultFro192MConfig() function and pass a pointer to your config structure instance.

Data Fields

bool enable12MHzClk
 Enable 12MHz clock. More...
 
bool enable96MHzClk
 Enable 96MHz clock. More...
 

Field Documentation

bool anactrl_fro192M_config_t::enable12MHzClk
bool anactrl_fro192M_config_t::enable96MHzClk
struct anactrl_xo32M_config_t

This structure holds the configuration settings for the 32 MHz crystal oscillator. To initialize this structure to reasonable defaults, call the ANACTRL_GetDefaultXo32MConfig() function and pass a pointer to your config structure instance.

Data Fields

bool enableACBufferBypass
 Enable XO AC buffer bypass in pll and top level. More...
 
bool enableSysCLkOutput
 Enable XO 32 MHz output to CPU system, SCT, and CLKOUT.
 
bool enableADCOutput
 Enable High speed crystal oscillator output to ADC. More...
 

Field Documentation

bool anactrl_xo32M_config_t::enableACBufferBypass
bool anactrl_xo32M_config_t::enableADCOutput

Macro Definition Documentation

#define FSL_ANACTRL_DRIVER_VERSION   (MAKE_VERSION(2, 3, 0)) /*!< Version 2.3.0. */`

Enumeration Type Documentation

Enumerator
kANACTRL_BodVDDMainFlag 

BOD VDDMAIN Interrupt status before Interrupt Enable.

kANACTRL_BodVDDMainInterruptFlag 

BOD VDDMAIN Interrupt status after Interrupt Enable.

kANACTRL_BodVDDMainPowerFlag 

Current value of BOD VDDMAIN power status output.

kANACTRL_BodCoreFlag 

BOD CORE Interrupt status before Interrupt Enable.

kANACTRL_BodCoreInterruptFlag 

BOD CORE Interrupt status after Interrupt Enable.

kANACTRL_BodCorePowerFlag 

Current value of BOD CORE power status output.

kANACTRL_DcdcFlag 

DCDC Interrupt status before Interrupt Enable.

kANACTRL_DcdcInterruptFlag 

DCDC Interrupt status after Interrupt Enable.

kANACTRL_DcdcPowerFlag 

Current value of DCDC power status output.

Enumerator
kANACTRL_BodVDDMainInterruptEnable 

BOD VDDMAIN interrupt control.

kANACTRL_BodCoreInterruptEnable 

BOD CORE interrupt control.

kANACTRL_DcdcInterruptEnable 

DCDC interrupt control.

Enumerator
kANACTRL_FlashPowerDownFlag 

Flash power-down status.

kANACTRL_FlashInitErrorFlag 

Flash initialization error status.

Enumerator
kANACTRL_OutputClkValidFlag 

Output clock valid signal.

kANACTRL_CCOThresholdVoltageFlag 

CCO threshold voltage detector output (signal vcco_ok).

kANACTRL_XO32MOutputReadyFlag 

Indicates XO out frequency statibilty.

Function Documentation

void ANACTRL_Init ( ANACTRL_Type *  base)
Parameters
baseANACTRL peripheral base address.
void ANACTRL_Deinit ( ANACTRL_Type *  base)
Parameters
baseANACTRL peripheral base address.
void ANACTRL_SetFro192M ( ANACTRL_Type *  base,
const anactrl_fro192M_config_t config 
)
Parameters
baseANACTRL peripheral base address.
configPointer to FRO192M configuration structure. Refer to anactrl_fro192M_config_t structure.
void ANACTRL_GetDefaultFro192MConfig ( anactrl_fro192M_config_t config)

The default values are:

config->enable12MHzClk = true;
config->enable96MHzClk = false;
Parameters
configPointer to FRO192M configuration structure. Refer to anactrl_fro192M_config_t structure.
void ANACTRL_SetXo32M ( ANACTRL_Type *  base,
const anactrl_xo32M_config_t config 
)
Parameters
baseANACTRL peripheral base address.
configPointer to XO32M configuration structure. Refer to anactrl_xo32M_config_t structure.
void ANACTRL_GetDefaultXo32MConfig ( anactrl_xo32M_config_t config)

The default values are:

config->enableSysCLkOutput = false;
config->enableACBufferBypass = false;
Parameters
configPointer to XO32M configuration structure. Refer to anactrl_xo32M_config_t structure.
static void ANACTRL_EnableInterrupts ( ANACTRL_Type *  base,
uint32_t  mask 
)
inlinestatic
Parameters
baseANACTRL peripheral base address.
maskThe interrupt mask. Refer to "_anactrl_interrupt" enumeration.
static void ANACTRL_DisableInterrupts ( ANACTRL_Type *  base,
uint32_t  mask 
)
inlinestatic
Parameters
baseANACTRL peripheral base address.
maskThe interrupt mask. Refer to "_anactrl_interrupt" enumeration.
static void ANACTRL_ClearInterrupts ( ANACTRL_Type *  base,
uint32_t  mask 
)
inlinestatic
Parameters
baseANACTRL peripheral base address.
maskThe interrupt mask. Refer to "_anactrl_interrupt" enumeration.
static uint32_t ANACTRL_GetStatusFlags ( ANACTRL_Type *  base)
inlinestatic

This function gets Analog control status flags. The flags are returned as the logical OR value of the enumerators _anactrl_flags. To check for a specific status, compare the return value with enumerators in the _anactrl_flags. For example, to check whether the flash is in power down mode:

* if (kANACTRL_FlashPowerDownFlag & ANACTRL_ANACTRL_GetStatusFlags(ANACTRL))
* {
* ...
* }
*
Parameters
baseANACTRL peripheral base address.
Returns
ANACTRL status flags which are given in the enumerators in the _anactrl_flags.
static uint32_t ANACTRL_GetOscStatusFlags ( ANACTRL_Type *  base)
inlinestatic

This function gets Anactrl oscillators status flags. The flags are returned as the logical OR value of the enumerators _anactrl_osc_flags. To check for a specific status, compare the return value with enumerators in the _anactrl_osc_flags. For example, to check whether the FRO192M clock output is valid:

* if (kANACTRL_OutputClkValidFlag & ANACTRL_ANACTRL_GetOscStatusFlags(ANACTRL))
* {
* ...
* }
*
Parameters
baseANACTRL peripheral base address.
Returns
ANACTRL oscillators status flags which are given in the enumerators in the _anactrl_osc_flags.
static uint32_t ANACTRL_GetInterruptStatusFlags ( ANACTRL_Type *  base)
inlinestatic

This function gets Anactrl interrupt status flags. The flags are returned as the logical OR value of the enumerators _anactrl_interrupt_flags. To check for a specific status, compare the return value with enumerators in the _anactrl_interrupt_flags. For example, to check whether the VBAT voltage level is above the threshold:

* if (kANACTRL_BodVbatPowerFlag & ANACTRL_ANACTRL_GetInterruptStatusFlags(ANACTRL))
* {
* ...
* }
*
Parameters
baseANACTRL peripheral base address.
Returns
ANACTRL oscillators status flags which are given in the enumerators in the _anactrl_osc_flags.