MotorWare f2806x Module API Documentation

- Main Page
- Modules
- Data Structures
- Files

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 | ) |
| inline static

Gets the current count value.

Parameters

  [in] | handle | The 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 | ) |
| inline static

Gets the previous count value.

Parameters

  [in] | handle | The 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 | ) |
| inline static

Gets the latest delta count measured, cnts.

Parameters

  [in] | handle | The 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 | ) |
| inline static

Gets the frequency error count.

Parameters

  [in] | handle | The 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 | ) |
| inline static

Gets the state of the frequency error flag.

Parameters

  [in] | handle | The 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 | ) |
| inline static

Gets the maximum delta count allowed, cnts.

Parameters

  [in] | handle | The 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 | ) |
| inline static

Gets the maximum delta count observed, cnts.

Parameters

  [in] | handle | The 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 | ) |
| inline static

Gets the minimum delta count allowed, cnts.

Parameters

  [in] | handle | The 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 | ) |
| inline static

Gets the timer period, cnts.

Parameters

  [in] | handle | The 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 | ) |
| inline static

Increments the error counter.

Parameters

  [in] | handle | The 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] | pMemory | A pointer to the base address of the object
  [in] | numBytes | The object size, bytes

Returns
  The handle to the object

Definition at line 21 of file fem.c.

static bool FEM_isFreqError | ( | FEM_Handle | handle | ) |
| inline static

Gets the state of the frequency error flag.

Parameters

  [in] | handle | The 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 | ) |
| inline static

Runs the frequency of execution monitoring.

Parameters

  [in] | handle | The frequency of execution monitoring (FEM) handle

Definition at line 334 of file fem.h.

References _FEM_Obj_::cnt_z0, _FEM_Obj_::cnt_z1, _FEM_Obj_::deltaCnt, FEM_getCnt_z0(), FEM_getCnt_z1(), FEM_getMaxDeltaCnt(), FEM_getMaxDeltaCntObserved(), FEM_getMinDeltaCnt(), FEM_getTimerPeriod(), FEM_incrErrorCnt(), FEM_setDeltaCnt(), FEM_setFlag_freqError(), FEM_setMaxDeltaCntObserved(), _FEM_Obj_::maxDeltaCnt, _FEM_Obj_::maxDeltaCntObserved, and _FEM_Obj_::minDeltaCnt.

static void FEM_setCnt_z0 | ( | FEM_Handle | handle,
|  | const uint32_t | cnt
| ) |  |
| inline static

Sets the current count value.

Parameters

  [in] | handle | The frequency of execution monitoring (FEM) handle
  [in] | cnt | The 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
| ) |  |
| inline static

Sets the previous count value.

Parameters

  [in] | handle | The frequency of execution monitoring (FEM) handle
  [in] | cnt | The 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
| ) |  |
| inline static

Sets the delta count value.

Parameters

  [in] | handle | The frequency of execution monitoring (FEM) handle
  [in] | deltaCnt | The 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
| ) |  |
| inline static

Sets the error count.

Parameters

  [in] | handle | The frequency of execution monitoring (FEM) handle
  [in] | numErrors | The 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
| ) |  |
| inline static

Sets the state of the frequency error flag.

Parameters

  [in] | handle | The frequency of execution monitoring (FEM) handle
  [in] | state | The 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
| ) |  |
| inline static

Sets the maximum delta count, cnts.

Parameters

  [in] | handle | The frequency of execution monitoring (FEM) handle
  [in] | maxDeltaCnt | The 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
| ) |  |
| inline static

Sets the maximum delta count observed, cnts.

Parameters

  [in] | handle | The frequency of execution monitoring (FEM) handle
  [in] | maxDeltaCnt | The 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
| ) |  |
| inline static

Sets the minimum delta count, cnts.

Parameters

  [in] | handle | The frequency of execution monitoring (FEM) handle
  [in] | minDeltaCnt | The 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] | handle | The frequency of execution monitoring (FEM) handle
  [in] | timerFreq_Hz | The timer frequency, Hz
  [in] | timerPeriod_cnts | The timer period, cnts
  [in] | spFreq_Hz | The setpoint frequency, Hz
  [in] | maxError_Hz | The 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
| ) |  |
| inline static

Sets the timer period, cnts.

Parameters

  [in] | handle | The frequency of execution monitoring (FEM) handle
  [in] | timerPeriod_cnts | The 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
| ) |  |
| inline static

Updates the current and previous count values.

Parameters

  [in] | handle | The frequency of execution monitoring (FEM) handle
  [in] | timerCnt | The 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().