MSPM0H321X Driver Library  2.05.01.00
Modules | Data Structures | Enumerations | Functions
Voltage Reference (VREF)
Collaboration diagram for Voltage Reference (VREF):

Modules

 DL_VREF_CTL1_READY
 
 DL_VREF_SH
 
 DL_VREF_HOLD
 

Data Structures

struct  DL_VREF_ClockConfig
 Configuration struct for DL_VREF_setClockConfig. More...
 
struct  DL_VREF_Config
 Configuration struct for DL_VREF_Config. More...
 

Enumerations

enum  DL_VREF_CLOCK {
  DL_VREF_CLOCK_LFCLK = VREF_CLKSEL_LFCLK_SEL_MASK,
  DL_VREF_CLOCK_MFCLK = VREF_CLKSEL_MFCLK_SEL_MASK,
  DL_VREF_CLOCK_BUSCLK = VREF_CLKSEL_BUSCLK_SEL_MASK
}
 
enum  DL_VREF_CLOCK_DIVIDE {
  DL_VREF_CLOCK_DIVIDE_1 = 0,
  DL_VREF_CLOCK_DIVIDE_2 = 1,
  DL_VREF_CLOCK_DIVIDE_4 = 3,
  DL_VREF_CLOCK_DIVIDE_6 = 5,
  DL_VREF_CLOCK_DIVIDE_8 = 7
}
 
enum  DL_VREF_ENABLE {
  DL_VREF_ENABLE_DISABLE = VREF_CTL0_ENABLE_DISABLE,
  DL_VREF_ENABLE_ENABLE = VREF_CTL0_ENABLE_ENABLE
}
 
enum  DL_VREF_BUFCONFIG {
  DL_VREF_BUFCONFIG_OUTPUT_2_5V = VREF_CTL0_BUFCONFIG_OUTPUT2P5V,
  DL_VREF_BUFCONFIG_OUTPUT_1_4V = VREF_CTL0_BUFCONFIG_OUTPUT1P4V
}
 
enum  DL_VREF_SHMODE {
  DL_VREF_SHMODE_DISABLE = VREF_CTL0_SHMODE_DISABLE,
  DL_VREF_SHMODE_ENABLE = VREF_CTL0_SHMODE_ENABLE
}
 

Functions

__STATIC_INLINE void DL_VREF_enablePower (VREF_Regs *vref)
 Enables the Peripheral Write Enable (PWREN) register for the VREF. More...
 
__STATIC_INLINE void DL_VREF_disablePower (VREF_Regs *vref)
 Disables the Peripheral Write Enable (PWREN) register for the VREF. More...
 
__STATIC_INLINE bool DL_VREF_isPowerEnabled (VREF_Regs *vref)
 Returns if the Peripheral Write Enable (PWREN) register for the VREF is enabled. More...
 
__STATIC_INLINE void DL_VREF_enableInternalRef (VREF_Regs *vref)
 Enables Internal VREF. More...
 
__STATIC_INLINE void DL_VREF_disableInternalRef (VREF_Regs *vref)
 Disables Internal VREF, allows for External VREF. More...
 
__STATIC_INLINE bool DL_VREF_isEnabled (const VREF_Regs *vref)
 Checks if the internal VREF is enabled. More...
 
__STATIC_INLINE void DL_VREF_enableInternalRefCOMP (VREF_Regs *vref)
 Enable VREF buffer as internal reference input for comparator. More...
 
__STATIC_INLINE bool DL_VREF_isInternalRefCOMPEnabled (const VREF_Regs *vref)
 Checks if VREF buffer for comparator is enabled. More...
 
__STATIC_INLINE void DL_VREF_disableInternalRefCOMP (VREF_Regs *vref)
 Disable VREF buffer as internal reference input for comparator. More...
 
void DL_VREF_setClockConfig (VREF_Regs *vref, const DL_VREF_ClockConfig *config)
 Set the clock select and clock divide fields in VREF. More...
 
void DL_VREF_getClockConfig (const VREF_Regs *vref, DL_VREF_ClockConfig *config)
 Copy the clock select and clock divide fields in VREF to config. More...
 
