168 const uint_least8_t sensorNumber)
183 const uint_least8_t sensorNumber)
235 extern CAL_Handle
CAL_init(
void *pMemory,
const size_t numBytes);
304 extern void CAL_reset(CAL_Handle handle);
395 extern void CAL_setWaitTimes(CAL_Handle handle,
const uint_least32_t *pWaitTimes);
421 for(cnt=0;cnt<USER_NUM_CURRENT_SENSORS;cnt++)
428 for(cnt=0;cnt<USER_NUM_VOLTAGE_SENSORS;cnt++)
453 #endif // end of _CAL_H_ definition
static bool CAL_getFlag_enable(CAL_Handle handle)
Gets the value of the enable flag.
static void CAL_enable(CAL_Handle handle)
Enables the calibrator (CAL) module.
bool flag_enableAdcOffset
the enable ADC offset calibration flag
OFFSET_Obj offset_I[USER_NUM_CURRENT_SENSORS]
the current offset objects
Contains the public interface to the types definitions.
static void CAL_run(CAL_Handle handle, const HAL_AdcData_t *pAdcData)
Runs the calibrator (CAL) module.
CAL_State_e state
the current state
Contains the public interface to the offset (OFFSET) module routines.
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_isIdle(CAL_Handle handle)
Determines if the calibrator is in the idle state.
static bool CAL_isNotIdle(CAL_Handle handle)
Determines if the calibrator is not in the idle state.
CAL_State_e
Defines the CAL states.
static void CAL_incrCounter_state(CAL_Handle handle)
Increments the state count value.
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.
struct _OFFSET_Obj_ * OFFSET_Handle
Defines the OFFSET handle.
Contains the public interface to the math (MATH) module routines.
struct _CAL_Obj_ CAL_Obj
Defines the calibrator (CAL) object.
static void CAL_disable(CAL_Handle handle)
Disables the calibrator (CAL) module.
bool flag_enable
the enable flag
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.
Contains the HAL data structures.
OFFSET_Obj offset_V[USER_NUM_VOLTAGE_SENSORS]
the voltage offset objects
static OFFSET_Handle * CAL_getOffsetHandleAddr_I(CAL_Handle handle)
Gets the current offset handle address.
static _iq CAL_getOffsetValue_V(CAL_Handle handle, const uint_least8_t sensorNumber)
Gets the voltage offset value.
void CAL_setWaitTimes(CAL_Handle handle, const uint_least32_t *pWaitTimes)
Sets the wait times.
uint_least32_t waitTimes[CAL_numStates]
an array of wait times for each state, calibration clock counts
static bool CAL_isError(CAL_Handle handle)
Determines if there is a calibrator error.
static void CAL_setup(CAL_Handle handle)
Sets up the calibrator (CAL) module.
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.
static CAL_State_e CAL_getState(CAL_Handle handle)
Gets the calibration state.
MATH_vec3 V_pu
the voltage values
CAL_Handle CAL_init(void *pMemory, const size_t numBytes)
Initializes the calibrator (CAL) module.
ADC offset calibration state.
Contains the public interface to the calibration (CAL) module routines.
static _iq CAL_getOffsetValue_I(CAL_Handle handle, const uint_least8_t sensorNumber)
Gets the current offset value.
bool CAL_updateState(CAL_Handle handle)
Updates the calibrator (CAL) state.
static bool CAL_isEnabled(CAL_Handle handle)
Returns a boolean value denoting if the module is enabled (true) or not (false)
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.
uint_least32_t counter_state
the state counter
static void OFFSET_run(OFFSET_Handle handle, const _iq inputValue)
Runs an offset filter of the form y[n] = beta*(x[n]+bias) + (1 - beta)*y[n-1] y -> The DC offset x ->...
the total number of states
MATH_vec3 I_pu
the current values
static _iq OFFSET_getOffset(OFFSET_Handle handle)
Gets the offset value.
static uint_least32_t CAL_getWaitTime(CAL_Handle handle, const CAL_State_e state)
Gets the wait time for a given state.
Defines the offset (OFFSET) object.
static OFFSET_Handle * CAL_getOffsetHandleAddr_V(CAL_Handle handle)
Gets the voltage offset handle address.