MSP430 DriverLib for MSP430FR5xx_6xx Devices  2.21.00.08
 All Data Structures Functions Variables Modules Pages
Esi_api

Functions

uint16_t ESI_getCounter0 (void)
 
uint16_t ESI_getCounter1 (void)
 
uint16_t ESI_getCounter2 (void)
 
uint16_t ESI_getOscCounter (void)
 
void ESI_AFE1_init (ESI_AFE1_InitParams *params)
 
void ESI_AFE2_init (ESI_AFE2_InitParams *params)
 
uint16_t ESI_getLatchedComparatorOutput (uint16_t channelSelect)
 
void ESI_TSM_init (ESI_TSM_InitParams *params)
 
void ESI_TSM_clearTable (void)
 
void ESI_TSM_copyTable (uint16_t *tsmTable, uint16_t size)
 
void ESI_TSM_softwareTrigger (void)
 
uint8_t ESI_TSM_getTSMStateDuration (uint8_t stateRegNum)
 
void ESI_TSM_setTSMStateDuration (uint8_t stateRegNum, uint8_t duration)
 
void ESI_PSM_init (ESI_PSM_InitParams *params)
 Initialize Processing State Machine. More...
 
void ESI_PSM_clearTable (void)
 
void ESI_PSM_copyTable (uint8_t *psmTable, uint8_t size)
 
void ESI_PSM_resetCounter (uint16_t counterToReset)
 
void ESI_enableInternalOscillator (void)
 
void ESI_disableInternalOscillator (void)
 
void ESI_timerAInputSelect (uint16_t select)
 
void ESI_psmSourceSelect (uint16_t sourceNum, uint16_t sourceSelect)
 
void ESI_testChannel0SourceSelect (uint16_t sourceSelect)
 
void ESI_testChannel1SourceSelect (uint16_t sourceSelect)
 
void ESI_enable (void)
 
void ESI_disable (void)
 
void ESI_startInternalOscCal (void)
 
void ESI_adjustInternalOscFreq (uint16_t incOrDec)
 
void ESI_setNominalInternalOscFreq (void)
 
uint8_t ESI_getESICLKFQ (void)
 The following function returns the ESICLKFQx bits on ESIOSC register. More...
 
void ESI_setESICLKFQ (uint8_t setting)
 The following function sets ESICLKFQx bits on ESIOSC register. More...
 
void ESI_calibrateInternalOscFreq (uint16_t targetAclkCounts)
 
uint16_t ESI_measureESIOSC (uint8_t oversample)
 
void ESI_setPSMCounter1UpperThreshold (uint16_t threshold)
 
void ESI_setPSMCounter1LowerThreshold (uint16_t threshold)
 
void ESI_setAFE1DACValue (uint16_t dacValue, uint8_t dacRegNum)
 
uint16_t ESI_getAFE1DACValue (uint8_t dacRegNum)
 
void ESI_setAFE2DACValue (uint16_t dacValue, uint8_t dacRegNum)
 
uint16_t ESI_getAFE2DACValue (uint8_t dacRegNum)
 
void ESI_setTSMstateReg (ESI_TSM_StateParams *params, uint8_t stateRegNum)
 
uint16_t ESI_getInterruptVectorRegister (void)
 
void ESI_enableInterrupt (uint16_t interruptMask)
 
void ESI_disableInterrupt (uint16_t interruptMask)
 
uint16_t ESI_getInterruptStatus (uint16_t interruptMask)
 
void ESI_clearInterrupt (uint16_t interruptMask)
 
void ESI_setIFG0Source (uint16_t ifg0Src)
 
void ESI_setIFG8Source (uint16_t ifg8Src)
 
void ESI_setIFG7Source (uint16_t ifg7Src)
 
void ESI_setIFG4Source (uint16_t ifg4Src)
 
void ESI_LC_DAC_calibration (uint8_t selected_channel)
 

Variables

const ESI_AFE1_InitParams ESI_AFE1_INITPARAMS_DEFAULT
 
