본문 바로가기

[DSP]/DSP28335

[DSP28335 EVM] VS1053모듈이용한 MP3 출력 테스트

[DSP28335 EVM] VS1053모듈이용한 MP3 출력 테스트

 



[EXP-ALL EVM] 보드에서 VS1053 MP3모듈의 핀맵과 [DSP28335 EVM]의 핀맵









TMS320F28335 VS1053 모듈 드라이버 코드
#define VS_DREQ_BIT      BIT3
#define VS_DREQ_PORT     PORTA

#define VS_CS_BIT      BIT1
#define VS_CS_PORT      PORTA

#define VS_XDCS_BIT      BIT2
#define VS_XDCS_PORT     PORTA

#define VS_RST_BIT      
#define VS_RST_PORT 

#define VS1003_CS_H()      Sbi(VS_CS_PORT, VS_CS_BIT)
#define VS1003_CS_L()      Cbi(VS_CS_PORT, VS_CS_BIT)

#define VS1003_XDCS_H()      Sbi(VS_XDCS_PORT, VS_XDCS_BIT)
#define VS1003_XDCS_L()      Cbi(VS_XDCS_PORT, VS_XDCS_BIT)

#define VS1003_RESET_H()     //Sbi(VS_RST_PORT, VS_RST_BIT)
#define VS1003_RESET_L()     //Cbi(VS_RST_PORT, VS_RST_BIT)

#define IsVs1003DataReady()     (GPIOA->IDR&VS_DREQ_BIT)
#define VS1003_DREQ()           ((GPIOB->IDR&SW_BIT))

#define vs1003_enable()      VS1003_CS_L()
#define vs1003_disable()     VS1003_CS_H()


#define VS_SendByte       SPI1_WriteReadByte
#define VS_InitSpi()      SPI1_Init()
#define VS_SpiSpeed_Low()        SPI1_SetSpeed(SPI_SPEED_1MHZ)
#define VS_SpiSpeed_High()     SPI1_SetSpeed(SPI_SPEED_4MHZ)

#define MP3_PORT_INIT() 



TMS320F28335 SD Card 드라이버 코드

#define _SPI0_ENABLE     1
//-----------------------------------------------------------------------------
// SD Card HAL
#define MMC_CS_PORT      GPIOA
#define MMC_CS_BIT      BIT20

#define MMC_CS_INIT()     EALLOW;\
          GpioCtrlRegs.GPAMUX2.bit.GPIO20 = 0;\
          GpioCtrlRegs.GPADIR.bit.GPIO20 = 1;\
          EDIS;\
          MMC_CS_HIGH()
          
          
#define MMC_CS_HIGH()     sbi(MMC_CS_PORT, MMC_CS_BIT)
#define MMC_CS_LOW()     cbi(MMC_CS_PORT, MMC_CS_BIT)


#define MMC_ASSERT_INIT()    MMC_CS_INIT();MMC_CS_HIGH()
#define MMC_ASSERT()     MMC_CS_LOW()
#define MMC_DEASSERT()     MMC_CS_HIGH()


#define MMC_SpiInit()     SPI0_Init()
#define MMC_SendByte     SPI0_WriteReadByte
#define MMC_Send(Data)      SPI0_WriteByte(Data)
#define MMC_Recv()      SPI0_WriteReadByte(0xFF)
#define MMC_RecvP(Data)     MMC_Send(0xFF); (*(Data)=SPI0_ReadByte())
#define MMC_SPISpeed     SPI0_SetSpeed

#define SPI_Mode3()
//-----------------------------------------------------------------------------
반응형