Other Parts Discussed in Thread: CONTROLSUITE
Hi,
I start to use TI CCS to program for peripheral with embedded C. I use park.h and park.c as an example and paste park.h below. In park.h, why it needs define __PARK_H__, typedef struct PARK, PARK_DEFAULTS, and function void park_calc(PARK_handle)? In park.c, it calculates and updates void park_calc(PARK *v). In the main ISR, it calls park1.calc(&park1).
park.h #ifndef __PARK_H__
#define __PARK_H__
typedef struct { _iq Alpha; // Input: stationary d-axis stator variable
_iq Beta; // Input: stationary q-axis stator variable
_iq Angle; // Input: rotating angle (pu)
_iq Ds; // Output: rotating d-axis stator variable
_iq Qs; // Output: rotating q-axis stator variable
void (*calc)(); // Pointer to calculation function
} PARK;
#define PARK_DEFAULTS { 0, \
0, \
0, \
0, \
0, \
(void (*)(Uint32))park_calc }
void park_calc(PARK_handle);
Thank you,