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 |
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.
Referenced by ESI_calibrateInternalOscFreq().
void ESI_AFE1_init | ( | ESI_AFE1_InitParams * | params | ) |
Initializes the ESI analog front end AFE1
params | is ESI_AFE1_InitParams struct |
This functions initializes the ESI analog front end AFE1.
void ESI_AFE2_init | ( | ESI_AFE2_InitParams * | params | ) |
Initializes the ESI analog front end - AFE2
params | is ESI_AFE2_InitParams struct |
This functions initializes the ESI analog front end AFE2
void ESI_calibrateInternalOscFreq | ( | uint16_t | targetAclkCounts | ) |
Calibrate ESI internal Oscillator
References ESI_adjustInternalOscFreq(), ESI_measureESIOSC(), and ESI_setNominalInternalOscFreq().
void ESI_clearInterrupt | ( | uint16_t | interruptMask | ) |
Clear ESI interrupt flag
interruptMask | is the masked interrupt flag status to be returned. Mask value is the logical OR of any of the following:
|
void ESI_disable | ( | void | ) |
Disable ESI peripheral
void ESI_disableInternalOscillator | ( | void | ) |
Disables the internal Oscillator
This function disables the high frequency internal oscillator
void ESI_disableInterrupt | ( | uint16_t | interruptMask | ) |
Disables ESI interrupts
interruptMask | is 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.
void ESI_enable | ( | void | ) |
Enable ESI peripheral
void ESI_enableInternalOscillator | ( | void | ) |
Enables the internal Oscillator
This function enables the high frequency internal oscillator
void ESI_enableInterrupt | ( | uint16_t | interruptMask | ) |
Enables ESI interrupts
interruptMask | is 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.
uint16_t ESI_getAFE1DACValue | ( | uint8_t | dacRegNum | ) |
gets AFE1 DAC threshold Value
dacValue | is value to be written to DAC register. |
dacRegNum | is DAC register number |
Read DAC threshold value into selected DAC register
Referenced by ESI_LC_DAC_calibration().
uint16_t ESI_getAFE2DACValue | ( | uint8_t | dacRegNum | ) |
gets AFE2 DAC threshold Value
dacValue | is value to be written to DAC register. |
dacRegNum | is DAC register number |
Read DAC threshold value into selected DAC register
uint16_t ESI_getCounter0 | ( | void | ) |
Get ESI PSM Counter 0 Value
This function reads the ESI Counter 0 register
uint16_t ESI_getCounter1 | ( | void | ) |
Get ESI PSM Counter 1 Value
This function reads the ESI Counter1 register
uint16_t ESI_getCounter2 | ( | void | ) |
Get ESI PSM Counter 2 Value
This function reads the ESI Counter2 register
uint8_t ESI_getESICLKFQ | ( | void | ) |
The following function returns the ESICLKFQx bits on ESIOSC register.
none |
uint16_t ESI_getInterruptStatus | ( | uint16_t | interruptMask | ) |
Get ESI interrupt status
interruptMask | is the masked interrupt flag status to be returned. Mask value is the logical OR of any of the following:
|
uint16_t ESI_getInterruptVectorRegister | ( | void | ) |
Get ESI interrupt Vector Register
uint16_t ESI_getLatchedComparatorOutput | ( | uint16_t | channelSelect | ) |
Reads the latched comparator outputs form the AFEs
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
uint16_t ESI_getOscCounter | ( | void | ) |
Get ESI PSM Oscillator Counter Value
This function reads the ESI Oscillator Counter register
void ESI_LC_DAC_calibration | ( | uint8_t | selected_channel | ) |
Simple DAC calibration code using pre-defined TSM Supports AFE1 only.
selected_channel | acceptable values ESI_AFE1_CHANNEL0_SELECT ESI_AFE1_CHANNEL1_SELECT ESI_AFE1_CHANNEL2_SELECT ESI_AFE1_CHANNEL3_SELECT |
References ESI_getAFE1DACValue(), and ESI_setAFE1DACValue().
uint16_t ESI_measureESIOSC | ( | uint8_t | oversample | ) |
The following function returns an average of ESIOSC measurement.
return averaged ESIOSC measurement. |
Referenced by ESI_calibrateInternalOscFreq().
void ESI_PSM_clearTable | ( | void | ) |
Clear PSM entries
This function clears all PSM entries
void ESI_PSM_copyTable | ( | uint8_t * | psmTable, |
uint8_t | size | ||
) |
Copy PSM entries
This function copies all PSM entries
void ESI_PSM_init | ( | ESI_PSM_InitParams * | params | ) |
Initialize Processing State Machine.
params | is ESI_PSM_InitParams struct |
This function initializes the PSM registers.
void ESI_PSM_resetCounter | ( | uint16_t | counterToReset | ) |
Reset PSM counters
counterToReset | is the counter that needs t be reset |
This function resets the PSM counters
void ESI_psmSourceSelect | ( | uint16_t | sourceNum, |
uint16_t | sourceSelect | ||
) |
Connects psm source to comparator output
sourceNum | PSM_S1_SOURCE, PSM_S2_SOURCE or PSM_S3_SOURCE |
sourceSelect | can 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
void ESI_setAFE1DACValue | ( | uint16_t | dacValue, |
uint8_t | dacRegNum | ||
) |
sets AFE1 DAC threshold Value
dacValue | is value to be written to DAC register. |
dacRegNum | is DAC register number |
Write DAC threshold value into selected DAC register
Referenced by ESI_LC_DAC_calibration().
void ESI_setAFE2DACValue | ( | uint16_t | dacValue, |
uint8_t | dacRegNum | ||
) |
sets AFE2 DAC threshold Value
dacValue | is value to be written to DAC register. |
dacRegNum | is DAC register number |
Write DAC threshold value into selected DAC register
void ESI_setESICLKFQ | ( | uint8_t | setting | ) |
The following function sets ESICLKFQx bits on ESIOSC register.
setting | is 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. |
void ESI_setIFG0Source | ( | uint16_t | ifg0Src | ) |
Set source of IFG0 interrupt flag
ifg0Src | values 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 |
void ESI_setIFG4Source | ( | uint16_t | ifg4Src | ) |
Set source of IFG4 interrupt flag
ifg4Src | values 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 |
void ESI_setIFG7Source | ( | uint16_t | ifg7Src | ) |
Set source of IFG7 interrupt flag
ifg7Src | values 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 |
void ESI_setIFG8Source | ( | uint16_t | ifg8Src | ) |
Set source of IFG8 interrupt flag
ifg8Src | values 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 |
void ESI_setNominalInternalOscFreq | ( | void | ) |
void ESI_setPSMCounter1LowerThreshold | ( | uint16_t | threshold | ) |
Set lower threshold for PSM counter 1
threshold | is 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.
void ESI_setPSMCounter1UpperThreshold | ( | uint16_t | threshold | ) |
Set upper threshold for PSM counter 1
threshold | is 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.
void ESI_setTSMstateReg | ( | ESI_TSM_StateParams * | params, |
uint8_t | stateRegNum | ||
) |
sets TSM state register
params | constructs the state value |
stateRegNum | is state register offset |
Sets selected TSM state register.
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.
void ESI_testChannel0SourceSelect | ( | uint16_t | sourceSelect | ) |
Connects testChannel0 to comparator input
sourceSelect | can 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
void ESI_testChannel1SourceSelect | ( | uint16_t | sourceSelect | ) |
Connects testChannel1to comparator input
sourceSelect | can 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
void ESI_timerAInputSelect | ( | uint16_t | select | ) |
Connects comparator output to timerA input
counterToReset | ESI_TIMERA_INPUT_TSM_COMPOUT or ESI_TIMERA_INPUT_TSM_PPUSRC |
This function connects the chosen comparator output to TimerA
void ESI_TSM_clearTable | ( | void | ) |
Clear TSM entries
This function clears all TSM entries
void ESI_TSM_copyTable | ( | uint16_t * | tsmTable, |
uint16_t | size | ||
) |
Copy TSM entries
This function copies all TSM entries
uint8_t ESI_TSM_getTSMStateDuration | ( | uint8_t | stateRegNum | ) |
TSM trigger using software
This function starts a software initiated TSM sequence
void ESI_TSM_init | ( | ESI_TSM_InitParams * | params | ) |
Initializes the TSM
params | is ESI_TSM_InitParams struct |
This function initializes the TSM.
void ESI_TSM_setTSMStateDuration | ( | uint8_t | stateRegNum, |
uint8_t | duration | ||
) |
TSM trigger using software
This function starts a software initiated TSM sequence
void ESI_TSM_softwareTrigger | ( | void | ) |
TSM trigger using software
This function starts a software initiated TSM sequence
const ESI_AFE1_InitParams ESI_AFE1_INITPARAMS_DEFAULT |
const ESI_AFE2_InitParams ESI_AFE2_INITPARAMS_DEFAULT |
const ESI_PSM_InitParams ESI_PSM_INITPARAMS_DEFAULT |
const ESI_TSM_InitParams ESI_TSM_INITPARAMS_DEFAULT |