Kinetis SDK v.1.3 API Reference Manual  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
VREF HAL Driver

Overview

This section describes the programming interface of the VREF HAL driver.

Files

file  fsl_vref_hal.h
 

Data Structures

struct  vref_user_config_t
 The description structure for the VREF module. More...
 

Enumerations

enum  vref_status_t {
  kStatus_VREF_Success = 0x0U,
  kStatus_VREF_InvalidArgument = 0x1U,
  kStatus_VREF_Failed = 0x2U
}
 

Definitions More...

 
enum  vref_buffer_mode_t {
  kVrefModeBandgapOnly = 0x0U,
  kVrefModeTightRegulationBuffer = 0x2U
}
 VREF modes. More...
 

VREF related feature APIs


API

void VREF_HAL_Init (VREF_Type *base)
 Initialize VREF module to default state. More...
 
void VREF_HAL_Configure (VREF_Type *base, const vref_user_config_t *userConfigPtr)
 Configure VREF module to known state. More...
 
static void VREF_HAL_Enable (VREF_Type *base)
 Enable VREF module. More...
 
static void VREF_HAL_Disable (VREF_Type *base)
 Disable VREF module. More...
 
static void VREF_HAL_SetInternalRegulatorCmd (VREF_Type *base, bool enable)
 Set VREF internal regulator to Enable. More...
 
static void VREF_HAL_SetTrimVal (VREF_Type *base, uint8_t trimValue)
 Set trim value for voltage reference. More...
 
static uint8_t VREF_HAL_GetTrimVal (VREF_Type *base)
 Read value of trim meaning output voltage. More...
 
static void VREF_HAL_WaitVoltageStable (VREF_Type *base)
 Wait to internal voltage stable. More...
 
static void VREF_HAL_SetBufferMode (VREF_Type *base, vref_buffer_mode_t mode)
 Set buffer mode. More...
 

Data Structure Documentation

struct vref_user_config_t

Data Fields

uint8_t trimValue
 Trim bits.
 
bool regulatorEnable
 Enable regulator.
 
vref_buffer_mode_t bufferMode
 Buffer mode selection.
 

Enumeration Type Documentation

VREF status return codes

Enumerator
kStatus_VREF_Success 

Success.

kStatus_VREF_InvalidArgument 

Invalid argument existed.

kStatus_VREF_Failed 

Execution failed.

Enumerator
kVrefModeBandgapOnly 

Bandgap on only.

For stabilization and startup

kVrefModeTightRegulationBuffer 

Tight regulation buffer enabled.

Function Documentation

void VREF_HAL_Init ( VREF_Type *  base)
Parameters
baseVREF module base number.
void VREF_HAL_Configure ( VREF_Type *  base,
const vref_user_config_t userConfigPtr 
)
Parameters
baseVREF module base number.
userConfigPtrPointer to the initialization structure. See the "vref_user_config_t".
static void VREF_HAL_Enable ( VREF_Type *  base)
inlinestatic
Parameters
baseVREF module base number.
static void VREF_HAL_Disable ( VREF_Type *  base)
inlinestatic
Parameters
baseVREF module base number.
static void VREF_HAL_SetInternalRegulatorCmd ( VREF_Type *  base,
bool  enable 
)
inlinestatic

Cannot be enabled in very low-power modes!

Parameters
baseVREF module base number.
enableEnables or disables internal regulator
  • true : Internal regulator enable
  • false: Internal regulator disable
static void VREF_HAL_SetTrimVal ( VREF_Type *  base,
uint8_t  trimValue 
)
inlinestatic
Parameters
baseVREF module base number.
trimValueValue of trim register to set output reference voltage (max 0x3F (6-bit)).
static uint8_t VREF_HAL_GetTrimVal ( VREF_Type *  base)
inlinestatic
Parameters
baseVREF module base number.
Returns
Six-bit value of trim setting.
static void VREF_HAL_WaitVoltageStable ( VREF_Type *  base)
inlinestatic
Parameters
baseVREF module base number.
static void VREF_HAL_SetBufferMode ( VREF_Type *  base,
vref_buffer_mode_t  mode 
)
inlinestatic
Parameters
baseVREF module base number.
modeDefines mode to be set.
  • kVrefModeBandgapOnly : Set Bandgap on only
  • kVrefModeHighPowerBuffer : Set High power buffer mode
  • kVrefModeLowPowerBuffer : Set Low power buffer mode
  • kVrefModeTightRegulationBuffer: Set Tight regulation buffer mode