MotorWare f2806x Module API Documentation

- Main Page
- Modules
- Data Structures
- Files

Data Structures | Typedefs | Functions
OFFSET

## Data Structures
struct | _OFFSET_
| Defines the offset (OFFSET) object. More...

## Typedefs
typedef struct _OFFSET_ | OFFSET_Obj
| Defines the offset (OFFSET) object. More...
typedef struct _OFFSET_Obj_ * | OFFSET_Handle
| Defines the OFFSET handle. More...
typedef struct _OFFSET_ | OFFSET_Obj
| Defines the offset (OFFSET) object. More...
typedef struct _OFFSET_Obj_ * | OFFSET_Handle
| Defines the OFFSET handle. More...

## Functions
_iq | OFFSET_getBeta (OFFSET_Handle handle)
| Gets the beta offset filter coefficient. More...
static _iq | OFFSET_getOffset (OFFSET_Handle handle)
| Gets the offset value. More...
OFFSET_Handle | OFFSET_init (void *pMemory, const size_t numBytes)
| Initializes the offset. More...
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 ADC measurement. More...
void | OFFSET_setBeta (OFFSET_Handle handle, const _iq beta)
| Sets the beta offset filter coefficient. More...
void | OFFSET_setInitCond (OFFSET_Handle handle, const _iq initCond)
| Set the initial condition of the integrator or the value of y[n-1]. More...
void | OFFSET_setOffset (OFFSET_Handle handle, _iq offsetValue)
| Sets the offset value. More...
static void | OFFSET_run (OFFSET_Handle handle, const float_t inputValue)
| Runs an offset filter of the form y[n] = beta*x[n] + (1 - beta)*y[n-1] y -> The DC offset x -> The ADC measurement. More...
void | OFFSET_setBeta (OFFSET_Handle handle, const float_t beta_rad)
| Sets the beta offset filter coefficient. More...
void | OFFSET_setInitCond (OFFSET_Handle handle, const float_t initCond)
| Set the initial condition of the integrator or the value of y[n-1]. More...
void | OFFSET_setOffset (OFFSET_Handle handle, float_t offsetValue)
| Sets the offset value. More...

## Detailed Description

## Data Structure Documentation

struct _OFFSET_

Defines the offset (OFFSET) object.

Definition at line 82 of file 32b/offset.h.

Data Fields
_iq | bias | the bias value (iq)
FILTER_FO_Obj | filter | the first order filter object used.
FILTER_FO_Handle | filterHandle | the first order filter handle.
float_t | value | the offset value
_iq | value | the offset value (iq)

## Typedef Documentation

typedef struct _OFFSET_Obj_* OFFSET_Handle

Defines the OFFSET handle.

Definition at line 83 of file float/offset.h.

typedef struct _OFFSET_Obj_* OFFSET_Handle

Defines the OFFSET handle.

Definition at line 95 of file 32b/offset.h.

typedef struct _OFFSET_ OFFSET_Obj

Defines the offset (OFFSET) object.

typedef struct _OFFSET_ OFFSET_Obj

Defines the offset (OFFSET) object.

## Function Documentation

_iq OFFSET_getBeta | ( | OFFSET_Handle | handle | ) |

Gets the beta offset filter coefficient.

Parameters

  [in] | handle | The offset handle

Returns
  The filter coefficient beta

Definition at line 58 of file 32b/offset.c.

References FILTER_FO_get_b0(), FILTER_FO_getNumCoeffs(), and _OFFSET_::filterHandle.

Referenced by HAL_getOffsetBeta_lp_pu().

static _iq OFFSET_getOffset | ( | OFFSET_Handle | handle | ) |
| inline static

Gets the offset value.

Parameters

  [in] | handle | The offset handle

Returns
  The offset value

Definition at line 115 of file 32b/offset.h.

References _OFFSET_::value.

Referenced by CAL_getOffsetValue_I(), CAL_getOffsetValue_V(), HAL_getOffsetValue(), and HAL_updateAdcBias().

OFFSET_Handle OFFSET_init | ( | void * | pMemory,
|  | const size_t | numBytes
| ) |  |

Initializes the offset.

