MotorWare f2806x Module API Documentation

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Data Structures | Typedefs | Enumerations | Functions
svgen_current.h File Reference

Contains the public interface to the Svgen Current module routines. More...

`#include "sw/modules/math/src/32b/math.h"`
`#include "sw/modules/types/src/types.h"`

Go to the source code of this file.

## Data Structures
struct | _SVGENCURRENT_Obj_
| Defines the Svgen Current object. More...

## Typedefs
typedef struct _SVGENCURRENT_Obj_ | SVGENCURRENT_Obj
| Defines the Svgen Current object. More...
typedef struct _SVGENCURRENT_Obj_ * | SVGENCURRENT_Handle
| Defines the Svgen Current handle. More...

## Enumerations
enum | SVGENCURRENT_IgnoreShunt_e { use_all =0, ignore_a, ignore_b, ignore_c, ignore_ab, ignore_ac, ignore_bc }

## Functions
SVGENCURRENT_Handle | SVGENCURRENT_init (void *pMemory, const size_t numBytes)
| Initializes the svgen current object. More...
static void | SVGENCURRENT_setMinWidth (SVGENCURRENT_Handle svgencurrentHandle, const int16_t minwidth)
| Sets the minimum Duty Cycle width that the lower switch can be on before. More...
static void | SVGENCURRENT_setIgnoreShunt (SVGENCURRENT_Handle svgencurrentHandle, const SVGENCURRENT_IgnoreShunt_e ignoreShunt)
| Sets the ignore shunt value. More...
static SVGENCURRENT_IgnoreShunt_e | SVGENCURRENT_getIgnoreShunt (SVGENCURRENT_Handle svgencurrentHandle)
| Gets the ignore shunt value. More...
static int16_t | SVGENCURRENT_getMinWidth (SVGENCURRENT_Handle svgencurrentHandle)
| Gets the minimum Duty Cycle width that the lower switch can be on before. More...
static void | SVGENCURRENT_RunIgnoreShunt (SVGENCURRENT_Handle svgencurrentHandle, uint16_t cmp1, uint16_t cmp2, uint16_t cmp3, uint16_t cmpM1, uint16_t cmpM2, uint16_t cmpM3)
| Gets the svgen current module ignore shunt. More...
static void | SVGENCURRENT_RunRegenCurrent (SVGENCURRENT_Handle svgencurrentHandle, MATH_vec3 *pAdcData)
| Reconstructs the missed measured currents due to a small sampling window. More...

## Detailed Description

Contains the public interface to the Svgen Current module routines.

(C) Copyright 2012, Texas Instruments, Inc.

Definition in file svgen_current.h.

## Data Structure Documentation

struct _SVGENCURRENT_Obj_

Defines the Svgen Current object.

Definition at line 82 of file svgen_current.h.

Data Fields
SVGENCURRENT_IgnoreShunt_e | IgnoreShunt | Output of what shunt or shunts to ignore.
int16_t | MinWidth | The maximum width where a valid measurement cannot be taken.

## Typedef Documentation

typedef struct _SVGENCURRENT_Obj_* SVGENCURRENT_Handle

Defines the Svgen Current handle.

Definition at line 92 of file svgen_current.h.

typedef struct _SVGENCURRENT_Obj_ SVGENCURRENT_Obj

Defines the Svgen Current object.

## Enumeration Type Documentation

enum SVGENCURRENT_IgnoreShunt_e

Enumerator
use_all | Use all shunt measurements.
ignore_a | Ignore the A phase shunt measurement.
ignore_b | Ignore the B phase shunt measurement.
ignore_c | Ignore the C phase shunt measurement.
ignore_ab | Ignore the AB phase shunt measurement.
ignore_ac | Ignore the AC phase shunt measurement.
ignore_bc | Ignore the BC phase shunt measurement.

Definition at line 68 of file svgen_current.h.

## Function Documentation

static SVGENCURRENT_IgnoreShunt_e SVGENCURRENT_getIgnoreShunt | ( | SVGENCURRENT_Handle | svgencurrentHandle | ) |
| inline static

