原创 ISD1700语音芯片SPI使用总结(五)

2009-4-20 20:48 3037 7 7 分类: MCU/ 嵌入式

MAIN中的FOR循环,芯片初始化省略


if(bFlag_spk)//放音标志


              {


                     for(i=0;i<21;i++)//一共21个放音元素


                     {


                            tmp="Speak"_buf;//取当前放音位置


                            if(tmp<=0x3E)//在正常范围内


                            {


                                   ISD_SetPLAY(tmp);//播放当前位置语音,地址内部对应


                                   do


                                   {


                                          ISD_Rd_Status();//读芯片状态


 


                                          if( bOpen_LED_Mark )


                                          {


                                          Renovate_LED();//八字板亮度调整


                                          }


                                          if (_testbit_( bReceive_Mark ))//执行串口命令


                                                 Execute_LEDcmd2();


                                          if( (1==bOpen_LED_Mark) && (1==bOpen_Mark2))//执行一次八子板显示命令


                                          {


                                          Disp_LED2();


                                          Put_ON_LED();


                                          bOpen_Mark2 = 0;


                                          }


                                   }while( (0 == bRDY) && (0 == bINT_1760) && (1 == bPLAY_1760));


                            //放音结束后跳出


                                   ISD_ClrInt();


                                   if(ISD_SETVolume_Mark)//调整音量标志


                                   {                                                                   


                                          ISD_SendByte(CMD_1760_WR_APC2);


                                    ISD_SendByte(Volume);                 //3位为音量


                                    ISD_SendByte(0x04); //0x04 EOM="0",VALERT=1 0x 0C EOM="1"


                                          sbnISD_SS=1;


                                    DelayX1ms(10);


 


                                          do


                                          {


                                                 ISD_Rd_Status();


                                          }while(0 == bRDY);


 


                                         ISD_ClrInt();


                                          ISD_SETVolume_Mark =0;


                                  


                                   }


                             }


                             else


                            {


                                 


                                  i="21";


                             }


                     }


                     bFlag_spk = 0;                    


              }


 


参考程序网址:


http://www.ourdev.cn/bbs/bbs_content.jsp?bbs_sn=917470&bbs_page_no=1&bbs_id=1006

PARTNER CONTENT

文章评论0条评论)

登录后参与讨论
EE直播间
更多
我要评论
0
7
关闭 站长推荐上一条 /3 下一条