const ESI_AFE2_InitParams ESI_AFE2_INITPARAMS_DEFAULT
 
const ESI_TSM_InitParams ESI_TSM_INITPARAMS_DEFAULT
 
const ESI_PSM_InitParams ESI_PSM_INITPARAMS_DEFAULT
 

Detailed Description

Function Documentation

void ESI_adjustInternalOscFreq ( uint16_t  incOrDec)

Adjusts frequency ESI internal Oscillator

This function adjusts frequency ESI internal Oscillator. It increases or decrease the freq by 3% based on incOrDec value.

Returns
None

Referenced by ESI_calibrateInternalOscFreq().

void ESI_AFE1_init ( ESI_AFE1_InitParams params)

Initializes the ESI analog front end AFE1

Parameters
paramsis ESI_AFE1_InitParams struct

This functions initializes the ESI analog front end AFE1.

Returns
None
void ESI_AFE2_init ( ESI_AFE2_InitParams params)

Initializes the ESI analog front end - AFE2

Parameters
paramsis ESI_AFE2_InitParams struct

This functions initializes the ESI analog front end AFE2

Returns
None
void ESI_calibrateInternalOscFreq ( uint16_t  targetAclkCounts)

Calibrate ESI internal Oscillator

Returns
None

References ESI_adjustInternalOscFreq(), ESI_measureESIOSC(), and ESI_setNominalInternalOscFreq().

void ESI_clearInterrupt ( uint16_t  interruptMask)

Clear ESI interrupt flag

Parameters
interruptMaskis the masked interrupt flag status to be returned. Mask value is the logical OR of any of the following:
  • ESI_INTERRUPT_FLAG_AFE1_ESIOUTX
  • ESI_INTERRUPT_FLAG_ESISTOP
  • ESI_INTERRUPT_FLAG_ESISTART
  • ESI_INTERRUPT_FLAG_ESICNT1
  • ESI_INTERRUPT_FLAG_ESICNT2
  • ESI_INTERRUPT_FLAG_Q6_BIT_SET
  • ESI_INTERRUPT_FLAG_Q7_BIT_SET
  • ESI_INTERRUPT_FLAG_ESICNT0_COUNT_INTERVAL
  • ESI_INTERRUPT_FLAG_AFE2_ESIOUTX
Returns
None
void ESI_disable ( void  )

Disable ESI peripheral

Returns
None
void ESI_disableInternalOscillator ( void  )

Disables the internal Oscillator

This function disables the high frequency internal oscillator

Returns
None
void ESI_disableInterrupt ( uint16_t  interruptMask)

Disables ESI interrupts

Parameters
interruptMaskis the bit mask of the interrupt sources to be disabled. Mask value is the logical OR of any of the following: ESI_INTERRUPT_AFE1_ESIOUTX ESI_INTERRUPT_ESISTOP ESI_INTERRUPT_ESISTART ESI_INTERRUPT_ESICNT1 ESI_INTERRUPT_ESICNT2 ESI_INTERRUPT_Q6_BIT_SET ESI_INTERRUPT_Q7_BIT_SET ESI_INTERRUPT_ESICNT0_COUNT_INTERVAL ESI_INTERRUPT_AFE2_ESIOUTX

Modified bits of ESIINT1 register.

Returns
None
void ESI_enable ( void  )

Enable ESI peripheral

Returns
None
void ESI_enableInternalOscillator ( void  )

Enables the internal Oscillator

This function enables the high frequency internal oscillator

Returns
None
void ESI_enableInterrupt ( uint16_t  interruptMask)

Enables ESI interrupts

Parameters
interruptMaskis the bit mask of the interrupt sources to be enabled. Mask value is the logical OR of any of the following: ESI_INTERRUPT_AFE1_ESIOUTX ESI_INTERRUPT_ESISTOP ESI_INTERRUPT_ESISTART ESI_INTERRUPT_ESICNT1 ESI_INTERRUPT_ESICNT2 ESI_INTERRUPT_Q6_BIT_SET ESI_INTERRUPT_Q7_BIT_SET ESI_INTERRUPT_ESICNT0_COUNT_INTERVAL ESI_INTERRUPT_AFE2_ESIOUTX

