[DemoCode下载] M031通过NAU88L25播放SPI闪存里的音乐

[复制链接]
553|4
 楼主| xinpian101 发表于 2023-12-25 10:59 | 显示全部楼层 |阅读模式
  1. int32_t main(void)
  2. {

  3.     uint32_t MidDid;
  4.     /* Unlock protected registers */
  5.     SYS_UnlockReg();
  6.     /* Init System, IP clock and multi-function I/O. */
  7.     SYS_Init();


  8.     /* Init UART to 115200-8n1 for print message */
  9.     UART_Open(UART0, 115200);
  10.     QSpiInit();
  11.     MidDid = QSpiReadMidDid();
  12.     printf("\nMID and DID = 0x%x\n\r", MidDid);
  13.     printf("\nstart to play test.wav file");

  14.     /* Init I2C1 to access NAU8822 */
  15.     I2C1_Init();

  16.     /* Reset NAU88L25 codec */
  17.     NAU88L25_Reset();

  18.     /* Set PE.13 low to enable phone jack on NuMaker board. */
  19.     SYS->GPE_MFPH &= ~(SYS_GPE_MFPH_PE13MFP_Msk);
  20.     GPIO_SetMode(PE, BIT13, GPIO_MODE_OUTPUT);
  21.     PE13 = 0;

  22.     /* Initialize NAU88L25 codec */
  23.     CLK_SysTickDelay(20000);
  24.     NAU88L25_Setup();

  25.     /* Configure PDMA and use Scatter-Gather mode */
  26.     PDMA_Init();

  27.     WAVPlayer();

  28.     while (1);
  29. }


 楼主| xinpian101 发表于 2023-12-25 11:06 | 显示全部楼层
EC_M031_Play_Wav_file_from_SPI_Flash_V1.00 (1).zip (2.11 MB, 下载次数: 4)
764056588f1a94f1b2.png
 楼主| xinpian101 发表于 2023-12-25 11:14 | 显示全部楼层
 楼主| xinpian101 发表于 2023-12-25 11:14 | 显示全部楼层
gxbddd 发表于 2023-12-25 11:30 来自手机 | 显示全部楼层
您需要登录后才可以回帖 登录 | 注册

本版积分规则

129

主题

1650

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部