有关ARM9的I/O口设置问题!!

2019-07-16 08:39发布

ARM9写裸机程序的,主要想实现VS1003的解码,但是SPI通信的I/O口貌似设置的不对,一直不出声音,烦请大神指点。以下是定义的I/O口。请大神看看有木有什么问题。

#define Mp3_XRST_OUT        (rGPFCON = rGPFCON & (~(3<<2)) | (1<<2) )//GPF1
#define Mp3_XRST_H                (rGPFDAT = rGPFDAT | (1<<1))
#define Mp3_XRST_L                (rGPFDAT = rGPFDAT & (~(1<<1)))

#define Mp3_MISO_IN                ( rGPECON = rGPECON & (~(3<<22)) | (0<<22) )//GPE11
#define Mp3_MISO_H                (rGPFDAT = rGPFDAT | (1<<11))
#define Mp3_MISO_L                (rGPFDAT = rGPFDAT & (~(1<<11)))

#define Mp3_MOSI_OUT        ( rGPECON = rGPECON & (~(3<<24)) | (1<<24) )//GPE12
#define Mp3_MOSI_H                ( rGPEDAT = rGPEDAT | (1<<12) )
#define Mp3_MOSI_L                ( rGPEDAT = rGPEDAT & (~(1<<12)) )

#define Mp3_SCLK_OUT        ( rGPECON = rGPECON & (~(3<<26)) | (1<<26) )//GPE13
#define Mp3_SCLK_H                ( rGPEDAT = rGPEDAT | (1<<13) )
#define Mp3_SCLK_L                ( rGPEDAT = rGPEDAT & (~(1<<13)) )

#define Mp3_DREQ_IN                (rGPFCON = rGPFCON & (~(3<<8)) | (0<<8) )//GPF4
#define Mp3_DREQ_H                (rGPFDAT = rGPFDAT | (1<<4))
#define Mp3_DREQ_L                (rGPFDAT = rGPFDAT & (~(1<<4)))

#define Mp3_XCS_OUT                ( rGPBCON = rGPBCON & (~(3<<14)) | (1<<14) )//GPB7
#define Mp3_XCS_H                ( rGPBDAT = rGPBDAT | (1<<7) )
#define Mp3_XCS_L                ( rGPBDAT = rGPBDAT & (~(1<<7))  )

#define Mp3_XDCS_OUT        (rGPFCON = rGPFCON & (~(3<<12)) | (1<<12))//GPF6
#define Mp3_XDCS_H                (rGPFDAT = rGPFDAT | (1<<6))
#define Mp3_XDCS_L                (rGPFDAT = rGPFDAT & (~(1<<6)))

友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。