Parameters

  [in] | pMemory | A pointer to the memory for the offset object
  [in] | numBytes | The number of bytes allocated for the offset object, bytes

Returns
  The offset (OFFSET) object handle

Definition at line 70 of file 32b/offset.c.

References _OFFSET_::filter, FILTER_FO_init(), and _OFFSET_::filterHandle.

Referenced by CAL_init(), and HAL_init().

static void OFFSET_run | ( | OFFSET_Handle | handle,
|  | const float_t | inputValue
| ) |  |
| inline static

Runs an offset filter of the form y[n] = beta*x[n] + (1 - beta)*y[n-1] y -> The DC offset x -> The ADC measurement.

Parameters

  [in] | handle | The offset handle
  [in] | inputValue | The input value to offset filter

Definition at line 125 of file float/offset.h.

References FILTER_FO_run(), _OFFSET_::filterHandle, and _OFFSET_::value.

static void OFFSET_run | ( | OFFSET_Handle | handle,
|  | const _iq | inputValue
| ) |  |
| inline static

Runs an offset filter of the form y[n] = beta*(x[n]+bias) + (1 - beta)*y[n-1] y -> The DC offset x -> The ADC measurement.

Parameters

  [in] | handle | The offset handle
  [in] | inputValue | The input value to offset filter

Definition at line 137 of file 32b/offset.h.

References FILTER_FO_run(), _OFFSET_::filterHandle, and _OFFSET_::value.

Referenced by CAL_run(), and HAL_runOffsetEst().

void OFFSET_setBeta | ( | OFFSET_Handle | handle,
|  | const float_t | beta_rad
| ) |  |

Sets the beta offset filter coefficient.

Parameters

  [in] | handle | The offset handle
  [in] | beta_rad | The offset filter coefficient beta, rad

Definition at line 90 of file float/offset.c.

References FILTER_FO_setDenCoeffs(), FILTER_FO_setNumCoeffs(), and _OFFSET_::filterHandle.

void OFFSET_setBeta | ( | OFFSET_Handle | handle,
|  | const _iq | beta
| ) |  |

Sets the beta offset filter coefficient.

Parameters

  [in] | handle | The offset handle
  [in] | beta | The offset filter coefficient beta

Definition at line 88 of file 32b/offset.c.

References _IQ, FILTER_FO_setDenCoeffs(), FILTER_FO_setNumCoeffs(), and _OFFSET_::filterHandle.

Referenced by CAL_setParams(), and HAL_setOffsetBeta_lp_pu().

void OFFSET_setInitCond | ( | OFFSET_Handle | handle,
|  | const float_t | initCond
| ) |  |

Set the initial condition of the integrator or the value of y[n-1].

Parameters

  [in] | handle | The offset handle
  [in] | initCond | The mean value that the filter will approximate to

Definition at line 104 of file float/offset.c.

References FILTER_FO_setInitialConditions(), _OFFSET_::filterHandle, and _OFFSET_::value.

void OFFSET_setInitCond | ( | OFFSET_Handle | handle,
|  | const _iq | initCond
| ) |  |

Set the initial condition of the integrator or the value of y[n-1].

Parameters

  [in] | handle | The offset handle
  [in] | initCond | The mean value that the filter will approximate to

Definition at line 102 of file 32b/offset.c.

References FILTER_FO_setInitialConditions(), _OFFSET_::filterHandle, and _OFFSET_::value.

Referenced by CAL_setParams(), and HAL_setOffsetInitCond().

void OFFSET_setOffset | ( | OFFSET_Handle | handle,
|  | float_t | offsetValue
| ) |  |

Sets the offset value.

Parameters

  [in] | handle | The offset handle
  [in] | offsetValue | The offset value

Definition at line 115 of file float/offset.c.

References _OFFSET_::value.

void OFFSET_setOffset | ( | OFFSET_Handle | handle,
|  | _iq | offsetValue
| ) |  |

Sets the offset value.

Parameters

  [in] | handle | The offset handle
  [in] | offsetValue | The offset value

Definition at line 113 of file 32b/offset.c.

References _OFFSET_::value.

Referenced by CAL_setParams(), and HAL_setOffsetValue().