41 for(cnt=0;cnt<USER_NUM_CURRENT_SENSORS;cnt++)
48 for(cnt=0;cnt<USER_NUM_VOLTAGE_SENSORS;cnt++)
74 for(cnt=0;cnt<USER_NUM_CURRENT_SENSORS;cnt++)
82 for(cnt=0;cnt<USER_NUM_VOLTAGE_SENSORS;cnt++)
121 bool stateChanged =
false;
135 if(count_state >= waitTime)
183 return(stateChanged);
static bool CAL_getFlag_enable(CAL_Handle handle)
Gets the value of the enable flag.
OFFSET_Obj offset_I[USER_NUM_CURRENT_SENSORS]
the current offset objects
static void CAL_setFlag_enableAdcOffset(CAL_Handle handle, const bool value)
Sets the value of the enable ADC offset flag.
Defines a structure for the user parameters.
OFFSET_Handle offsetHandle_V[USER_NUM_VOLTAGE_SENSORS]
the handles for the voltage offset estimators
Defines the calibrator (CAL) object.
void CAL_setParams(CAL_Handle handle, const USER_Params *pUserParams)
Sets the parameters.
static void CAL_resetCounter_state(CAL_Handle handle)
Resets the state count value.
static void CAL_setCount_state(CAL_Handle handle, const uint_least32_t count)
Sets the state count value.
static bool CAL_isNotIdle(CAL_Handle handle)
Determines if the calibrator is not in the idle state.
void OFFSET_setInitCond(OFFSET_Handle handle, const _iq initCond)
Set the initial condition of the integrator or the value of y[n-1].
CAL_State_e
Defines the CAL states.
static bool CAL_getFlag_enableAdcOffset(CAL_Handle handle)
Gets the value of the enable ADC offset flag.
void CAL_reset(CAL_Handle handle)
Resets the calibrator.
void OFFSET_setOffset(OFFSET_Handle handle, _iq offsetValue)
Sets the offset value.
float_t offsetPole_rps
Defines the pole location for the voltage and current offset estimation, rad/s.
OFFSET_Handle offsetHandle_I[USER_NUM_CURRENT_SENSORS]
the handles for the current offset estimators
static void CAL_setWaitTime(CAL_Handle handle, const CAL_State_e state, const uint_least32_t waitTime)
Sets the wait time for a given state.
OFFSET_Obj offset_V[USER_NUM_VOLTAGE_SENSORS]
the voltage offset objects
void OFFSET_setBeta(OFFSET_Handle handle, const _iq beta)
Sets the beta offset filter coefficient.
static void CAL_setFlag_enable(CAL_Handle handle, const bool value)
Sets the value of the enable flag.
static uint_least32_t CAL_getCount_state(CAL_Handle handle)
Gets the state count value.
Contains the public interface to the calibrator (CAL) module routines.
static CAL_State_e CAL_getState(CAL_Handle handle)
Gets the calibration state.
uint_least32_t ctrlFreq_Hz
Defines the controller frequency, Hz.
CAL_Handle CAL_init(void *pMemory, const size_t numBytes)
Initializes the calibrator (CAL) module.
ADC offset calibration state.
OFFSET_Handle OFFSET_init(void *pMemory, const size_t numBytes)
Initializes the offset.
bool CAL_updateState(CAL_Handle handle)
Updates the calibrator (CAL) state.
static void CAL_setState(CAL_Handle handle, const CAL_State_e state)
Sets the calibration state.
struct _CAL_Obj_ * CAL_Handle
Defines the CAL handle.
the total number of states
int_least32_t calWaitTime[CAL_numStates]
Defines the wait times for each calibrator state, isr ticks.
static uint_least32_t CAL_getWaitTime(CAL_Handle handle, const CAL_State_e state)
Gets the wait time for a given state.
float float_t
Defines the portable data type for 32 bit, signed floating-point data.
void CAL_setWaitTimes(CAL_Handle handle, const int_least32_t *pWaitTimes)
Sets the wait times.