| 
 
| #ifndef DSP_TSMC_PMSM_B2_V4_0_PROJECT_HEADERS_XINTF_H_ #define DSP_TSMC_PMSM_B2_V4_0_PROJECT_HEADERS_XINTF_H_
 
 
 typedef struct  { float32  grid_v1_send_U16;         // WRITE TO FPGA
 float32  grid_v2_send_U16;         // WRITE TO FPGA
 float32  motor_v1_send_U16;         // WRITE TO FPGA
 float32  motor_v2_send_U16;         // WRITE TO FPGA
 float32  motor_v3_send_U16;
 float32  motor_v4_send_U16;
 float32  motor_v5_send_U16;
 float32  motor_v6_send_U16;
 
 // zwx
 float32  motor2_v1_send_U16;         // WRITE TO FPGA
 float32  motor2_v2_send_U16;         // WRITE TO FPGA
 float32  motor2_v3_send_U16;
 float32  motor2_v4_send_U16;
 float32  motor2_v5_send_U16;
 float32  motor2_v6_send_U16;
 //zwx
 
 
 float32  RD_data1;         // READ FROM FPGA
 float32  RD_data2;         // READ FROM FPGA
 float32  RD_data3;         // READ FROM FPGA
 float32  RD_data4;         // READ FROM FPGA
 
 volatile Uint16  * fgrid_v1_send_U16;
 volatile Uint16  * fgrid_v2_send_U16;
 volatile Uint16  * fmotor_v1_send_U16;
 volatile Uint16  * fmotor_v2_send_U16;
 volatile Uint16  * fmotor_v3_send_U16;
 volatile Uint16  * fmotor_v4_send_U16;
 volatile Uint16  * fmotor_v5_send_U16;
 volatile Uint16  * fmotor_v6_send_U16;
 
 //zwx
 volatile Uint16  * fmotor2_v1_send_U16;
 volatile Uint16  * fmotor2_v2_send_U16;
 volatile Uint16  * fmotor2_v3_send_U16;
 volatile Uint16  * fmotor2_v4_send_U16;
 volatile Uint16  * fmotor2_v5_send_U16;
 volatile Uint16  * fmotor2_v6_send_U16;
 //zwx
 
 
 volatile Uint16  * fRD_data1;
 volatile Uint16  * fRD_data2;
 volatile Uint16  * fRD_data3;
 volatile Uint16  * fRD_data4;
 
 } XINTF_TRANS;
 
 
 /*发送地址:0x20FC00 ---- 0x20FD00      */
 /*发送地址:0x20FD01 ---- 0x20FF00      */
 
 #define XINTF_TRANS_INIT_MACRO(v)                                                      \
 v.fgrid_v1_send_U16 = (Uint16 *) 0x20FC01;                                         \
 v.fgrid_v2_send_U16 = (Uint16 *) 0x20FC02;                                         \
 v.fmotor_v1_send_U16 = (Uint16 *) 0x20FC03;                                        \
 v.fmotor_v2_send_U16 = (Uint16 *) 0x20FC04;                                        \
 v.fmotor_v3_send_U16 = (Uint16 *) 0x20FC05;                                        \
 v.fmotor_v4_send_U16 = (Uint16 *) 0x20FC06;                                        \
 v.fmotor_v5_send_U16 = (Uint16 *) 0x20FC07;                                        \
 v.fmotor_v6_send_U16 = (Uint16 *) 0x20FC08;                                        \
 
 
 //zwx
 v.fmotor2_v1_send_U16 = (Uint16 *) 0x20FC09;                                       \
 v.fmotor2_v2_send_U16 = (Uint16 *) 0x20FC0A;                                       \
 v.fmotor2_v3_send_U16 = (Uint16 *) 0x20FC0B;                                        \
 v.fmotor2_v4_send_U16 = (Uint16 *) 0x20FC0C;                                        \
 v.fmotor2_v5_send_U16 = (Uint16 *) 0x20FC0D;                                        \
 v.fmotor2_v6_send_U16 = (Uint16 *) 0x20FC0E;                                        \
 //zwx
 
 
 \
 v.fRD_data1 = (Uint16 *) 0x20FD05;                                                 \
 v.fRD_data2 = (Uint16 *) 0x20FD06;                                                 \
 v.fRD_data3 = (Uint16 *) 0x20FD07;                                                 \
 v.fRD_data4 = (Uint16 *) 0x20FD08;                                                 \
 
 
 /*-----------------------------------------------------------------------------
 Default initalizer for the XINTF_trans object.
 -----------------------------------------------------------------------------*/
 //#define XINTF_TRANS_DEFAULTS { 0,0,0,0,0,0,0,0}
 
 #define XINTF_TRANS_DEFAULTS { 0,0,0,0,0,0,0,0,0,0,0,0,0,0}
 
 // Q12 format
 #define XINTF_WR_MACRO(v)                                                       \
 \
 (* v.fgrid_v1_send_U16) = v.grid_v1_send_U16;                               \
 asm(" RPT #3 || NOP");                                                      \
 (*v.fgrid_v2_send_U16)  = v.grid_v2_send_U16;                               \
 asm(" RPT #3 || NOP");                                                      \
 (*v.fmotor_v1_send_U16)  = v.motor_v1_send_U16;                             \
 asm(" RPT #3 || NOP");                                                      \
 (*v.fmotor_v2_send_U16)  = v.motor_v2_send_U16;                             \
 asm(" RPT #3 || NOP");                                                      \
 (*v.fmotor_v3_send_U16)  = v.motor_v3_send_U16;                             \
 asm(" RPT #3 || NOP");                                                      \
 (*v.fmotor_v4_send_U16)  = v.motor_v4_send_U16;                             \
 asm(" RPT #3 || NOP");                                                      \
 (*v.fmotor_v5_send_U16)  = v.motor_v5_send_U16;                             \
 asm(" RPT #3 || NOP");                                                      \
 (*v.fmotor_v6_send_U16)  = v.motor_v6_send_U16;                             \
 asm(" RPT #3 || NOP");                                                      \
 
 //zwx
 (*v.fmotor2_v1_send_U16)  = v.motor2_v1_send_U16;                           \
 asm(" RPT #3 || NOP");                                                      \
 (*v.fmotor2_v2_send_U16)  = v.motor2_v2_send_U16;                           \
 asm(" RPT #3 || NOP");                                                      \
 (*v.fmotor2_v3_send_U16)  = v.motor2_v3_send_U16;                           \
 asm(" RPT #3 || NOP");                                                      \
 (*v.fmotor2_v4_send_U16)  = v.motor2_v4_send_U16;                           \
 asm(" RPT #3 || NOP");                                                      \
 (*v.fmotor2_v5_send_U16)  = v.motor2_v5_send_U16;                           \
 asm(" RPT #3 || NOP");                                                      \
 (*v.fmotor2_v6_send_U16)  = v.motor2_v6_send_U16;                           \
 asm(" RPT #3 || NOP");                                                      \
 //zwx
 
 
 
 
 // Q12 format
 #define XINTF_RD_MACRO(v)                                                       \
 \
 v.RD_data1=((float32)((* v.fRD_data1)));                                    \
 asm(" RPT #3 || NOP");                                                      \
 v.RD_data2=((float32)((* v.fRD_data2)));                                    \
 asm(" RPT #3 || NOP");                                                      \
 v.RD_data3=((float32)((* v.fRD_data3)));                                    \
 asm(" RPT #3 || NOP");                                                      \
 v.RD_data4=((float32)((* v.fRD_data4)));                                    \
 asm(" RPT #3 || NOP");                                                      \
 
 
 
 
 
 #endif /* DSP_TSMC_PMSM_B2_V4_0_PROJECT_HEADERS_XINTF_H_ */
 
 这是代码,我是按照别人的格式写的,为什么会报错啊?报错什么意思,如何解决啊?
 
 
 | 
 
×本帖子中包含更多资源您需要 登录 才可以下载或查看,没有账号?注册 
  |