⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 isd1730.lst

📁 内容摘要: LHD6000主板主芯片程序 ISD1730时序说明: 参考:void Send_1Byte(uchar ucData_s)和uchar Receive_1Byte(void)的说明.
💻 LST
📖 第 1 页 / 共 2 页
字号:
 190   1          ucStatu &= 0xF0;
 191   1          Receive_1Byte();
 192   1          //ucStatu = Receive_1Byte(); //只要录放等状态.
 193   1          ucStatu |= (Receive_1Byte() & 0x0F);
 194   1          
 195   1          pin_ISD_SCLK = 1;
 196   1          pin_SS = 1;
 197   1          pin_MOSI = 0;
 198   1          pin_MISO = 1;
 199   1          return ucStatu; //return (ucStatu&0x0F);
 200   1      }
 201          
 202          /*******************************************************************************
 203          * 函数名称:void WrApcReg(uchar idata ucAPCL,uchar idata ucAPCH)
 204          * 功能介绍:将 ucAPCL,ucAPCH 写入APC.
 205          * 输入参数:需写入 APC 的数据
 206          * 输出参数:无
 207          * 返 回 值:无
 208          * 其它说明:无
 209          * 修改日期      版本号      修改人      修改内容
 210          *-------------------------------------------------------------------------------
 211          *2007-5-29      V0.0        涂常亮      初次编写
 212          *******************************************************************************/
 213          void WrApcReg(uchar idata ucAPCL,uchar idata ucAPCH)
 214          {
 215   1          pin_MISO = 1;
 216   1          pin_MOSI = 0;
 217   1          pin_ISD_SCLK = 1;
 218   1          pin_SS = 0;
 219   1          Send_1Byte(WR_APC1);
 220   1          Send_1Byte(ucAPCL);
 221   1          Send_1Byte(ucAPCH);
 222   1          pin_ISD_SCLK = 1;
 223   1          pin_SS = 1;
 224   1          pin_MOSI = 0;
 225   1          pin_MISO = 1;
 226   1      }
 227          
 228          /*******************************************************************************
 229          * 函数名称:void PlayAdd(uint uiAddStart, uint uiAddEnd)
 230          * 功能介绍:播放地址为 uiAddStart~uiAddEnd之间的语音.
 231          * 输入参数:起始地址和结束地址
 232          * 输出参数:无
 233          * 返 回 值:无
 234          * 其它说明:1730地址只有 0x00~0xFF,高字节被忽略,如地址0x19F会被当作0x9F.
 235          * 修改日期      版本号      修改人      修改内容
 236          *-------------------------------------------------------------------------------
 237          *2007-5-29      V0.0        涂常亮      初次编写
 238          *******************************************************************************/
 239          // !! 1730最高地址只有0xFF,17系列的其它型号可能才用得到 !! .
 240          //void PlayAdd(uint uiAddStart, uint uiAddEnd)
 241          void PlayISD(uchar ucSect, bit FlagSpk)
C51 COMPILER V8.02   ISD1730                                                               05/18/2008 16:43:12 PAGE 5   

 242          {
 243   1          uchar ucAddStart;
 244   1          uchar ucAddEnd;
 245   1          if (g_FlagVoiceOn)
 246   1          {
 247   2              return;
 248   2          }
 249   1          ET0 = 0;
 250   1          g_uiVoiceTimer = 242;
 251   1          if ((0 == ucSect) || (9 < ucSect))
 252   1          {
 253   2              return;
 254   2          }
 255   1          ucAddStart = ucSect<<4;
 256   1          ucAddEnd   = ucAddStart + 0x0E;
 257   1          if (9 == ucSect)
 258   1          {
 259   2              ucAddEnd += 0x10;
 260   2              g_uiVoiceTimer = 482;
 261   2          }
 262   1          ET0 = 1;
 263   1          
 264   1          pin_MISO = 1;
 265   1          pin_MOSI = 0;
 266   1          pin_ISD_SCLK = 1;
 267   1          pin_SS = 0;
 268   1          Send_1Byte(SET_PLAY);
 269   1          Send_1Byte(0x00);
 270   1          Send_1Byte(ucAddStart);
 271   1          //1730最高地址只有0xFF,17的其它系列可能才用得到
 272   1          Send_1Byte(0x00);
 273   1          Send_1Byte(ucAddEnd);
 274   1          Send_1Byte(0x00);
 275   1          pin_ISD_SCLK = 1;
 276   1          pin_SS = 1;
 277   1          pin_MOSI = 0;
 278   1          pin_MISO = 1;
 279   1          
 280   1          g_FlagVoiceOn = 1;
 281   1          
 282   1          if (FlagSpk)
 283   1          {
 284   2              pin_Spk = 0;
 285   2          }
 286   1          else
 287   1          {
 288   2              //P0 = 0x78; //LHD8000拨号时要喇叭响
 289   2              if ((0 == (g_ucAlarmTypes & (0x01 << (ALARM_TYPE_NUM_FORC - 1)))) && (ucSect < 8))
 290   2              {
 291   3                  P0 = 0x3B;
 292   3              }
 293   2              else
 294   2              {
 295   3                  P0 = 0x7B;
 296   3              }
 297   2          }
 298   1      }
 299          
 300          /*******************************************************************************
 301          * 函数名称:void EraseAdd(uint uiAddStart, uint uiAddEnd)
 302          * 功能介绍:擦除地址为 uiAddStart~uiAddEnd之间的语音.
 303          * 输入参数:起始地址和结束地址
C51 COMPILER V8.02   ISD1730                                                               05/18/2008 16:43:12 PAGE 6   

 304          * 输出参数:无
 305          * 返 回 值:无
 306          * 其它说明:不能擦除最后的地址,留一个地址在首地址和末地址之间,否则只能使用函数
 307                      "PlayAdd()"播放声音.其它操作无用.
 308                      1730地址只有 0x00~0xFF,高字节被忽略,如地址0x19F会被当作0x9F.
 309          * 修改日期      版本号      修改人      修改内容
 310          *-------------------------------------------------------------------------------
 311          *2007-5-29      V0.0        涂常亮      初次编写
 312          *******************************************************************************/
 313          // !! 1730最高地址只有0xFF,17系列的其它型号可能才用得到 !! .
 314          
 315          void EraseAdd(void) //只允许用户录最后一段
 316          {
 317   1          pin_MISO = 1;
 318   1          pin_MOSI = 0;
 319   1          pin_ISD_SCLK = 1;
 320   1          pin_SS = 0;
 321   1          Send_1Byte(SET_ERASE);
 322   1          Send_1Byte(0x00);
 323   1          Send_1Byte(0x90);
 324   1          //1730最高地址只有0xFF,17的其它系列可能才用得到
 325   1          Send_1Byte(0x00);
 326   1          Send_1Byte(0xAF);
 327   1          Send_1Byte(0x00);
 328   1          pin_ISD_SCLK = 1;
 329   1          pin_SS = 1;
 330   1          pin_MOSI = 0;
 331   1          pin_MISO = 1;
 332   1          ET0 = 0;
 333   1          g_uiVoiceTimer = 2;
 334   1          ET0 = 1;
 335   1          g_FlagVoiceOn = 1;
 336   1      }
 337          
 338          /*******************************************************************************
 339          * 函数名称:void RecAdd(uint uiAddStart, uint uiAddEnd)
 340          * 功能介绍:在地址为 uiAddStart~uiAddEnd之间录音.
 341          * 输入参数:起始地址和结束地址
 342          * 输出参数:无
 343          * 返 回 值:无
 344          * 其它说明:1730地址只有 0x00~0xFF,高字节被忽略,如地址0x19F会被当作0x9F.
 345          * 修改日期      版本号      修改人      修改内容
 346          *-------------------------------------------------------------------------------
 347          *2007-5-29      V0.0        涂常亮      初次编写
 348          *******************************************************************************/
 349          // !! 1730最高地址只有0xFF,17系列的其它型号可能才用得到 !! .
 350          
 351          void RecAdd(void)
 352          {
 353   1          pin_MISO = 1;
 354   1          pin_MOSI = 0;
 355   1          pin_ISD_SCLK = 1;
 356   1          pin_SS = 0;
 357   1          Send_1Byte(SET_REC);
 358   1          Send_1Byte(0x00);
 359   1          Send_1Byte(0x90);
 360   1          //1730最高地址只有0xFF,17的其它系列可能才用得到
 361   1          Send_1Byte(0x00);
 362   1          Send_1Byte(0xAF);
 363   1          Send_1Byte(0x00);
 364   1          pin_ISD_SCLK = 1;
 365   1          pin_SS = 1;
C51 COMPILER V8.02   ISD1730                                                               05/18/2008 16:43:12 PAGE 7   

 366   1          pin_MOSI = 0;
 367   1          pin_MISO = 1;
 368   1          ET0 = 0;
 369   1          g_uiVoiceTimer = 402;
 370   1          ET0 = 1;
 371   1          g_FlagVoiceOn = 1;
 372   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    354    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----       1
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -