MotorWare f2806x Module API Documentation
Data Structures | Typedefs | Functions
float/cal.h File Reference

Contains the public interface to the calibrator (CAL) module routines. More...

#include "sw/modules/types/src/types.h"
#include "sw/modules/cal/src/cal_states.h"
#include "sw/modules/hal/src/float/hal_data.h"
#include "sw/modules/math/src/float/math.h"
#include "sw/modules/offset/src/float/offset.h"
#include "sw/modules/user/src/float/userParams.h"
#include "user.h"

Go to the source code of this file.

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...
 

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 int_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_HandleCAL_getOffsetHandleAddr_I (CAL_Handle handle)
 Gets the current offset handle address. More...
 
static OFFSET_HandleCAL_getOffsetHandleAddr_V (CAL_Handle handle)
 Gets the voltage offset handle address. More...
 
static float_t CAL_getOffsetValue_I (CAL_Handle handle, const uint_least8_t sensorNumber)
 Gets the current offset value. More...
 
static float_t 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 int_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 int_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 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...
 
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...
 

Detailed Description

Contains the public interface to the calibrator (CAL) module routines.

(C) Copyright 2014, Texas Instruments, Inc.

Definition in file float/cal.h.

Function Documentation

static void CAL_disable ( CAL_Handle  handle)
inlinestatic

Disables the calibrator (CAL) module.

Parameters
[in]handleThe calibrator (CAL) handle

Definition at line 86 of file float/cal.h.

References _CAL_Obj_::flag_enable.

static void CAL_enable ( CAL_Handle  handle)
inlinestatic

Enables the calibrator (CAL) module.

Parameters
[in]handleThe calibrator (CAL) handle

Definition at line 98 of file float/cal.h.

References _CAL_Obj_::flag_enable.

static int_least32_t CAL_getCount_state ( CAL_Handle  handle)
inlinestatic

Gets the state count value.

Parameters
[in]handleThe calibrator (CAL) handle
Returns
The state count value

Definition at line 111 of file float/cal.h.

References _CAL_Obj_::counter_state.

static bool CAL_getFlag_enable ( CAL_Handle  handle)
inlinestatic

Gets the value of the enable flag.

Parameters
[in]handleThe calibrator (CAL) handle
Returns
The enable flag value

Definition at line 122 of file float/cal.h.

References _CAL_Obj_::flag_enable.

static bool CAL_getFlag_enableAdcOffset ( CAL_Handle  handle)
inlinestatic

Gets the value of the enable ADC offset flag.

Parameters
[in]handleThe calibrator (CAL) handle
Returns
The enable ADC offset flag value

Definition at line 133 of file float/cal.h.

References _CAL_Obj_::flag_enableAdcOffset.

static OFFSET_Handle* CAL_getOffsetHandleAddr_I ( CAL_Handle  handle)
inlinestatic

Gets the current offset handle address.

Parameters
[in]handleThe calibrator (CAL) handle
Returns
The current offset handle address

Definition at line 144 of file float/cal.h.

References _CAL_Obj_::offsetHandle_I.

static OFFSET_Handle* CAL_getOffsetHandleAddr_V ( CAL_Handle  handle)
inlinestatic

Gets the voltage offset handle address.

Parameters
[in]handleThe calibrator (CAL) handle
Returns
The voltage offset handle address

Definition at line 155 of file float/cal.h.

References _CAL_Obj_::offsetHandle_V.

static float_t CAL_getOffsetValue_I ( CAL_Handle  handle,
const uint_least8_t  sensorNumber 
)
inlinestatic

Gets the current offset value.

Parameters
[in]handleThe calibrator (CAL) handle
[in]sensorNumberThe sensor number
Returns
The offset value

Definition at line 167 of file float/cal.h.

References OFFSET_getOffset(), and _CAL_Obj_::offsetHandle_I.

static float_t CAL_getOffsetValue_V ( CAL_Handle  handle,
const uint_least8_t  sensorNumber 
)
inlinestatic

Gets the voltage offset value.

Parameters
[in]handleThe calibrator (CAL) handle
[in]sensorNumberThe sensor number
Returns
The offset value

Definition at line 182 of file float/cal.h.

References OFFSET_getOffset(), and _CAL_Obj_::offsetHandle_V.

static CAL_State_e CAL_getState ( CAL_Handle  handle)
inlinestatic

Gets the calibration state.

Parameters
[in]handleThe calibrator (CAL) handle
Returns
The calibration state

Definition at line 196 of file float/cal.h.

References _CAL_Obj_::state.

Referenced by CAL_isError(), CAL_isIdle(), CAL_isNotIdle(), and CAL_run().

static int_least32_t CAL_getWaitTime ( CAL_Handle  handle,
const CAL_State_e  state 
)
inlinestatic

Gets the wait time for a given state.

Parameters
[in]handleThe calibrator (CAL) handle
[in]stateThe state
Returns
The wait time, counts

Definition at line 208 of file float/cal.h.

References _CAL_Obj_::waitTimes.

static void CAL_incrCounter_state ( CAL_Handle  handle)
inlinestatic

Increments the state count value.

Parameters
[in]handleThe calibrator (CAL) handle

Definition at line 218 of file float/cal.h.

References _CAL_Obj_::counter_state.

Referenced by CAL_run().

static bool CAL_isEnabled ( CAL_Handle  handle)
inlinestatic

Returns a boolean value denoting if the module is enabled (true) or not (false)

Parameters
[in]handleThe calibrator (CAL) handle
Returns
The boolean value

Definition at line 249 of file float/cal.h.

References _CAL_Obj_::flag_enable.

static bool CAL_isError ( CAL_Handle  handle)
inlinestatic

Determines if there is a calibrator error.

Parameters
[in]handleThe calibrator (CAL) handle
Returns
A boolean value denoting if there is a calibrator error (true) or not (false)

Definition at line 260 of file float/cal.h.

References CAL_getState(), CAL_State_Error, and _CAL_Obj_::state.

static bool CAL_isIdle ( CAL_Handle  handle)
inlinestatic

Determines if the calibrator is in the idle state.

Parameters
[in]handleThe calibrator (CAL) handle
Returns
A boolean value denoting if the calibrator is in the idle state (true) or not (false)

Definition at line 279 of file float/cal.h.

References CAL_getState(), CAL_State_Idle, and _CAL_Obj_::state.

static bool CAL_isNotIdle ( CAL_Handle  handle)
inlinestatic

Determines if the calibrator is not in the idle state.

Parameters
[in]handleThe calibrator (CAL) handle
Returns
A boolean value denoting if the calibrator is in the idle state (false) or not (true)

Definition at line 296 of file float/cal.h.

References CAL_getState(), CAL_State_Idle, and _CAL_Obj_::state.

static void CAL_resetCounter_state ( CAL_Handle  handle)
inlinestatic

Resets the state count value.

Parameters
[in]handleThe calibrator (CAL) handle

Definition at line 317 of file float/cal.h.

References _CAL_Obj_::counter_state.

static void CAL_run ( CAL_Handle  handle,
const HAL_AdcData_t pAdcData 
)
inlinestatic

Runs the calibrator (CAL) module.

Parameters
[in]handleThe calibrator (CAL) handle

Definition at line 417 of file float/cal.h.

References CAL_getState(), CAL_incrCounter_state(), CAL_State_AdcOffset, _HAL_AdcData_t_::I_A, OFFSET_run(), _CAL_Obj_::offsetHandle_I, _CAL_Obj_::offsetHandle_V, _CAL_Obj_::state, _HAL_AdcData_t_::V_V, and _MATH_vec3_::value.

static void CAL_setFlag_enable ( CAL_Handle  handle,
const bool  value 
)
inlinestatic

Sets the value of the enable flag.

Parameters
[in]handleThe calibrator (CAL) handle
[in]valueThe desired flag value

Definition at line 343 of file float/cal.h.

References _CAL_Obj_::flag_enable.

static void CAL_setFlag_enableAdcOffset ( CAL_Handle  handle,
const bool  value 
)
inlinestatic

Sets the value of the enable ADC offset flag.

Parameters
[in]handleThe calibrator (CAL) handle
[in]valueThe desired flag value

Definition at line 356 of file float/cal.h.

References _CAL_Obj_::flag_enableAdcOffset.

static void CAL_setState ( CAL_Handle  handle,
const CAL_State_e  state 
)
inlinestatic

Sets the calibration state.

Parameters
[in]handleThe calibrator (CAL) handle
[in]stateThe calibration state

Definition at line 376 of file float/cal.h.

References _CAL_Obj_::state.

static void CAL_setup ( CAL_Handle  handle)
inlinestatic

Sets up the calibrator (CAL) module.

Parameters
[in]handleThe calibrator (CAL) handle

Definition at line 408 of file float/cal.h.