Gets the ignore shunt value.

Parameters

  [in] | svgencurrentHandle | The Svgen Current handle

Returns
  Ignore shunt value

Definition at line 135 of file svgen_current.h.

References _SVGENCURRENT_Obj_::IgnoreShunt.

static int16_t SVGENCURRENT_getMinWidth | ( | SVGENCURRENT_Handle | svgencurrentHandle | ) |
| inline static

Gets the minimum Duty Cycle width that the lower switch can be on before.

the current data is invalid.

Parameters

  [in] | svgencurrentHandle | The Svgen Current handle

Returns
  Integer value of the minimum number of pwm counts

Definition at line 147 of file svgen_current.h.

References _SVGENCURRENT_Obj_::MinWidth.

SVGENCURRENT_Handle SVGENCURRENT_init | ( | void * | pMemory,
|  | const size_t | numBytes
| ) |  |

Initializes the svgen current object.

Parameters

  [in] | *pMemory | Pointer in to the svgen current object
  [in] | numBytes | Size of the object

Definition at line 57 of file svgen_current.c.

static void SVGENCURRENT_RunIgnoreShunt | ( | SVGENCURRENT_Handle | svgencurrentHandle,
|  | uint16_t | cmp1,
|  | uint16_t | cmp2,
|  | uint16_t | cmp3,
|  | uint16_t | cmpM1,
|  | uint16_t | cmpM2,
|  | uint16_t | cmpM3
| ) |  |
| inline static

Gets the svgen current module ignore shunt.

In the pwm structure, the value variable is the on-time of the low fet. A low value is a small on-time for the low switch of the bridge and thus a short current window.

Parameters

  [in] | svgencurrentHandle | The Svgen Current handle
  [in] | cmp1 | compare value 1
  [in] | cmp2 | compare value 2
  [in] | cmp3 | compare value 3
  [in] | cmpM1 | active compare value 1, from mirror register
  [in] | cmpM2 | active compare value 2, from mirror register
  [in] | cmpM3 | active compare value 3, from mirror register

Definition at line 165 of file svgen_current.h.

References ignore_a, ignore_ab, ignore_ac, ignore_b, ignore_bc, ignore_c, _SVGENCURRENT_Obj_::IgnoreShunt, _SVGENCURRENT_Obj_::MinWidth, and use_all.

static void SVGENCURRENT_RunRegenCurrent | ( | SVGENCURRENT_Handle | svgencurrentHandle,
|  | MATH_vec3 * | pAdcData
| ) |  |
| inline static

Reconstructs the missed measured currents due to a small sampling window.

Parameters

  [in] | svgencurrentHandle | The svgen current handle
  [in] | pAdcData | Pointer to the shunt currents

Definition at line 233 of file svgen_current.h.

References ignore_a, ignore_ab, ignore_ac, ignore_b, ignore_bc, ignore_c, _SVGENCURRENT_Obj_::IgnoreShunt, and _MATH_vec3_::value.

static void SVGENCURRENT_setIgnoreShunt | ( | SVGENCURRENT_Handle | svgencurrentHandle,
|  | const SVGENCURRENT_IgnoreShunt_e | ignoreShunt
| ) |  |
| inline static

Sets the ignore shunt value.

Parameters

  [in] | svgencurrentHandle | The Svgen Current handle
  [in] | ignoreShunt | The ignore shunt value

Definition at line 122 of file svgen_current.h.

References _SVGENCURRENT_Obj_::IgnoreShunt.

static void SVGENCURRENT_setMinWidth | ( | SVGENCURRENT_Handle | svgencurrentHandle,
|  | const int16_t | minwidth
| ) |  |
| inline static

Sets the minimum Duty Cycle width that the lower switch can be on before.

the current data is invalid.

Parameters

  [in] | svgencurrentHandle | The Svgen Current handle
  [in] | minwidth | Integer value of the minimum number of pwm counts

Definition at line 109 of file svgen_current.h.

References _SVGENCURRENT_Obj_::MinWidth.