__STATIC_INLINE void DL_VREF_reset (VREF_Regs *vref)
 Resets the VREF module. More...
 
__STATIC_INLINE bool DL_VREF_isReset (const VREF_Regs *vref)
 Returns if VREF peripheral was reset. More...
 
__STATIC_INLINE uint32_t DL_VREF_getStatus (const VREF_Regs *vref)
 Returns VREF register status. More...
 
void DL_VREF_configReference (VREF_Regs *vref, const DL_VREF_Config *config)
 Configure VREF enable, control registers. More...
 

Detailed Description

Overview

The Voltage Reference Driver Library allows full configuration of the MSPM0 VREF module. The VREF module contains a configurable voltage reference buffer which allows users to supply a stable internal reference to on-board analog peripherals. It also supports bringing in an external reference for applications where higher accuracy is required.


Enumeration Type Documentation

§ DL_VREF_CLOCK

Enumerator
DL_VREF_CLOCK_LFCLK 

Set VREF clock source as LFCLK

DL_VREF_CLOCK_MFCLK 

Set VREF clock source as MFCLK

DL_VREF_CLOCK_BUSCLK 

Set VREF clock source as BUSCLK

§ DL_VREF_CLOCK_DIVIDE

Enumerator
DL_VREF_CLOCK_DIVIDE_1 

Clock divide by 1

DL_VREF_CLOCK_DIVIDE_2 

Clock divide by 2

DL_VREF_CLOCK_DIVIDE_4 

Clock divide by 4

DL_VREF_CLOCK_DIVIDE_6 

Clock divide by 6

DL_VREF_CLOCK_DIVIDE_8 

Clock divide by 8

§ DL_VREF_ENABLE

Enumerator
DL_VREF_ENABLE_DISABLE 

VREF control set disabled

DL_VREF_ENABLE_ENABLE 

VREF control set enabled

§ DL_VREF_BUFCONFIG

Enumerator
DL_VREF_BUFCONFIG_OUTPUT_2_5V 

Configure VREF output buffer to 2.5V

DL_VREF_BUFCONFIG_OUTPUT_1_4V 

Configure VREF output buffer to 1.4V

§ DL_VREF_SHMODE

Enumerator
DL_VREF_SHMODE_DISABLE 

Set VREF sample and hold mode to disabled

DL_VREF_SHMODE_ENABLE 

Set VREF sample and hold mode to enabled

Function Documentation

§ DL_VREF_enablePower()

__STATIC_INLINE void DL_VREF_enablePower ( VREF_Regs *  vref)

Enables the Peripheral Write Enable (PWREN) register for the VREF.

Before any peripheral registers can be configured by software, the peripheral itself must be enabled by writing the ENABLE bit together with the appropriate KEY value to the peripheral's PWREN register.

Note
For power savings, please refer to DL_VREF_enableInternalRef
Parameters
vrefPointer to the register overlay for the peripheral

§ DL_VREF_disablePower()

__STATIC_INLINE void DL_VREF_disablePower ( VREF_Regs *  vref)

Disables the Peripheral Write Enable (PWREN) register for the VREF.

When the PWREN.ENABLE bit is cleared, the peripheral's registers are not accessible for read/write operations.

Note
This API does not provide large power savings. For power savings, please refer to DL_VREF_disableInternalRef
Parameters
vrefPointer to the register overlay for the peripheral

§ DL_VREF_isPowerEnabled()

__STATIC_INLINE bool DL_VREF_isPowerEnabled ( VREF_Regs *  vref)

Returns if the Peripheral Write Enable (PWREN) register for the VREF is enabled.

Before any peripheral registers can be configured by software, the peripheral itself must be enabled by writing the ENABLE bit together with the appropriate KEY value to the peripheral's PWREN register.

When the PWREN.ENABLE bit is cleared, the peripheral's registers are not accessible for read/write operations.

Parameters
vrefPointer to the register overlay for the peripheral
Returns
true if peripheral register access is enabled
false if peripheral register access is disabled

§ DL_VREF_enableInternalRef()