Modified bits of ESIINT1 register.

Returns
None
uint16_t ESI_getAFE1DACValue ( uint8_t  dacRegNum)

gets AFE1 DAC threshold Value

Parameters
dacValueis value to be written to DAC register.
dacRegNumis DAC register number

Read DAC threshold value into selected DAC register

Returns
DAC value from selected DAC register.

Referenced by ESI_LC_DAC_calibration().

uint16_t ESI_getAFE2DACValue ( uint8_t  dacRegNum)

gets AFE2 DAC threshold Value

Parameters
dacValueis value to be written to DAC register.
dacRegNumis DAC register number

Read DAC threshold value into selected DAC register

Returns
DAC value from selected DAC register.
uint16_t ESI_getCounter0 ( void  )

Get ESI PSM Counter 0 Value

This function reads the ESI Counter 0 register

Returns
Counter value
uint16_t ESI_getCounter1 ( void  )

Get ESI PSM Counter 1 Value

This function reads the ESI Counter1 register

Returns
Counter value
uint16_t ESI_getCounter2 ( void  )

Get ESI PSM Counter 2 Value

This function reads the ESI Counter2 register

Returns
Counter value
uint8_t ESI_getESICLKFQ ( void  )

The following function returns the ESICLKFQx bits on ESIOSC register.

Parameters
none
Returns
ESICLKFQ bits only
uint16_t ESI_getInterruptStatus ( uint16_t  interruptMask)

Get ESI interrupt status

Parameters
interruptMaskis the masked interrupt flag status to be returned. Mask value is the logical OR of any of the following:
  • ESI_INTERRUPT_FLAG_AFE1_ESIOUTX
  • ESI_INTERRUPT_FLAG_ESISTOP
  • ESI_INTERRUPT_FLAG_ESISTART
  • ESI_INTERRUPT_FLAG_ESICNT1
  • ESI_INTERRUPT_FLAG_ESICNT2
  • ESI_INTERRUPT_FLAG_Q6_BIT_SET
  • ESI_INTERRUPT_FLAG_Q7_BIT_SET
  • ESI_INTERRUPT_FLAG_ESICNT0_COUNT_INTERVAL
  • ESI_INTERRUPT_FLAG_AFE2_ESIOUTX
Returns
Logical OR of any of the following:
  • ESI_INTERRUPT_FLAG_AFE1_ESIOUTX
  • ESI_INTERRUPT_FLAG_ESISTOP
  • ESI_INTERRUPT_FLAG_ESISTART
  • ESI_INTERRUPT_FLAG_ESICNT1
  • ESI_INTERRUPT_FLAG_ESICNT2
  • ESI_INTERRUPT_FLAG_Q6_BIT_SET
  • ESI_INTERRUPT_FLAG_Q7_BIT_SET
  • ESI_INTERRUPT_FLAG_ESICNT0_COUNT_INTERVAL
  • ESI_INTERRUPT_FLAG_AFE2_ESIOUTX
    indicating the status of the masked flags
uint16_t ESI_getInterruptVectorRegister ( void  )

Get ESI interrupt Vector Register

Returns
None
uint16_t ESI_getLatchedComparatorOutput ( uint16_t  channelSelect)

Reads the latched comparator outputs form the AFEs

Parameters
channelSelect.Valid values are ESI_AFE1_CHANNEL0_SELECT ESI_AFE1_CHANNEL1_SELECT ESI_AFE1_CHANNEL2_SELECT ESI_AFE1_CHANNEL3_SELECT ESI_AFE2_CHANNEL0_SELECT ESI_AFE2_CHANNEL1_SELECT ESI_AFE2_CHANNEL2_SELECT ESI_AFE2_CHANNEL3_SELECT ESI_AFE1_TEST_CHANNEL0_SELECT ESI_AFE1_TEST_CHANNEL1_SELECT

