MotorWare f2806x Module API Documentation
Data Structures | Typedefs | Functions
FEM

Data Structures

struct  _FEM_Obj_
 Defines the frequency of execution monitoring (FEM) object. More...
 

Typedefs

typedef struct _FEM_Obj_ FEM_Obj
 Defines the frequency of execution monitoring (FEM) object. More...
 
typedef struct _FEM_Obj_FEM_Handle
 Defines the FEM handle. More...
 

Functions

static uint32_t FEM_getCnt_z0 (FEM_Handle handle)
 Gets the current count value. More...
 
static uint32_t FEM_getCnt_z1 (FEM_Handle handle)
 Gets the previous count value. More...
 
static uint32_t FEM_getDeltaCnt (FEM_Handle handle)
 Gets the latest delta count measured, cnts. More...
 
static uint32_t FEM_getErrorCnt (FEM_Handle handle)
 Gets the frequency error count. More...
 
static bool FEM_getFlag_freqError (FEM_Handle handle)
 Gets the state of the frequency error flag. More...
 
static uint32_t FEM_getMaxDeltaCnt (FEM_Handle handle)
 Gets the maximum delta count allowed, cnts. More...
 
static uint32_t FEM_getMaxDeltaCntObserved (FEM_Handle handle)
 Gets the maximum delta count observed, cnts. More...
 
static uint32_t FEM_getMinDeltaCnt (FEM_Handle handle)
 Gets the minimum delta count allowed, cnts. More...
 
static uint32_t FEM_getTimerPeriod (FEM_Handle handle)
 Gets the timer period, cnts. More...
 
FEM_Handle FEM_init (void *pMemory, const size_t numBytes)
 Initializes the frequency of execution monitoring (FEM) object. More...
 
static bool FEM_isFreqError (FEM_Handle handle)
 Gets the state of the frequency error flag. More...
 
static void FEM_setCnt_z0 (FEM_Handle handle, const uint32_t cnt)
 Sets the current count value. More...
 
static void FEM_setCnt_z1 (FEM_Handle handle, const uint32_t cnt)
 Sets the previous count value. More...
 
static void FEM_setDeltaCnt (FEM_Handle handle, const uint32_t deltaCnt)
 Sets the delta count value. More...
 
static void FEM_setErrorCnt (FEM_Handle handle, const uint32_t numErrors)
 Sets the error count. More...
 
static void FEM_setFlag_freqError (FEM_Handle handle, const bool state)
 Sets the state of the frequency error flag. More...
 
static void FEM_setMaxDeltaCnt (FEM_Handle handle, const uint32_t maxDeltaCnt)
 Sets the maximum delta count, cnts. More...
 
static void FEM_setMaxDeltaCntObserved (FEM_Handle handle, const uint32_t maxDeltaCnt)
 Sets the maximum delta count observed, cnts. More...
 
static void FEM_setMinDeltaCnt (FEM_Handle handle, const uint32_t minDeltaCnt)
 Sets the minimum delta count, cnts. More...
 
void FEM_setParams (FEM_Handle handle, const float_t timerFreq_Hz, const uint32_t timerPeriod_cnts, const float_t spFreq_Hz, const float_t maxError_Hz)
 Sets the frequency of execution monitoring parameters, cnts. More...
 
static void FEM_setTimerPeriod (FEM_Handle handle, const uint32_t timerPeriod_cnts)
 Sets the timer period, cnts. More...
 
static void FEM_incrErrorCnt (FEM_Handle handle)
 Increments the error counter. More...
 
static void FEM_run (FEM_Handle handle)
 Runs the frequency of execution monitoring. More...
 
static void FEM_updateCnts (FEM_Handle handle, const uint32_t cnt)
 Updates the current and previous count values. More...
 

Detailed Description


Data Structure Documentation

struct _FEM_Obj_

Defines the frequency of execution monitoring (FEM) object.

Definition at line 40 of file fem.h.

Data Fields
uint32_t cnt_z0 the current timer count value, cnts
uint32_t cnt_z1 the previous timer count value, cnts
uint32_t deltaCnt the latest delta count value, cnts
uint32_t errorCnt denotes the number of frequency errors that have been detected
bool flag_freqError a flag to denote that a frequency error has occurred
uint32_t maxDeltaCnt the maximum delta count allowed, cnts
uint32_t maxDeltaCntObserved the maximum delta counts observed, cnts
uint32_t minDeltaCnt the minimum delta count allowed, cnts
uint32_t timerPeriod_cnts the timer period, cnts

Typedef Documentation

typedef struct _FEM_Obj_* FEM_Handle

Defines the FEM handle.

Definition at line 60 of file fem.h.

typedef struct _FEM_Obj_ FEM_Obj

Defines the frequency of execution monitoring (FEM) object.

Function Documentation

