DCL Reference Generator Module (REFGEN) Functions

Module: Digital Control Library (DCL)

More…

Types

Name

enum

DCL_refgen_modes { REFGEN_OFF = 0, REFGEN_STATIC = 1, REFGEN_SINE = 2, REFGEN_SQUARE = 3, REFGEN_SAW = 4, REFGEN_TRIANGLE = 5, REFGEN_PULSE = 6, REFGEN_SINE2 = 7, REFGEN_SINE3 = 8}
Defines the REFGEN operating modes.

typedef _DCL_VOLATILE struct

DCL_REFGEN
Defines the DCL_REFGEN structure.

Functions

Name

_DCL_CODE_ACCESS void

DCL_resetRefgen(DCL_REFGEN * p)
Resets DCL_REFGEN dynamic data.

_DCL_CODE_ACCESS void

DCL_setRefgenRamp(DCL_REFGEN * p, float32_t tgt, float32_t tr)
Loads the REFGEN ramp parameters.

_DCL_CODE_ACCESS void

DCL_setRefgenAmpl(DCL_REFGEN * p, float32_t ampl, float32_t tr)
Loads the REFGEN dynamic amplitude.

_DCL_CODE_ACCESS void

DCL_setRefgenFreq(DCL_REFGEN * p, float32_t freq, float32_t tr)
Loads the REFGEN frequency.

_DCL_CODE_ACCESS void

DCL_setRefgenDuty(DCL_REFGEN * p, float32_t duty)
Loads the REFGEN pulse duty cycle.

_DCL_CODE_ACCESS void

DCL_setRefgenClamp(DCL_REFGEN * p, float32_t max, float32_t min)
Loads the REFGEN output clam limits.

_DCL_CODE_ACCESS void

DCL_setRefgenMode(DCL_REFGEN * p, int16_t mode)
Sets the REFGEN operating mode.

_DCL_CODE_ACCESS void

DCL_runRefgen(DCL_REFGEN * p)
Runs the REFGEN module.

_DCL_CODE_ACCESSfloat32_t

DCL_getRefgenPhaseA(DCL_REFGEN * p)
Returns the phase reference output.

_DCL_CODE_ACCESSfloat32_t

DCL_getRefgenPhaseB(DCL_REFGEN * p)
Returns the phase reference output.

_DCL_CODE_ACCESSfloat32_t

DCL_getRefgenPhaseC(DCL_REFGEN * p)
Returns the phase reference output.

Defines

Name

DCL_REFGEN_MIN_INC
Defines the minimum normalized increment.

DCL_REFGEN_DEFAULTS
Defines default values to initialize the DCL_REFGEN structure.

Detailed Description

Defines the interface to reference generator module (REFGEN)

Types Documentation

enum DCL_refgen_modes

Enumerator

Value

Description

REFGEN_OFF

0

REFGEN_STATIC

1

REFGEN_SINE

2

REFGEN_SQUARE

3

REFGEN_SAW

4

REFGEN_TRIANGLE

5

REFGEN_PULSE

6

REFGEN_SINE2

7

REFGEN_SINE3

8

Defines the REFGEN operating modes.

typedef DCL_REFGEN

typedef _DCL_VOLATILE struct  DCL_REFGEN;

Defines the DCL_REFGEN structure.

Functions Documentation

function DCL_resetRefgen

_DCL_CODE_ACCESS void DCL_resetRefgen(
    DCL_REFGEN * p
)

Resets DCL_REFGEN dynamic data.

Parameters:

function DCL_setRefgenRamp

_DCL_CODE_ACCESS void DCL_setRefgenRamp(
    DCL_REFGEN * p,
    float32_t tgt,
    float32_t tr
)

Loads the REFGEN ramp parameters.

Parameters:

  • p Pointer to the DCL_REFGEN structure

  • tgt The new static reference target

  • tr The time interval to reach the new target

function DCL_setRefgenAmpl

_DCL_CODE_ACCESS void DCL_setRefgenAmpl(
    DCL_REFGEN * p,
    float32_t ampl,
    float32_t tr
)

Loads the REFGEN dynamic amplitude.

Parameters:

  • p Pointer to the DCL_REFGEN structure

  • ampl The new target amplitude

  • tr The time interval to reach the new target

function DCL_setRefgenFreq

_DCL_CODE_ACCESS void DCL_setRefgenFreq(
    DCL_REFGEN * p,
    float32_t freq,
    float32_t tr
)

Loads the REFGEN frequency.

Parameters:

  • p Pointer to the DCL_REFGEN structure

  • freq The new frequency in Hz

  • tr The time interval to reach the new target

function DCL_setRefgenDuty

_DCL_CODE_ACCESS void DCL_setRefgenDuty(
    DCL_REFGEN * p,
    float32_t duty
)

Loads the REFGEN pulse duty cycle.

Parameters:

  • p Pointer to the DCL_REFGEN structure

  • duty The new per-unit duty cycle

function DCL_setRefgenClamp

_DCL_CODE_ACCESS void DCL_setRefgenClamp(
    DCL_REFGEN * p,
    float32_t max,
    float32_t min
)

Loads the REFGEN output clam limits.

Parameters:

  • p Pointer to the DCL_REFGEN structure

  • max The upper limit

  • min The lower limit

function DCL_setRefgenMode

_DCL_CODE_ACCESS void DCL_setRefgenMode(
    DCL_REFGEN * p,
    int16_t mode
)

Sets the REFGEN operating mode.

Parameters:

  • p Pointer to the DCL_REFGEN structure

  • mode The new operating mode

function DCL_runRefgen

_DCL_CODE_ACCESS void DCL_runRefgen(
    DCL_REFGEN * p
)

Runs the REFGEN module.

Parameters:

function DCL_getRefgenPhaseA

_DCL_CODE_ACCESSfloat32_t DCL_getRefgenPhaseA(
    DCL_REFGEN * p
)

Returns the phase reference output.

Parameters:

Return: The phase A reference output

function DCL_getRefgenPhaseB

_DCL_CODE_ACCESSfloat32_t DCL_getRefgenPhaseB(
    DCL_REFGEN * p
)

Returns the phase reference output.

Parameters:

Return: The phase B reference output

function DCL_getRefgenPhaseC

_DCL_CODE_ACCESSfloat32_t DCL_getRefgenPhaseC(
    DCL_REFGEN * p
)

Returns the phase reference output.

Parameters:

Return: The phase C reference output

Macros Documentation

define DCL_REFGEN_MIN_INC

#define DCL_REFGEN_MIN_INC 1.0e-06f

Defines the minimum normalized increment.

define DCL_REFGEN_DEFAULTS

#define DCL_REFGEN_DEFAULTS     {0.0f, 0.0f, 0.0f, 0.0f, 0.0f,  0.0f,       0.0f, \
     0.0f, 1.0f, 1.0f, 1.0f, -1.0f, 0.0f,       0.0f, \
     0.0f, 0.0f, 0.0f, 0.0f, 0.0f,  REFGEN_OFF, &(DCL_CSS)DCL_CSS_DEFAULTS}

Defines default values to initialize the DCL_REFGEN structure.