This function gets the ESIPPU register to get latched output values of the comparator outputs for AFE1 and AFE2

Returns
Valid values are ESI_AFE_OUTPUT_LOW ESI_AFE_OUTPUT_HIGH
uint16_t ESI_getOscCounter ( void  )

Get ESI PSM Oscillator Counter Value

This function reads the ESI Oscillator Counter register

Returns
Counter value
void ESI_LC_DAC_calibration ( uint8_t  selected_channel)

Simple DAC calibration code using pre-defined TSM Supports AFE1 only.

Parameters
selected_channelacceptable values ESI_AFE1_CHANNEL0_SELECT ESI_AFE1_CHANNEL1_SELECT ESI_AFE1_CHANNEL2_SELECT ESI_AFE1_CHANNEL3_SELECT
Returns
None

References ESI_getAFE1DACValue(), and ESI_setAFE1DACValue().

uint16_t ESI_measureESIOSC ( uint8_t  oversample)

The following function returns an average of ESIOSC measurement.

Parameters
return averaged ESIOSC measurement.

Referenced by ESI_calibrateInternalOscFreq().

void ESI_PSM_clearTable ( void  )

Clear PSM entries

This function clears all PSM entries

Returns
None
void ESI_PSM_copyTable ( uint8_t *  psmTable,
uint8_t  size 
)

Copy PSM entries

This function copies all PSM entries

Returns
None
void ESI_PSM_init ( ESI_PSM_InitParams params)

Initialize Processing State Machine.

Parameters
paramsis ESI_PSM_InitParams struct

This function initializes the PSM registers.

Returns
None
void ESI_PSM_resetCounter ( uint16_t  counterToReset)

Reset PSM counters

Parameters
counterToResetis the counter that needs t be reset

This function resets the PSM counters

Returns
None
void ESI_psmSourceSelect ( uint16_t  sourceNum,
uint16_t  sourceSelect 
)

Connects psm source to comparator output

Parameters
sourceNumPSM_S1_SOURCE, PSM_S2_SOURCE or PSM_S3_SOURCE
sourceSelectcan have the following values ESI_PSM_SOURCE_IS_ESIOUT0 ESI_PSM_SOURCE_IS_ESIOUT1 ESI_PSM_SOURCE_IS_ESIOUT2 ESI_PSM_SOURCE_IS_ESIOUT3 ESI_PSM_SOURCE_IS_ESIOUT4 ESI_PSM_SOURCE_IS_ESIOUT5 ESI_PSM_SOURCE_IS_ESIOUT6 ESI_PSM_SOURCE_IS_ESIOUT7

This function connects the chosen comparator output to TimerA

Returns
None
void ESI_setAFE1DACValue ( uint16_t  dacValue,
uint8_t  dacRegNum 
)

sets AFE1 DAC threshold Value

Parameters
dacValueis value to be written to DAC register.
dacRegNumis DAC register number

Write DAC threshold value into selected DAC register

Returns
None

Referenced by ESI_LC_DAC_calibration().

void ESI_setAFE2DACValue ( uint16_t  dacValue,
uint8_t  dacRegNum 
)

sets AFE2 DAC threshold Value

Parameters
dacValueis value to be written to DAC register.
dacRegNumis DAC register number

Write DAC threshold value into selected DAC register

Returns
None
void ESI_setESICLKFQ ( uint8_t  setting)

The following function sets ESICLKFQx bits on ESIOSC register.

Parameters
settingis to the loaded to ESIOSC. Valid parameters a value between 0x00 and 0x3F. 0x00 corresponds to minimum frequency, 0x20 corresponds to nominal frequency and 0x3F corresponds to maximum frequency.
Returns
none
void ESI_setIFG0Source ( uint16_t  ifg0Src)

Set source of IFG0 interrupt flag

Parameters
ifg0Srcvalues are as follows ESI_IFG0_SET_WHEN_ESIOUT0_SET ESI_IFG0_SET_WHEN_ESIOUT0_RESET ESI_IFG0_SET_WHEN_ESIOUT1_SET ESI_IFG0_SET_WHEN_ESIOUT1_RESET ESI_IFG0_SET_WHEN_ESIOUT2_SET ESI_IFG0_SET_WHEN_ESIOUT2_RESET ESI_IFG0_SET_WHEN_ESIOUT3_SET ESI_IFG0_SET_WHEN_ESIOUT3_RESET
Returns
None
void ESI_setIFG4Source ( uint16_t  ifg4Src)

Set source of IFG4 interrupt flag

Parameters
ifg4Srcvalues are as follows ESI_IFG4_SOURCE_EVERY_COUNT_OF_CNT2 ESI_IFG4_SOURCE_CNT2_MOD4 ESI_IFG4_SOURCE_CNT2_MOD256 ESI_IFG4_SOURCE_CNT2_ROLLOVER
Returns
None
void ESI_setIFG7Source ( uint16_t  ifg7Src)

Set source of IFG7 interrupt flag

Parameters
ifg7Srcvalues are as follows ESI_IFG7_SOURCE_EVERY_COUNT_OF_CNT0 ESI_IFG7_SOURCE_CNT0_MOD4 ESI_IFG7_SOURCE_CNT0_MOD256 ESI_IFG7_SOURCE_CNT0_ROLLOVER
Returns
None
void ESI_setIFG8Source ( uint16_t  ifg8Src)

Set source of IFG8 interrupt flag

Parameters
ifg8Srcvalues are as follows ESI_IFG8_SET_WHEN_ESIOUT4_SET ESI_IFG8_SET_WHEN_ESIOUT4_RESET ESI_IFG8_SET_WHEN_ESIOUT5_SET ESI_IFG8_SET_WHEN_ESIOUT5_RESET ESI_IFG8_SET_WHEN_ESIOUT6_SET ESI_IFG8_SET_WHEN_ESIOUT6_RESET ESI_IFG8_SET_WHEN_ESIOUT7_SET ESI_IFG8_SET_WHEN_ESIOUT7_RESET
Returns
None
void ESI_setNominalInternalOscFreq ( void  )

Sets frequency of ESI internal Oscillator

Returns
None

Referenced by ESI_calibrateInternalOscFreq().

void ESI_setPSMCounter1LowerThreshold ( uint16_t  threshold)

Set lower threshold for PSM counter 1

Parameters
thresholdis the lower threashold that causes ESIIFG3 to get set.

This function set the threshold value for PSM counter 1. ESIIFG3 gets set when counter value and this threahold are equal.

Returns
None
void ESI_setPSMCounter1UpperThreshold ( uint16_t  threshold)

Set upper threshold for PSM counter 1

Parameters
thresholdis the upper threashold that causes ESIIFG3 to get set.

This function sets the threshold value for PSM counter 1. ESIIFG3 gets set when counter value and this threahold are equal.

Returns
None
void ESI_setTSMstateReg ( ESI_TSM_StateParams params,
uint8_t  stateRegNum 
)

sets TSM state register

Parameters
paramsconstructs the state value
stateRegNumis state register offset

Sets selected TSM state register.

Returns
None
void ESI_startInternalOscCal ( void  )

Start calibration on ESI internal Oscillator

This function starts calibration of internal osciallator. After calling this function the user and use ESI_adjustInternalOscFreq() to adjust the freq. of the oscillator.

Returns
None
void ESI_testChannel0SourceSelect ( uint16_t  sourceSelect)

Connects testChannel0 to comparator input

Parameters
sourceSelectcan have the following values ESI_TEST_CHANNEL0_SOURCE_IS_CH0_CI0 ESI_TEST_CHANNEL0_SOURCE_IS_CH1_CI1 ESI_TEST_CHANNEL0_SOURCE_IS_CH2_CI2 ESI_TEST_CHANNEL0_SOURCE_IS_CH3_CI3

This function connects the chosen comparator input to the test channel0

Returns
None
void ESI_testChannel1SourceSelect ( uint16_t  sourceSelect)

Connects testChannel1to comparator input

Parameters
sourceSelectcan have the following values ESI_TEST_CHANNEL1_SOURCE_IS_CH0_CI0 ESI_TEST_CHANNEL1_SOURCE_IS_CH1_CI1 ESI_TEST_CHANNEL1_SOURCE_IS_CH2_CI2 ESI_TEST_CHANNEL1_SOURCE_IS_CH3_CI3

This function connects the chosen comparator input to the test channel1

Returns
None
void ESI_timerAInputSelect ( uint16_t  select)

Connects comparator output to timerA input

Parameters
counterToResetESI_TIMERA_INPUT_TSM_COMPOUT or ESI_TIMERA_INPUT_TSM_PPUSRC

This function connects the chosen comparator output to TimerA

Returns
None
void ESI_TSM_clearTable ( void  )

Clear TSM entries

This function clears all TSM entries

Returns
None
void ESI_TSM_copyTable ( uint16_t *  tsmTable,
uint16_t  size 
)

Copy TSM entries

This function copies all TSM entries

Returns
None
uint8_t ESI_TSM_getTSMStateDuration ( uint8_t  stateRegNum)

TSM trigger using software

This function starts a software initiated TSM sequence

Returns
ESIREATx bits from selected stateRegNum
void ESI_TSM_init ( ESI_TSM_InitParams params)

Initializes the TSM

Parameters
paramsis ESI_TSM_InitParams struct

This function initializes the TSM.

Returns
None
void ESI_TSM_setTSMStateDuration ( uint8_t  stateRegNum,
uint8_t  duration 
)

TSM trigger using software

This function starts a software initiated TSM sequence

Returns
ESIREATx bits from selected stateRegNum
void ESI_TSM_softwareTrigger ( void  )

TSM trigger using software

This function starts a software initiated TSM sequence

Returns
None

Variable Documentation

const ESI_AFE1_InitParams ESI_AFE1_INITPARAMS_DEFAULT
Initial value:
= {ESI_EXCITATION_CIRCUIT_DISABLED,
ESI_SAMPLE_HOLD_DISABLED,
ESI_MID_VOLTAGE_GENERATOR_DISABLED,
ESI_SAMPLE_HOLD_VSS_TO_ESIVSS,
ESI_INVERTER_FOR_AFE1_DISABLE
}
const ESI_AFE2_InitParams ESI_AFE2_INITPARAMS_DEFAULT
Initial value:
= {
ESI_AFE2_INPUT_SELECT_CHx,
ESI_INVERTER_FOR_AFE2_DISABLE,
ESI_TSM_COMPARATOR_CONTROL_AFE2_DISABLE,
ESI_TSM_DAC_CONTROL_AFE2_DISABLE
}
const ESI_PSM_InitParams ESI_PSM_INITPARAMS_DEFAULT
Initial value:
= { ESI_PSM_Q6_DISABLE,
ESI_PSM_Q7_TRIGGER_DISABLE,
ESI_PSM_CNT0_DISABLE,
ESI_PSM_CNT0_RESET,
ESI_PSM_CNT1_DISABLE,
ESI_PSM_CNT1_RESET,
ESI_PSM_CNT2_DISABLE,
ESI_PSM_CNT2_RESET,
ESI_PSM_S3_SELECT,
ESI_PSM_TEST4_IS_Q2,
}
const ESI_TSM_InitParams ESI_TSM_INITPARAMS_DEFAULT
Initial value:
= { ESI_TSM_SMCLK_DIV_1,
ESI_TSM_ACLK_DIV_1,
ESI_TSM_START_TRIGGER_DIV_2,
ESI_TSM_REPEAT_NEW_TRIGGER,
ESI_TSM_STOP_SEQUENCE,
ESI_TSM_HIGH_FREQ_CLK_FUNCTION_ON
}

Copyright 2015, Texas Instruments Incorporated