static uint32_t FEM_getCnt_z0 ( FEM_Handle  handle)
inlinestatic

Gets the current count value.

Parameters
[in]handleThe frequency of execution monitoring (FEM) handle
Returns
The current timer count value

Definition at line 74 of file fem.h.

References _FEM_Obj_::cnt_z0.

Referenced by FEM_run(), and FEM_updateCnts().

static uint32_t FEM_getCnt_z1 ( FEM_Handle  handle)
inlinestatic

Gets the previous count value.

Parameters
[in]handleThe frequency of execution monitoring (FEM) handle
Returns
The previous ount value

Definition at line 85 of file fem.h.

References _FEM_Obj_::cnt_z1.

Referenced by FEM_run().

static uint32_t FEM_getDeltaCnt ( FEM_Handle  handle)
inlinestatic

Gets the latest delta count measured, cnts.

Parameters
[in]handleThe frequency of execution monitoring (FEM) handle
Returns
The latest delta counts measured, cnts

Definition at line 96 of file fem.h.

References _FEM_Obj_::deltaCnt.

static uint32_t FEM_getErrorCnt ( FEM_Handle  handle)
inlinestatic

Gets the frequency error count.

Parameters
[in]handleThe frequency of execution monitoring (FEM) handle
Returns
The number of frequency errors

Definition at line 107 of file fem.h.

References _FEM_Obj_::errorCnt.

Referenced by FEM_incrErrorCnt().

static bool FEM_getFlag_freqError ( FEM_Handle  handle)
inlinestatic

Gets the state of the frequency error flag.

Parameters
[in]handleThe frequency of execution monitoring (FEM) handle
Returns
The desired state

Definition at line 118 of file fem.h.

References _FEM_Obj_::flag_freqError.

static uint32_t FEM_getMaxDeltaCnt ( FEM_Handle  handle)
inlinestatic

Gets the maximum delta count allowed, cnts.

Parameters
[in]handleThe frequency of execution monitoring (FEM) handle
Returns
The maximum delta count allowed, cnts

Definition at line 129 of file fem.h.

References _FEM_Obj_::maxDeltaCnt.

Referenced by FEM_run().

static uint32_t FEM_getMaxDeltaCntObserved ( FEM_Handle  handle)
inlinestatic

Gets the maximum delta count observed, cnts.

Parameters
[in]handleThe frequency of execution monitoring (FEM) handle
Returns
The maximum delta count allowed, cnts

Definition at line 140 of file fem.h.

References _FEM_Obj_::maxDeltaCntObserved.

Referenced by FEM_run().

static uint32_t FEM_getMinDeltaCnt ( FEM_Handle  handle)
inlinestatic

Gets the minimum delta count allowed, cnts.

Parameters
[in]handleThe frequency of execution monitoring (FEM) handle
Returns
The minimum delta count allowed, cnts

Definition at line 151 of file fem.h.

References _FEM_Obj_::minDeltaCnt.

Referenced by FEM_run().

static uint32_t FEM_getTimerPeriod ( FEM_Handle  handle)
inlinestatic

Gets the timer period, cnts.

Parameters
[in]handleThe frequency of execution monitoring (FEM) handle
Returns
The timer period, cnts

Definition at line 162 of file fem.h.

References _FEM_Obj_::timerPeriod_cnts.

Referenced by FEM_run().

static void FEM_incrErrorCnt ( FEM_Handle  handle)
inlinestatic

Increments the error counter.

Parameters
[in]handleThe frequency of execution monitoring (FEM) handle

Definition at line 320 of file fem.h.

References _FEM_Obj_::errorCnt, FEM_getErrorCnt(), and FEM_setErrorCnt().

Referenced by FEM_run().

FEM_Handle FEM_init ( void *  pMemory,
const size_t  numBytes 
)

Initializes the frequency of execution monitoring (FEM) object.

Parameters
[in]pMemoryA pointer to the base address of the object
[in]numBytesThe object size, bytes
Returns
The handle to the object

Definition at line 21 of file fem.c.

static bool FEM_isFreqError ( FEM_Handle  handle)
inlinestatic

Gets the state of the frequency error flag.

Parameters
[in]handleThe frequency of execution monitoring (FEM) handle
Returns
The desired state

Definition at line 180 of file fem.h.

References _FEM_Obj_::flag_freqError.

static void FEM_run ( FEM_Handle  handle)
inlinestatic
static void FEM_setCnt_z0 ( FEM_Handle  handle,
const uint32_t  cnt 
)
inlinestatic

Sets the current count value.

Parameters
[in]handleThe frequency of execution monitoring (FEM) handle
[in]cntThe current count value

Definition at line 191 of file fem.h.

References _FEM_Obj_::cnt_z0.

Referenced by FEM_setParams(), and FEM_updateCnts().

static void FEM_setCnt_z1 ( FEM_Handle  handle,
const uint32_t  cnt 
)
inlinestatic