__STATIC_INLINE void DL_VREF_enableInternalRef ( VREF_Regs *  vref)

Enables Internal VREF.

This function only enables the internal VREF but doesn't configure all settings. It's recommended to use DL_VREF_configReference to configure and enable VREF with all parameters.

Parameters
vrefPointer to the register overlay for the peripheral

§ DL_VREF_disableInternalRef()

__STATIC_INLINE void DL_VREF_disableInternalRef ( VREF_Regs *  vref)

Disables Internal VREF, allows for External VREF.

The internal VREF must be disabled when using external VREF input.

Parameters
vrefPointer to the register overlay for the peripheral

§ DL_VREF_isEnabled()

__STATIC_INLINE bool DL_VREF_isEnabled ( const VREF_Regs *  vref)

Checks if the internal VREF is enabled.

Parameters
vrefPointer to the register overlay for the peripheral
Returns
Returns the enabled status of the vref peripheral
Return values
trueThe internal VREF is enabled
falseThe internal VREF is disabled, external VREF can be used

§ DL_VREF_enableInternalRefCOMP()

__STATIC_INLINE void DL_VREF_enableInternalRefCOMP ( VREF_Regs *  vref)

Enable VREF buffer as internal reference input for comparator.

Parameters
vrefPointer to the register overlay for the peripheral

§ DL_VREF_isInternalRefCOMPEnabled()

__STATIC_INLINE bool DL_VREF_isInternalRefCOMPEnabled ( const VREF_Regs *  vref)

Checks if VREF buffer for comparator is enabled.

Parameters
vrefPointer to the register overlay for the peripheral
Returns
Returns if VREF buffer for comparator is enabled
Return values
trueVREF buffer for comparator is enabled
falseVREF buffer for comparator is disabled

§ DL_VREF_disableInternalRefCOMP()

__STATIC_INLINE void DL_VREF_disableInternalRefCOMP ( VREF_Regs *  vref)

Disable VREF buffer as internal reference input for comparator.

Parameters
vrefPointer to the register overlay for the peripheral

References DL_VREF_getClockConfig(), and DL_VREF_setClockConfig().

§ DL_VREF_setClockConfig()

void DL_VREF_setClockConfig ( VREF_Regs *  vref,
const DL_VREF_ClockConfig config 
)

Set the clock select and clock divide fields in VREF.

Parameters
vrefPointer to the register overlay for the peripheral
configPointer to the configuration structure

Referenced by DL_VREF_disableInternalRefCOMP().

§ DL_VREF_getClockConfig()

void DL_VREF_getClockConfig ( const VREF_Regs *  vref,
DL_VREF_ClockConfig config 
)

Copy the clock select and clock divide fields in VREF to config.

Parameters
vrefPointer to the register overlay for the peripheral
configPointer to the configuration structure

Referenced by DL_VREF_disableInternalRefCOMP().

§ DL_VREF_reset()

__STATIC_INLINE void DL_VREF_reset ( VREF_Regs *  vref)

Resets the VREF module.

Parameters
vrefPointer to the register overlay for the peripheral

§ DL_VREF_isReset()

__STATIC_INLINE bool DL_VREF_isReset ( const VREF_Regs *  vref)

Returns if VREF peripheral was reset.

Parameters
vrefPointer to the register overlay for the VREF peripheral
Returns
true if peripheral was reset
false if peripheral wasn't reset

§ DL_VREF_getStatus()

__STATIC_INLINE uint32_t DL_VREF_getStatus ( const VREF_Regs *  vref)

Returns VREF register status.

Parameters
vrefPointer to the register overlay for the VREF peripheral
Returns
VREF status bits set. Either DL_VREF_CTL1_READY_NOTRDY or DL_VREF_CTL1_READY_RDY

References DL_VREF_configReference().

§ DL_VREF_configReference()

void DL_VREF_configReference ( VREF_Regs *  vref,
const DL_VREF_Config config 
)

Configure VREF enable, control registers.

Parameters
vrefPointer to the register overlay for the VREF peripheral
configPointer to DL_VREF_Config structure to configure the peripheral

Referenced by DL_VREF_getStatus().

© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale