This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

pid_reg3.h里面有几条语句看不懂.

#ifndef __PIDREG3_H__
#define __PIDREG3_H__

typedef struct { long Ref; // Input: Reference input
long Fdb; // Input: Feedback input
long Err; // Variable: Error
long Kp; // Parameter: Proportional gain
long Up; // Variable: Proportional output
long Ui; // Variable: Integral output
long Ud; // Variable: Derivative output
long OutPreSat; // Variable: Pre-saturated output
long OutMax; // Parameter: Maximum output
long OutMin; // Parameter: Minimum output
long Out; // Output: PID output
long SatErr; // Variable: Saturated difference
long Ki; // Parameter: Integral gain
long Kc; // Parameter: Integral correction gain
long Kd; // Parameter: Derivative gain
long Up1; // History: Previous proportional output
void (*calc)(); // Pointer to calculation function
} PIDREG3;

typedef PIDREG3 *PIDREG3_handle;
/*-----------------------------------------------------------------------------
Default initalizer for the PIDREG3 object.
-----------------------------------------------------------------------------*/
#define PIDREG3_DEFAULTS { 0, /*Ref*/ \
0, /*Fdb*/ \
0, /*Err*/ \
1.3, /*Ref*/ \
0, /*Ref*/ \
0, /*Ref*/ \
0, /*Ref*/ \
0, /*Ref*/ \
1, /*Ref*/ \
-1, /*Ref*/ \
0, /*Ref*/ \
0, /*Ref*/ \
0.02, /*Ref*/ \
0.5, /*Ref*/ \
1.05, /*Ref*/ \
0, /*Ref*/ \
(void (*)(Uint32))pid_reg3_calc }
/*------------------------------------------------------------------------------
Prototypes for the functions in PIDREG3.C
------------------------------------------------------------------------------*/
void pid_reg3_calc(PIDREG3_handle);

#endif // __PIDREG3_H__

下面几条语句看不懂:

1.void (*calc)(); // Pointer to calculation function

calc前面的“*”起什么作用?为什么不这样用?void calc();

2.(void (*)(Uint32))pid_reg3_calc 

这样的初始化我看不懂,为什么加了Uint32?(void (*)(Uint32))是做什么的?

3.typedef PIDREG3 *PIDREG3_handle;

这个“*”是和PIDREG3一起的还是和PIDREG3_handle一起的?