Sets the previous count value.

Parameters
[in]handleThe frequency of execution monitoring (FEM) handle
[in]cntThe previous count value

Definition at line 204 of file fem.h.

References _FEM_Obj_::cnt_z1.

Referenced by FEM_setParams(), and FEM_updateCnts().

static void FEM_setDeltaCnt ( FEM_Handle  handle,
const uint32_t  deltaCnt 
)
inlinestatic

Sets the delta count value.

Parameters
[in]handleThe frequency of execution monitoring (FEM) handle
[in]deltaCntThe delta count value

Definition at line 217 of file fem.h.

References _FEM_Obj_::deltaCnt.

Referenced by FEM_run(), and FEM_setParams().

static void FEM_setErrorCnt ( FEM_Handle  handle,
const uint32_t  numErrors 
)
inlinestatic

Sets the error count.

Parameters
[in]handleThe frequency of execution monitoring (FEM) handle
[in]numErrorsThe number of frequency errors

Definition at line 230 of file fem.h.

References _FEM_Obj_::errorCnt.

Referenced by FEM_incrErrorCnt(), and FEM_setParams().

static void FEM_setFlag_freqError ( FEM_Handle  handle,
const bool  state 
)
inlinestatic

Sets the state of the frequency error flag.

Parameters
[in]handleThe frequency of execution monitoring (FEM) handle
[in]stateThe desired state

Definition at line 243 of file fem.h.

References _FEM_Obj_::flag_freqError.

Referenced by FEM_run(), and FEM_setParams().

static void FEM_setMaxDeltaCnt ( FEM_Handle  handle,
const uint32_t  maxDeltaCnt 
)
inlinestatic

Sets the maximum delta count, cnts.

Parameters
[in]handleThe frequency of execution monitoring (FEM) handle
[in]maxDeltaCntThe maximum delta count, cnts

Definition at line 256 of file fem.h.

References _FEM_Obj_::maxDeltaCnt.

Referenced by FEM_setParams().

static void FEM_setMaxDeltaCntObserved ( FEM_Handle  handle,
const uint32_t  maxDeltaCnt 
)
inlinestatic

Sets the maximum delta count observed, cnts.

Parameters
[in]handleThe frequency of execution monitoring (FEM) handle
[in]maxDeltaCntThe maximum delta count observed, cnts

Definition at line 269 of file fem.h.

References _FEM_Obj_::maxDeltaCnt, and _FEM_Obj_::maxDeltaCntObserved.

Referenced by FEM_run(), and FEM_setParams().

static void FEM_setMinDeltaCnt ( FEM_Handle  handle,
const uint32_t  minDeltaCnt 
)
inlinestatic

Sets the minimum delta count, cnts.

Parameters
[in]handleThe frequency of execution monitoring (FEM) handle
[in]minDeltaCntThe minimum delta count, cnts

Definition at line 282 of file fem.h.

References _FEM_Obj_::minDeltaCnt.

Referenced by FEM_setParams().

void FEM_setParams ( FEM_Handle  handle,
const float_t  timerFreq_Hz,
const uint32_t  timerPeriod_cnts,
const float_t  spFreq_Hz,
const float_t  maxError_Hz 
)

Sets the frequency of execution monitoring parameters, cnts.

Parameters
[in]handleThe frequency of execution monitoring (FEM) handle
[in]timerFreq_HzThe timer frequency, Hz
[in]timerPeriod_cntsThe timer period, cnts
[in]spFreq_HzThe setpoint frequency, Hz
[in]maxError_HzThe maximum frequency error, Hz

Definition at line 35 of file fem.c.

References FEM_setCnt_z0(), FEM_setCnt_z1(), FEM_setDeltaCnt(), FEM_setErrorCnt(), FEM_setFlag_freqError(), FEM_setMaxDeltaCnt(), FEM_setMaxDeltaCntObserved(), FEM_setMinDeltaCnt(), and FEM_setTimerPeriod().

static void FEM_setTimerPeriod ( FEM_Handle  handle,
const uint32_t  timerPeriod_cnts 
)
inlinestatic

Sets the timer period, cnts.

Parameters
[in]handleThe frequency of execution monitoring (FEM) handle
[in]timerPeriod_cntsThe timer period, cnts

Definition at line 308 of file fem.h.

References _FEM_Obj_::timerPeriod_cnts.

Referenced by FEM_setParams().

static void FEM_updateCnts ( FEM_Handle  handle,
const uint32_t  cnt 
)
inlinestatic

Updates the current and previous count values.

Parameters
[in]handleThe frequency of execution monitoring (FEM) handle
[in]timerCntThe current count value

Definition at line 393 of file fem.h.

References _FEM_Obj_::cnt_z0, FEM_getCnt_z0(), FEM_setCnt_z0(), and FEM_setCnt_z1().