|
MotorWare f2806x Module API Documentation
|
Data Structures | |
| struct | _CAL_Obj_ |
| Defines the calibrator (CAL) object. More... | |
Typedefs | |
| typedef struct _CAL_Obj_ | CAL_Obj |
| Defines the calibrator (CAL) object. More... | |
| typedef struct _CAL_Obj_ * | CAL_Handle |
| Defines the CAL handle. More... | |
| typedef struct _CAL_Obj_ | CAL_Obj |
| Defines the calibrator (CAL) object. More... | |
| typedef struct _CAL_Obj_ * | CAL_Handle |
| Defines the CAL handle. More... | |
Enumerations | |
| enum | CAL_State_e { CAL_State_Error = 0, CAL_State_Idle = 1, CAL_State_AdcOffset = 2, CAL_State_Done = 3, CAL_numStates = 4 } |
| Defines the CAL states. More... | |
Functions | |
| static void | CAL_disable (CAL_Handle handle) |
| Disables the calibrator (CAL) module. More... | |
| static void | CAL_enable (CAL_Handle handle) |
| Enables the calibrator (CAL) module. More... | |
| static uint_least32_t | CAL_getCount_state (CAL_Handle handle) |
| Gets the state count value. More... | |
| static bool | CAL_getFlag_enable (CAL_Handle handle) |
| Gets the value of the enable flag. More... | |
| static bool | CAL_getFlag_enableAdcOffset (CAL_Handle handle) |
| Gets the value of the enable ADC offset flag. More... | |
| static OFFSET_Handle * | CAL_getOffsetHandleAddr_I (CAL_Handle handle) |
| Gets the current offset handle address. More... | |
| static OFFSET_Handle * | CAL_getOffsetHandleAddr_V (CAL_Handle handle) |
| Gets the voltage offset handle address. More... | |
| static _iq | CAL_getOffsetValue_I (CAL_Handle handle, const uint_least8_t sensorNumber) |
| Gets the current offset value. More... | |
| static _iq | CAL_getOffsetValue_V (CAL_Handle handle, const uint_least8_t sensorNumber) |
| Gets the voltage offset value. More... | |
| static CAL_State_e | CAL_getState (CAL_Handle handle) |
| Gets the calibration state. More... | |
| static uint_least32_t | CAL_getWaitTime (CAL_Handle handle, const CAL_State_e state) |
| Gets the wait time for a given state. More... | |
| static void | CAL_incrCounter_state (CAL_Handle handle) |
| Increments the state count value. More... | |
| CAL_Handle | CAL_init (void *pMemory, const size_t numBytes) |
| Initializes the calibrator (CAL) module. More... | |
| static bool | CAL_isEnabled (CAL_Handle handle) |
| Returns a boolean value denoting if the module is enabled (true) or not (false) More... | |
| static bool | CAL_isError (CAL_Handle handle) |
| Determines if there is a calibrator error. More... | |
| static bool | CAL_isIdle (CAL_Handle handle) |
| Determines if the calibrator is in the idle state. More... | |
| static bool | CAL_isNotIdle (CAL_Handle handle) |
| Determines if the calibrator is not in the idle state. More... | |
| void | CAL_reset (CAL_Handle handle) |
| Resets the calibrator. More... | |
| static void | CAL_resetCounter_state (CAL_Handle handle) |
| Resets the state count value. More... | |
| static void | CAL_setCount_state (CAL_Handle handle, const uint_least32_t count) |
| Sets the state count value. More... | |
| static void | CAL_setFlag_enable (CAL_Handle handle, const bool value) |
| Sets the value of the enable flag. More... | |
| static void | CAL_setFlag_enableAdcOffset (CAL_Handle handle, const bool value) |
| Sets the value of the enable ADC offset flag. More... | |
| void | CAL_setParams (CAL_Handle handle, const USER_Params *pUserParams) |
| Sets the parameters. More... | |
| static void | CAL_setState (CAL_Handle handle, const CAL_State_e state) |
| Sets the calibration state. More... | |
| 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. More... | |
| void | CAL_setWaitTimes (CAL_Handle handle, const uint_least32_t *pWaitTimes) |
| Sets the wait times. More... | |
| static void | CAL_setup (CAL_Handle handle) |
| Sets up the calibrator (CAL) module. More... | |
| static void | CAL_run (CAL_Handle handle, const HAL_AdcData_t *pAdcData) |
| Runs the calibrator (CAL) module. More... | |
| bool | CAL_updateState (CAL_Handle handle) |
| Updates the calibrator (CAL) state. More... | |
| static void | CAL_setCount_state (CAL_Handle handle, const int_least32_t count) |
| Sets the state count value. More... | |
| static void | CAL_setWaitTime (CAL_Handle handle, const CAL_State_e state, const int_least32_t waitTime) |
| Sets the wait time for a given state. More... | |
| void | CAL_setWaitTimes (CAL_Handle handle, const int_least32_t *pWaitTimes) |
| Sets the wait times. More... | |
| struct _CAL_Obj_ |
| Data Fields | ||
|---|---|---|
| uint_least32_t | counter_state | the state counter |
| int_least32_t | counter_state | the state counter |
| bool | flag_enable | the enable flag |
| bool | flag_enableAdcOffset | the enable ADC offset calibration flag |
| OFFSET_Obj | offset_I[USER_NUM_CURRENT_SENSORS] | the current offset objects |
| OFFSET_Obj | offset_V[USER_NUM_VOLTAGE_SENSORS] | the voltage offset objects |
| OFFSET_Handle | offsetHandle_I[USER_NUM_CURRENT_SENSORS] | the handles for the current offset estimators |
| OFFSET_Handle | offsetHandle_V[USER_NUM_VOLTAGE_SENSORS] | the handles for the voltage offset estimators |
| CAL_State_e | state | the current state |
| int_least32_t | waitTimes[CAL_numStates] | an array of wait times for each state, calibration clock counts |
| uint_least32_t | waitTimes[CAL_numStates] | an array of wait times for each state, calibration clock counts |
| typedef struct _CAL_Obj_* CAL_Handle |
| typedef struct _CAL_Obj_* CAL_Handle |
Defines the CAL handle.
Definition at line 74 of file float/cal.h.
| enum CAL_State_e |
Defines the CAL states.
| Enumerator | |
|---|---|
| CAL_State_Error |
error state |
| CAL_State_Idle |
idle state |
| CAL_State_AdcOffset |
ADC offset calibration state. |
| CAL_State_Done |
done state |
| CAL_numStates |
the total number of states |
Definition at line 46 of file cal_states.h.
|
inlinestatic |
Disables the calibrator (CAL) module.
| [in] | handle | The calibrator (CAL) handle |
Definition at line 86 of file 32b/cal.h.
References _CAL_Obj_::flag_enable.
|
inlinestatic |
Enables the calibrator (CAL) module.
| [in] | handle | The calibrator (CAL) handle |
Definition at line 98 of file 32b/cal.h.
References _CAL_Obj_::flag_enable.
|
inlinestatic |
Gets the state count value.
| [in] | handle | The calibrator (CAL) handle |
Definition at line 111 of file 32b/cal.h.
References _CAL_Obj_::counter_state.
Referenced by CAL_updateState().
|
inlinestatic |
Gets the value of the enable flag.
| [in] | handle | The calibrator (CAL) handle |
Definition at line 122 of file 32b/cal.h.
References _CAL_Obj_::flag_enable.
Referenced by CAL_updateState().
|
inlinestatic |
Gets the value of the enable ADC offset flag.
| [in] | handle | The calibrator (CAL) handle |
Definition at line 133 of file 32b/cal.h.
References _CAL_Obj_::flag_enableAdcOffset.
Referenced by CAL_updateState().
|
inlinestatic |
Gets the current offset handle address.
| [in] | handle | The calibrator (CAL) handle |
Definition at line 144 of file 32b/cal.h.
References _CAL_Obj_::offsetHandle_I.
|
inlinestatic |
Gets the voltage offset handle address.
| [in] | handle | The calibrator (CAL) handle |
Definition at line 155 of file 32b/cal.h.
References _CAL_Obj_::offsetHandle_V.
|
inlinestatic |
Gets the current offset value.
| [in] | handle | The calibrator (CAL) handle |
| [in] | sensorNumber | The sensor number |
Definition at line 167 of file 32b/cal.h.
References OFFSET_getOffset(), and _CAL_Obj_::offsetHandle_I.
|
inlinestatic |
Gets the voltage offset value.
| [in] | handle | The calibrator (CAL) handle |
| [in] | sensorNumber | The sensor number |
Definition at line 182 of file 32b/cal.h.
References OFFSET_getOffset(), and _CAL_Obj_::offsetHandle_V.
|
inlinestatic |
Gets the calibration state.
| [in] | handle | The calibrator (CAL) handle |
Definition at line 196 of file 32b/cal.h.
References _CAL_Obj_::state.
Referenced by CAL_isError(), CAL_isIdle(), CAL_isNotIdle(), CAL_run(), and CAL_updateState().
|
inlinestatic |
Gets the wait time for a given state.
| [in] | handle | The calibrator (CAL) handle |
| [in] | state | The state |
Definition at line 208 of file 32b/cal.h.
References _CAL_Obj_::waitTimes.
Referenced by CAL_updateState().
|
inlinestatic |
Increments the state count value.
| [in] | handle | The calibrator (CAL) handle |
Definition at line 218 of file 32b/cal.h.
References _CAL_Obj_::counter_state.
Referenced by CAL_run().
| CAL_Handle CAL_init | ( | void * | pMemory, |
| const size_t | numBytes | ||
| ) |
Initializes the calibrator (CAL) module.
| [in] | pMemory | A pointer to the memory for the object |
| [in] | numBytes | The number of bytes allocated for the object, bytes |
Definition at line 21 of file 32b/cal.c.
References _CAL_Obj_::offset_I, OFFSET_init(), _CAL_Obj_::offset_V, _CAL_Obj_::offsetHandle_I, and _CAL_Obj_::offsetHandle_V.
|
inlinestatic |
Returns a boolean value denoting if the module is enabled (true) or not (false)
| [in] | handle | The calibrator (CAL) handle |
Definition at line 241 of file 32b/cal.h.
References _CAL_Obj_::flag_enable.
|
inlinestatic |
Determines if there is a calibrator error.
| [in] | handle | The calibrator (CAL) handle |
Definition at line 252 of file 32b/cal.h.
References CAL_getState(), CAL_State_Error, and _CAL_Obj_::state.
|
inlinestatic |
Determines if the calibrator is in the idle state.
| [in] | handle | The calibrator (CAL) handle |
Definition at line 271 of file 32b/cal.h.
References CAL_getState(), CAL_State_Idle, and _CAL_Obj_::state.
|
inlinestatic |
Determines if the calibrator is not in the idle state.
| [in] | handle | The calibrator (CAL) handle |
Definition at line 288 of file 32b/cal.h.
References CAL_getState(), CAL_State_Idle, and _CAL_Obj_::state.
Referenced by CAL_updateState().
| void CAL_reset | ( | CAL_Handle | handle | ) |
Resets the calibrator.
| [in] | handle | The calibrator (CAL) handle |
Definition at line 57 of file 32b/cal.c.
Referenced by CAL_updateState().
|
inlinestatic |
Resets the state count value.
| [in] | handle | The calibrator (CAL) handle |
Definition at line 309 of file 32b/cal.h.
References _CAL_Obj_::counter_state.
Referenced by CAL_updateState().
|
inlinestatic |
Runs the calibrator (CAL) module.
| [in] | handle | The calibrator (CAL) handle |
Definition at line 409 of file 32b/cal.h.
References CAL_getState(), CAL_incrCounter_state(), CAL_State_AdcOffset, _HAL_AdcData_t_::I_pu, OFFSET_run(), _CAL_Obj_::offsetHandle_I, _CAL_Obj_::offsetHandle_V, _CAL_Obj_::state, _HAL_AdcData_t_::V_pu, and _MATH_vec3_::value.
|
inlinestatic |
Sets the state count value.
| [in] | handle | The calibrator (CAL) handle |
| [in] | count | The desired state count value |
Definition at line 322 of file 32b/cal.h.
References _CAL_Obj_::counter_state.
Referenced by CAL_setParams().
|
inlinestatic |
Sets the state count value.
| [in] | handle | The calibrator (CAL) handle |
| [in] | count | The desired state count value |
Definition at line 330 of file float/cal.h.
References _CAL_Obj_::counter_state.
|
inlinestatic |
Sets the value of the enable flag.
| [in] | handle | The calibrator (CAL) handle |
| [in] | value | The desired flag value |
Definition at line 335 of file 32b/cal.h.
References _CAL_Obj_::flag_enable.
Referenced by CAL_setParams().
|
inlinestatic |
Sets the value of the enable ADC offset flag.
| [in] | handle | The calibrator (CAL) handle |
| [in] | value | The desired flag value |
Definition at line 348 of file 32b/cal.h.
References _CAL_Obj_::flag_enableAdcOffset.
Referenced by CAL_setParams(), and CAL_updateState().
| void CAL_setParams | ( | CAL_Handle | handle, |
| const USER_Params * | pUserParams | ||
| ) |
Sets the parameters.
| [in] | handle | The calibrator (CAL) handle |
| [in] | pUserParams | The pointer to the user parameters |
Definition at line 67 of file 32b/cal.c.
References _IQ, CAL_setCount_state(), CAL_setFlag_enable(), CAL_setFlag_enableAdcOffset(), CAL_setState(), CAL_setWaitTimes(), CAL_State_Idle, _USER_Params_::calWaitTime, _USER_Params_::ctrlFreq_Hz, OFFSET_setBeta(), OFFSET_setInitCond(), OFFSET_setOffset(), _CAL_Obj_::offsetHandle_I, _CAL_Obj_::offsetHandle_V, and _USER_Params_::offsetPole_rps.
|
inlinestatic |
Sets the calibration state.
| [in] | handle | The calibrator (CAL) handle |
| [in] | state | The calibration state |
Definition at line 368 of file 32b/cal.h.
References _CAL_Obj_::state.
Referenced by CAL_setParams(), and CAL_updateState().
|
inlinestatic |
|
inlinestatic |
Sets the wait time for a given state.
| [in] | handle | The calibrator (CAL) handle |
| [in] | state | The state |
| [in] | waitTime | The wait time, counts |
Definition at line 382 of file 32b/cal.h.
References _CAL_Obj_::state, and _CAL_Obj_::waitTimes.
Referenced by CAL_setWaitTimes().
|
inlinestatic |
Sets the wait time for a given state.
| [in] | handle | The calibrator (CAL) handle |
| [in] | state | The state |
| [in] | waitTime | The wait time, counts |
Definition at line 390 of file float/cal.h.
References _CAL_Obj_::state, and _CAL_Obj_::waitTimes.
| void CAL_setWaitTimes | ( | CAL_Handle | handle, |
| const uint_least32_t * | pWaitTimes | ||
| ) |
Sets the wait times.
| [in] | handle | The calibrator (CAL) handle |
| [in] | pWaitTimes | A point to a vector of wait times |
Definition at line 104 of file 32b/cal.c.
References CAL_numStates, and CAL_setWaitTime().
Referenced by CAL_setParams().
| void CAL_setWaitTimes | ( | CAL_Handle | handle, |
| const int_least32_t * | pWaitTimes | ||
| ) |
Sets the wait times.
| [in] | handle | The calibrator (CAL) handle |
| [in] | pWaitTimes | A point to a vector of wait times |
Definition at line 104 of file float/cal.c.
References CAL_numStates, and CAL_setWaitTime().
Referenced by CAL_setParams().
| bool CAL_updateState | ( | CAL_Handle | handle | ) |
Updates the calibrator (CAL) state.
| [in] | handle | The calibrator (CAL) handle |
Definition at line 117 of file 32b/cal.c.
References CAL_getCount_state(), CAL_getFlag_enable(), CAL_getFlag_enableAdcOffset(), CAL_getState(), CAL_getWaitTime(), CAL_isNotIdle(), CAL_reset(), CAL_resetCounter_state(), CAL_setFlag_enableAdcOffset(), CAL_setState(), CAL_State_AdcOffset, CAL_State_Done, CAL_State_Error, and CAL_State_Idle.
1.8.9.1