打印

28335在写xintf的头文件时报错?

[复制链接]
489|2
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
#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_ */

这是代码,我是按照别人的格式写的,为什么会报错啊?报错什么意思,如何解决啊?

1获.PNG (41 KB )

1获.PNG

2获.PNG (56.12 KB )

2获.PNG

3获.PNG (71.44 KB )

3获.PNG

捕获.PNG (97.93 KB )

捕获.PNG

使用特权

评论回复

相关帖子

沙发
zwx19950728|  楼主 | 2019-7-11 16:49 | 只看该作者
有人知道吗 谢谢啦

使用特权

评论回复
板凳
zhangmangui| | 2019-7-11 23:17 | 只看该作者
v.是结构体吗    如果不是就可能有问题

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1

主题

2

帖子

0

粉丝