Access.lst
上传用户:xmyjxjd
上传日期:2013-05-04
资源大小:1517k
文件大小:130k
- C51 COMPILER V7.06 ACCESS 11/21/2005 13:47:43 PAGE 1
- C51 COMPILER V7.06, COMPILATION OF MODULE ACCESS
- OBJECT MODULE PLACED IN .OutputAccess.obj
- COMPILER INVOKED BY: C:KeilC51BINC51.EXE CodeAccess.c OPTIMIZE(9,SPEED) BROWSE DEBUG OBJECTEXTEND CODE SYMBOLS PRIN
- -T(.OutputAccess.lst) PREPRINT(.OutputAccess.i) OBJECT(.OutputAccess.obj)
- stmt level source
- 1 #define __ACCESS__
- 2
- 3 #include "reg52.h"
- 4 #include "intrins.h"
- 5
- 6 #include "HeaderMAIN_DEF.H"
- 7 #include "HeaderACCESS.h"
- 8 #include "HeaderCONFIG.H"
- 9 #include "HeaderMTV512.H"
- 10 #include "HeaderOSD.H"
- 11 #include "HeaderPower_Ctrl.h"
- 12
- 13 #if(MCU_TYPE == MCU_MTV512)
- ///////////////////////////////////////////////////////////////////////
- // SCL Processor
- - //
- ///////////////////////////////////////////////////////////////////////
- void MCU_WriteI2cScl(bit Status)
- {
- bIIC_SCL = Status;
- }
- ///////////////////////////////////////////////////////////////////////
- // SDA Processor
- - //
- ///////////////////////////////////////////////////////////////////////
- void MCU_WriteI2cSda(bit Status)
- {
- bIIC_SDA = Status;
- }
-
- bit MCU_ReadI2cSda(void)
- {
- return(bIIC_SDA);
- }
- ///////////////////////////////////////////////////////////////////////
- // RTD Reset Processor
- - //
- ///////////////////////////////////////////////////////////////////////
- #if(RESET_TYPE == RESET_IN)
- void MCU_WriteRtdReset(bit Status)
- {
- bRTD_RST = Status;
- }
-
- bit MCU_ReadRtdReset(void)
- {
- return(bRTD_RST);
- }
- #endif
-
-
- ///////////////////////////////////////////////////////////////////////
- // RTD SDIO Processor
- - //
- C51 COMPILER V7.06 ACCESS 11/21/2005 13:47:43 PAGE 2
- ///////////////////////////////////////////////////////////////////////
- /*
- void MCU_WriteRtdSdio(bit Status)
- {
- bRTD_SDIO_0 = Status;
- }
-
- bit MCU_ReadRtdSdio(void)
- {
- return(bRTD_SDIO_0);
- }
- */
- ///////////////////////////////////////////////////////////////////////
- // RTD Sclk Processor
- - //
- ///////////////////////////////////////////////////////////////////////
- void MCU_WriteRtdSclk(bit Status)
- {
- bRTD_SCLK = Status;
- }
- ///////////////////////////////////////////////////////////////////////
- // RTD Scsb Processor
- - //
- ///////////////////////////////////////////////////////////////////////
- void MCU_WriteRtdScsb(bit Status)
- {
- bRTD_SCSB = Status;
- }
- ///////////////////////////////////////////////////////////////////////
- // VIDEO POWER Processor //
- ///////////////////////////////////////////////////////////////////////
- #if (VIDEO_CHIP != VDC_NONE)
- void MCU_WriteVideoPower(bit Status)
- {
- bVDC_PWR = Status;
- }
- #endif
-
- ///////////////////////////////////////////////////////////////////////
- // PANEL POWER Processor /
- -/
- ///////////////////////////////////////////////////////////////////////
- void MCU_WritePanelPower(bit Status)
- {
- bPANEL_PWR = Status;
- bPanel_Status = Status ? 1 : 0;
- }
- /*
- bit MCU_ReadPanelPower(void)
- {
- return(bPANEL_PWR);
- }
- */
- ///////////////////////////////////////////////////////////////////////
- // BACKLIGHT POWER Processor //
- ///////////////////////////////////////////////////////////////////////
- void MCU_WriteBacklightPower(bit Status)
- {
- bLIGHT_PWR = (Status);
- }
-
-
- C51 COMPILER V7.06 ACCESS 11/21/2005 13:47:43 PAGE 3
- ///////////////////////////////////////////////////////////////////////
- // VGA CONNECT Processor //
- ///////////////////////////////////////////////////////////////////////
- bit MCU_ReadVgaConnect(void)
- {
- return(bVGA_CONNECT);
- }
-
- #endif
- 119
- 120 void BitDly(void)
- 121 {
- 122 1 _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_();
- 123 1 _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_();
- 124 1 _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_();
- 125 1 _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_();
- 126 1 }
- 127
- 128 void I2CRead(unsigned char addr, unsigned char index, unsigned char count)
- 129 {
- 130 1 unsigned char n;
- 131 1
- 132 1 if (count)
- 133 1 {
- 134 2 I2CSendAddr(addr, index, 0);
- 135 2
- 136 2 I2CSendAddr(addr, 0, 1);
- 137 2
- 138 2 count = count - 1;
- 139 2
- 140 2 for (n = 0; n < count; n++) Data[n] = I2CGetByte(0);
- 141 2
- 142 2 Data[count] = I2CGetByte(1);
- 143 2
- 144 2 I2CSendStop();
- 145 2 }
- 146 1 }
- 147
- 148 void I2CWrite(unsigned char *array)
- 149 {
- 150 1 unsigned char n, len;
- 151 1
- 152 1 if (3 <= array[0])
- 153 1 {
- 154 2 len = array[0];
- 155 2 I2CSendAddr(array[1], array[2], 0);
- 156 2
- 157 2 for (n = 3; n < len; n++) I2CSendByte(array[n]);
- 158 2
- 159 2 I2CSendStop();
- 160 2 }
- 161 1 }
- 162
- 163
- 164 unsigned char I2CGetByte(unsigned char ack)
- 165 {
- 166 1 unsigned char r, m;
- 167 1
- 168 1 r = 0;
- 169 1 #if(MCU_TYPE == MCU_WINBOND)
- 170 1 for (m = 0; m < 8; m++) // Each bit at a time, MSB first
- 171 1 {
- C51 COMPILER V7.06 ACCESS 11/21/2005 13:47:43 PAGE 4
- 172 2 bIIC_SCL = 1;
- 173 2 BitDly(); // Delay
- 174 2
- 175 2 r = (r << 1) | bIIC_SDA;
- 176 2
- 177 2 bIIC_SCL = 0;
- 178 2 BitDly(); // Delay
- 179 2 }
- 180 1
- 181 1 // Send ACK according to 'ack'
- 182 1 bIIC_SDA = (bit)(ack & 0x01);
- 183 1 BitDly(); // Delay
- 184 1
- 185 1 bIIC_SCL = 1;
- 186 1 BitDly(); // Delay
- 187 1
- 188 1 bIIC_SCL = 0;
- 189 1 BitDly(); // Delay
- 190 1
- 191 1 bIIC_SDA = 1;
- 192 1 #else
-
- for (m = 0; m < 8; m++) // Each bit at a time, MSB first
- {
- MCU_WriteI2cScl(_HIGH);
- BitDly(); // Delay
- r = (r << 1) | MCU_ReadI2cSda();
- MCU_WriteI2cScl(_LOW);
- BitDly(); // Delay
- }
- // Send ACK according to 'ack'
- MCU_WriteI2cSda((bit)(ack & 0x01));
- BitDly(); // Delay
- MCU_WriteI2cScl(_HIGH);
- BitDly(); // Delay
- MCU_WriteI2cScl(_LOW);
- BitDly(); // Delay
- MCU_WriteI2cSda(_HIGH);
-
- #endif
- 212 1
- 213 1 return (r);
- 214 1 }
- 215
- 216 void I2CSendByte(unsigned char send)
- 217 {
- 218 1 unsigned char m;
- 219 1 #if(MCU_TYPE == MCU_WINBOND)
- 220 1 for (m = 0; m < 8; m++)
- 221 1 {
- 222 2 bIIC_SDA = (bit)(send & 0x80); // Send each bit, MSB first
- 223 2 BitDly();
- 224 2
- 225 2 bIIC_SCL = 1;
- 226 2 BitDly();
- 227 2
- 228 2 bIIC_SCL = 0;
- 229 2
- 230 2 send = send << 1;
- 231 2 }
- 232 1
- 233 1 bIIC_SDA = 1;
- C51 COMPILER V7.06 ACCESS 11/21/2005 13:47:43 PAGE 5
- 234 1 bIIC_SCL = 1;
- 235 1 BitDly();
- 236 1
- 237 1 bIIC_SCL = 0;
- 238 1 BitDly();
- 239 1 #else
- for (m = 0; m < 8; m++)
- {
- MCU_WriteI2cSda((bit)(send & 0x80)); // Send each bit, MSB first
- BitDly();
- MCU_WriteI2cScl(_HIGH);
- BitDly();
- MCU_WriteI2cScl(_LOW);;
- send = send << 1;
- }
- MCU_WriteI2cSda(_HIGH);
- MCU_WriteI2cScl(_HIGH);
- BitDly();
- MCU_WriteI2cScl(_LOW);;
- BitDly();
-
- #endif
- 256 1 }
- 257
- 258 void I2CSendAddr(unsigned char addr, unsigned char index, unsigned char rd)
- 259 {
- 260 1 #if(MCU_TYPE == MCU_WINBOND)
- 261 1 bIIC_SCL = 1;
- 262 1 bIIC_SDA = 0; // Start
- 263 1 BitDly();
- 264 1
- 265 1 bIIC_SCL = 0;
- 266 1 I2CSendByte(addr + rd); // Send address byte
- 267 1
- 268 1 if (0 == rd) I2CSendByte(index); // Send index byte
- 269 1 #else
- MCU_WriteI2cScl(_HIGH);
- MCU_WriteI2cSda(_LOW); // Start
- BitDly();
- MCU_WriteI2cScl(_LOW);;
- I2CSendByte(addr + rd); // Send address byte
- if (0 == rd) I2CSendByte(index); // Send index byte
- #endif
- 277 1 }
- 278
- 279 void I2CSendStop(void)
- 280 {
- 281 1 #if(MCU_TYPE == MCU_WINBOND)
- 282 1 bIIC_SDA = 0;
- 283 1 BitDly();
- 284 1
- 285 1 bIIC_SCL = 1;
- 286 1 BitDly();
- 287 1
- 288 1 bIIC_SDA = 1;
- 289 1 BitDly();
- 290 1 #else
- MCU_WriteI2cSda(_LOW);
- BitDly();
- MCU_WriteI2cScl(_HIGH);
- BitDly();
- MCU_WriteI2cSda(_HIGH);
- C51 COMPILER V7.06 ACCESS 11/21/2005 13:47:43 PAGE 6
- BitDly();
- #endif
- 298 1 }
- 299
- 300 unsigned char RTDGetByte(void)
- 301 {
- 302 1
- 303 1 #if(PARALLEL_PORT)
-
- #if(1)
- bRTD_SCLK = 1;
- bRTD_SCLK = 0;
- r0 = bRTD_SDIO_0;
- r1 = bRTD_SDIO_1;
- r2 = bRTD_SDIO_2;
- r3 = bRTD_SDIO_3;
-
- bRTD_SCLK = 1;
- bRTD_SCLK = 0;
- r4 = bRTD_SDIO_0;
- r5 = bRTD_SDIO_1;
- r6 = bRTD_SDIO_2;
- r7 = bRTD_SDIO_3;
-
- bRTD_SCLK = 1;
- #else
-
- bRTD_SCLK = 1;
- bRTD_SCLK = 0;
-
- Reg = P0 & 0x0f;
-
- bRTD_SCLK = 1;
- bRTD_SCLK = 0;
-
- Reg = Reg | ((P0 & 0x0f) << 4);
-
- bRTD_SCLK = 1;
-
- #endif
-
- #else //serial port
- 338 1 bRTD_SCLK = 1;
- 339 1 bRTD_SCLK = 0;
- 340 1 r0 = bRTD_SDIO_0;
- 341 1
- 342 1 bRTD_SCLK = 1;
- 343 1 bRTD_SCLK = 0;
- 344 1 r1 = bRTD_SDIO_0;
- 345 1
- 346 1 bRTD_SCLK = 1;
- 347 1 bRTD_SCLK = 0;
- 348 1 r2 = bRTD_SDIO_0;
- 349 1
- 350 1 bRTD_SCLK = 1;
- 351 1 bRTD_SCLK = 0;
- 352 1 r3 = bRTD_SDIO_0;
- 353 1
- 354 1 bRTD_SCLK = 1;
- 355 1 bRTD_SCLK = 0;
- 356 1 r4 = bRTD_SDIO_0;
- 357 1
- C51 COMPILER V7.06 ACCESS 11/21/2005 13:47:43 PAGE 7
- 358 1 bRTD_SCLK = 1;
- 359 1 bRTD_SCLK = 0;
- 360 1 r5 = bRTD_SDIO_0;
- 361 1
- 362 1 bRTD_SCLK = 1;
- 363 1 bRTD_SCLK = 0;
- 364 1 r6 = bRTD_SDIO_0;
- 365 1
- 366 1 bRTD_SCLK = 1;
- 367 1 bRTD_SCLK = 0;
- 368 1 r7 = bRTD_SDIO_0;
- 369 1
- 370 1 bRTD_SCLK = 1;
- 371 1
- 372 1 #endif
- 373 1
- 374 1
- 375 1 return Reg;
- 376 1 }
- 377
- 378 void RTDSendByte(unsigned char send)
- 379 {
- 380 1
- 381 1
- 382 1 #if(PARALLEL_PORT)
-
- #if(1)
- bRTD_SDIO_0 = (bit)(send & 0x01);
- bRTD_SDIO_1 = (bit)(send & 0x02);
- bRTD_SDIO_2 = (bit)(send & 0x04);
- bRTD_SDIO_3 = (bit)(send & 0x08);
- bRTD_SCLK = 1;
- bRTD_SCLK = 0;
-
- bRTD_SDIO_0 = (bit)(send & 0x10);
- bRTD_SDIO_1 = (bit)(send & 0x20);
- bRTD_SDIO_2 = (bit)(send & 0x40);
- bRTD_SDIO_3 = (bit)(send & 0x80);
- bRTD_SCLK = 1;
- bRTD_SCLK = 0;
-
- bRTD_SDIO_0 = 1;
- bRTD_SDIO_1 = 1;
- bRTD_SDIO_2 = 1;
- bRTD_SDIO_3 = 1;
- bRTD_SCLK = 1;
- #else
- unsigned char ucTemp;
-
- ucTemp = P0 & 0xf0;
-
- P0 = ucTemp | (send & 0x0f);
- bRTD_SCLK = 1;
- bRTD_SCLK = 0;
-
- P0 = ucTemp | (send >> 4);
-
- bRTD_SCLK = 1;
- bRTD_SCLK = 0;
-
- P0 = ucTemp | 0x0f;
- bRTD_SCLK = 1;
- C51 COMPILER V7.06 ACCESS 11/21/2005 13:47:43 PAGE 8
-
- #endif
-
- #else //serial port
- 424 1 bRTD_SDIO_0 = (bit)(send & 0x01);
- 425 1 bRTD_SCLK = 1;
- 426 1 bRTD_SCLK = 0;
- 427 1
- 428 1 bRTD_SDIO_0 = (bit)(send & 0x02);
- 429 1 bRTD_SCLK = 1;
- 430 1 bRTD_SCLK = 0;
- 431 1
- 432 1 bRTD_SDIO_0 = (bit)(send & 0x04);
- 433 1 bRTD_SCLK = 1;
- 434 1 bRTD_SCLK = 0;
- 435 1
- 436 1 bRTD_SDIO_0 = (bit)(send & 0x08);
- 437 1 bRTD_SCLK = 1;
- 438 1 bRTD_SCLK = 0;
- 439 1
- 440 1 bRTD_SDIO_0 = (bit)(send & 0x10);
- 441 1 bRTD_SCLK = 1;
- 442 1 bRTD_SCLK = 0;
- 443 1
- 444 1 bRTD_SDIO_0 = (bit)(send & 0x20);
- 445 1 bRTD_SCLK = 1;
- 446 1 bRTD_SCLK = 0;
- 447 1
- 448 1 bRTD_SDIO_0 = (bit)(send & 0x40);
- 449 1 bRTD_SCLK = 1;
- 450 1 bRTD_SCLK = 0;
- 451 1
- 452 1 bRTD_SDIO_0 = (bit)(send & 0x80);
- 453 1 bRTD_SCLK = 1;
- 454 1 bRTD_SCLK = 0;
- 455 1
- 456 1 bRTD_SDIO_0 = 1;
- 457 1 bRTD_SCLK = 1;
- 458 1
- 459 1 #endif
- 460 1
- 461 1
- 462 1 }
- 463
- 464 void RTDSendAddr(unsigned char addr, unsigned char rd, unsigned char inc) // rd : 0 - Write, 1 - Read
- 465 {
- 466 1
- 467 1 #if(PARALLEL_PORT)
-
- RTDSendByte(addr);
-
- bRTD_SDIO_0 = (bit)(rd & 0x01);
- bRTD_SDIO_1 = (bit)(inc & 0x01);
-
- bRTD_SCLK = 0;
-
- bRTD_SDIO_0 = 1;
- bRTD_SDIO_1 = 1;
- bRTD_SCLK = 1;
- #else // serial port
- 480 1 RTDSendByte(addr);
- 481 1
- C51 COMPILER V7.06 ACCESS 11/21/2005 13:47:43 PAGE 9
- 482 1 bRTD_SDIO_0 = 1;
- 483 1 bRTD_SCLK = 1;
- 484 1 bRTD_SDIO_0 = (bit)(rd & 0x01);
- 485 1 bRTD_SCLK = 1;
- 486 1 bRTD_SCLK = 0;
- 487 1 bRTD_SDIO_0 = (bit)(inc & 0x01);
- 488 1 bRTD_SCLK = 1;
- 489 1 bRTD_SCLK = 0;
- 490 1 bRTD_SDIO_0 = 1;
- 491 1 #endif
- 492 1
- 493 1
- 494 1 }
- 495
- 496 void RTDSendStop(void)
- 497 {
- 498 1
- 499 1 bRTD_SCLK = 0;
- 500 1 bRTD_SCLK = 1;
- 501 1 bRTD_SCSB = 1;
- 502 1
- 503 1 }
- 504
- 505 void RTDRead(unsigned char index, unsigned char count, unsigned char inc)
- 506 {
- 507 1 if (count)
- 508 1 {
- 509 2 bRTD_SCSB = 0;
- 510 2
- 511 2 RTDSendAddr(index, 1, inc);
- 512 2
- 513 2 index = 0;
- 514 2 do
- 515 2 {
- 516 3 Data[index++] = RTDGetByte();
- 517 3 }
- 518 2 while (--count);
- 519 2
- 520 2 RTDSendStop();
- 521 2
- 522 2 }
- 523 1 }
- 524
- 525 void RTDWrite(unsigned char data *array)
- 526 {
- 527 1
- 528 1 unsigned char len, m;
- 529 1
- 530 1 do
- 531 1 {
- 532 2 if (0 == (array[0] & 0xfc)) return;
- 533 2
- 534 2 len = array[0] - 3;
- 535 2 array = array + 1;
- 536 2 bRTD_SCSB = 0;
- 537 2
- 538 2
- 539 2 if (BURST == array[0])
- 540 2 {
- 541 3 RTDSendAddr(array[1], 0, N_INC);
- 542 3
- 543 3 array = array + 2;
- C51 COMPILER V7.06 ACCESS 11/21/2005 13:47:43 PAGE 10
- 544 3 m = array[0];
- 545 3
- 546 3 do
- 547 3 {
- 548 4 RTDSendByte(m);
- 549 4 }
- 550 3 while (--len);
- 551 3
- 552 3 array = array + 1;
- 553 3 }
- 554 2 else
- 555 2 {
- 556 3 RTDSendAddr(array[1], 0, array[0]);
- 557 3
- 558 3 array = array + 2;
- 559 3 do
- 560 3 {
- 561 4 RTDSendByte(*array++);
- 562 4 }
- 563 3 while (--len);
- 564 3 }
- 565 2 RTDSendStop();
- 566 2 }
- 567 1 while (1);
- 568 1 }
- 569
- 570 void RTDCodeW(unsigned char code *array)
- 571 {
- 572 1 unsigned char len, m;
- 573 1
- 574 1 do
- 575 1 {
- 576 2 if (0 == (array[0] & 0xfc)) return;
- 577 2
- 578 2 len = array[0] - 3;
- 579 2 array = array + 1;
- 580 2 bRTD_SCSB = 0;
- 581 2
- 582 2 if (BURST == array[0])
- 583 2 {
- 584 3 RTDSendAddr(array[1], 0, N_INC);
- 585 3
- 586 3 array = array + 2;
- 587 3 m = array[0];
- 588 3
- 589 3 do
- 590 3 {
- 591 4 RTDSendByte(m);
- 592 4 }
- 593 3 while (--len);
- 594 3
- 595 3 array = array + 1;
- 596 3 }
- 597 2 else
- 598 2 {
- 599 3 RTDSendAddr(array[1], 0, array[0]);
- 600 3
- 601 3 array = array + 2;
- 602 3 do
- 603 3 {
- 604 4 RTDSendByte(*array++);
- 605 4 }
- C51 COMPILER V7.06 ACCESS 11/21/2005 13:47:43 PAGE 11
- 606 3 while (--len);
- 607 3 }
- 608 2 RTDSendStop();
- 609 2
- 610 2 }
- 611 1 while (1);
- 612 1 }
- 613
- 614 void RTDOSDW(unsigned char code *array)
- 615 {
- 616 1 unsigned char len;
- 617 1 do
- 618 1 {
- 619 2 if (array[0] == _end_) return;
- 620 2
- 621 2 bRTD_SCSB = 0;
- 622 2 RTDSendAddr(OSD_ROW_90,WRITE,Y_INC);
- 623 2 RTDSendByte(*array++);
- 624 2 RTDSendByte(*array++);
- 625 2
- 626 2 RTDSendStop();
- 627 2
- 628 2 bRTD_SCSB = 0;
- 629 2 RTDSendAddr(OSD_DATA_92,WRITE,N_INC);
- 630 2 do
- 631 2 {
- 632 3 if(array[0] == _ext_)
- 633 3 {
- 634 4 if(array[2] == _bb_)
- 635 4 {
- 636 5 do
- 637 5 {
- 638 6 len = array[3] - 1;
- 639 6 RTDSendByte(_ext_ + array[1]);
- 640 6 }while(len--);
- 641 5
- 642 5 array += 4;
- 643 5 }
- 644 4 else
- 645 4 {
- 646 5 RTDSendByte(_ext_ + array[1]);
- 647 5 array += 2;
- 648 5 }
- 649 4 }
- 650 3 else if(array[1] == _bb_)
- 651 3 {
- 652 4 len = array[2] - 1;
- 653 4 do
- 654 4 {
- 655 5 RTDSendByte(*array);
- 656 5 }while(len--);
- 657 4
- 658 4 array += 3;
- 659 4 }
- 660 3 else
- 661 3 RTDSendByte(*array++);
- 662 3
- 663 3
- 664 3 }while(array[0] != _nn_);
- 665 2 array +=1 ;
- 666 2 RTDSendStop();
- 667 2
- C51 COMPILER V7.06 ACCESS 11/21/2005 13:47:43 PAGE 12
- 668 2 }
- 669 1 while (1);
- 670 1
- 671 1 }
- 672
- 673
- 674 void RTDSetByte(unsigned char addr, unsigned char val)
- 675 {
- 676 1 // Set Write Address
- 677 1 bRTD_SCSB = 0;
- 678 1
- 679 1 RTDSendAddr(addr, 0, 1);
- 680 1
- 681 1 // Write one Byte
- 682 1 RTDSendByte(val);
- 683 1
- 684 1 RTDSendStop();
- 685 1
- 686 1 }
- 687
- 688 void RTDSetBit(unsigned char addr, unsigned char and, unsigned char or)
- 689 {
- 690 1 // Set Read Address
- 691 1 bRTD_SCSB = 0;
- 692 1 RTDSendAddr(addr, 1, 1);
- 693 1
- 694 1 // Read 1 Byte
- 695 1 or = (RTDGetByte() & and) | or;
- 696 1
- 697 1 RTDSendStop();
- 698 1
- 699 1 // Set Write Address
- 700 1 bRTD_SCSB = 0;
- 701 1 RTDSendAddr(addr, 0, 1);
- 702 1
- 703 1 // Write one Byte
- 704 1 RTDSendByte(or);
- 705 1
- 706 1 RTDSendStop();
- 707 1
- 708 1
- 709 1 }
- 710
- 711 #if(VLC_COMPRESS)
- 712 void Load_VLC_Font(unsigned char code *array, unsigned int start, unsigned int length)
- 713 {
- 714 1 unsigned char n,m;
- 715 1 unsigned char ucTemp[3];
- 716 1 unsigned char idata ucTemp_VLD[3];
- 717 1
- 718 1 #if(PARALLEL_PORT)
- // unsigned char ucTemp1;
- #endif
- 721 1
- 722 1 start += FONT_BASE_ADDRESS;
- 723 1
- 724 1 bRTD_SCSB = 0;
- 725 1 RTDSendAddr(OSD_ROW_90, WRITE, Y_INC);
- 726 1 ucTemp[0] = (unsigned char)((start >> 8) & 0x000f) | 0xd0;
- 727 1 RTDSendByte(ucTemp[0]);
- 728 1 ucTemp[0] = (unsigned char)(start & 0x00ff);
- 729 1 RTDSendByte(ucTemp[0]);
- C51 COMPILER V7.06 ACCESS 11/21/2005 13:47:43 PAGE 13
- 730 1
- 731 1 RTDSendStop();
- 732 1
- 733 1 bRTD_SCSB = 0;
- 734 1 RTDSendAddr(OSD_DATA_92, WRITE, N_INC);
- 735 1
- 736 1 ucCnt = 0;
- 737 1 uiCount = 0;
- 738 1 bBit = 0;
- 739 1 ucByte_Temp = 0;
- 740 1
- 741 1 do
- 742 1 {
- 743 2 for(m=0; m<9; m++)
- 744 2 {
- 745 3
- 746 3 ucTemp_VLD[0] = Get_VLD(array) << 4;
- 747 3 ucTemp_VLD[0] |= Get_VLD(array);
- 748 3 ucTemp_VLD[1] = Get_VLD(array) << 4;
- 749 3 ucTemp_VLD[1] |= Get_VLD(array);
- 750 3 ucTemp_VLD[2] = Get_VLD(array) << 4;
- 751 3 ucTemp_VLD[2] |= Get_VLD(array);
- 752 3
- 753 3 //Rearrange the byte order
- 754 3 ucTemp[0] = (ucTemp_VLD[1] << 4) | (ucTemp_VLD[2] & 0x0f);
- 755 3 ucTemp[1] = (ucTemp_VLD[2] & 0xf0) | (ucTemp_VLD[0] & 0x0f);
- 756 3 ucTemp[2] = (ucTemp_VLD[0] & 0xf0) | (ucTemp_VLD[1] >> 4);
- 757 3
- 758 3 for(n=0;n<3;n++)
- 759 3 {
- 760 4 #if(PARALLEL_PORT)
-
- #if(KINGMICE)
- bRTD_SDIO_0 = (bit)(ucTemp[n] & 0x01);
- bRTD_SDIO_1 = (bit)(ucTemp[n] & 0x02);
- bRTD_SDIO_2 = (bit)(ucTemp[n] & 0x04);
- bRTD_SDIO_3 = (bit)(ucTemp[n] & 0x08);
- bRTD_SCLK = 1;
- bRTD_SCLK = 0;
- bRTD_SDIO_0 = (bit)(ucTemp[n] & 0x10);
- bRTD_SDIO_1 = (bit)(ucTemp[n] & 0x20);
- bRTD_SDIO_2 = (bit)(ucTemp[n] & 0x40);
- bRTD_SDIO_3 = (bit)(ucTemp[n] & 0x80);
- bRTD_SCLK = 1;
- bRTD_SCLK = 0;
- bRTD_SDIO_0 = 1;
- bRTD_SDIO_1 = 1;
- bRTD_SDIO_2 = 1;
- bRTD_SDIO_3 = 1;
- bRTD_SCLK = 1;
- #else
- ucTemp1 = P0 & 0xf0;
-
- P0 = ucTemp1 | (ucTemp[n] & 0x0f);
- bRTD_SCLK = 1;
- bRTD_SCLK = 0;
- P0 = ucTemp1 | (ucTemp[n] >> 4);
- bRTD_SCLK = 1;
- bRTD_SCLK = 0;
- P0 = ucTemp1 | 0x0f;
- bRTD_SCLK = 1;
- #endif
- C51 COMPILER V7.06 ACCESS 11/21/2005 13:47:43 PAGE 14
-
- #else
- 794 4 bRTD_SDIO_0 = (bit)(ucTemp[n] & 0x01);
- 795 4 bRTD_SCLK = 1;
- 796 4 bRTD_SCLK = 0;
- 797 4 bRTD_SDIO_0 = (bit)(ucTemp[n] & 0x02);
- 798 4 bRTD_SCLK = 1;
- 799 4 bRTD_SCLK = 0;
- 800 4 bRTD_SDIO_0 = (bit)(ucTemp[n] & 0x04);
- 801 4 bRTD_SCLK = 1;
- 802 4 bRTD_SCLK = 0;
- 803 4 bRTD_SDIO_0 = (bit)(ucTemp[n] & 0x08);
- 804 4 bRTD_SCLK = 1;
- 805 4 bRTD_SCLK = 0;
- 806 4 bRTD_SDIO_0 = (bit)(ucTemp[n] & 0x10);
- 807 4 bRTD_SCLK = 1;
- 808 4 bRTD_SCLK = 0;
- 809 4 bRTD_SDIO_0 = (bit)(ucTemp[n] & 0x20);
- 810 4 bRTD_SCLK = 1;
- 811 4 bRTD_SCLK = 0;
- 812 4 bRTD_SDIO_0 = (bit)(ucTemp[n] & 0x40);
- 813 4 bRTD_SCLK = 1;
- 814 4 bRTD_SCLK = 0;
- 815 4 bRTD_SDIO_0 = (bit)(ucTemp[n] & 0x80);
- 816 4 bRTD_SCLK = 1;
- 817 4 bRTD_SCLK = 0;
- 818 4 bRTD_SDIO_0 = 1;
- 819 4 bRTD_SCLK = 1;
- 820 4 #endif
- 821 4 }
- 822 3 }
- 823 2 }
- 824 1 while (--length);
- 825 1
- 826 1 RTDSendStop();
- 827 1
- 828 1 }
- 829
- 830 unsigned char Get_VLD(unsigned char code *array)
- 831 {
- 832 1 unsigned char data ucZero_Cnt = 0;
- 833 1 bit bSec_Part = 0;
- 834 1
- 835 1 while(1)
- 836 1 {
- 837 2 if( ucCnt == 0 )
- 838 2 {
- 839 3 ucByte_Temp = *(array + uiCount);
- 840 3 ucCnt = 0x80;
- 841 3 uiCount++;
- 842 3 }
- 843 2
- 844 2 while( ucCnt > 0 )
- 845 2 {
- 846 3 bBit = (bit)(ucByte_Temp & ucCnt);
- 847 3 ucCnt >>= 1;
- 848 3
- 849 3 if( (bBit) && (bSec_Part == 0) )
- 850 3 {
- 851 4 bSec_Part = 1;
- 852 4 }
- 853 3 else
- C51 COMPILER V7.06 ACCESS 11/21/2005 13:47:43 PAGE 15
- 854 3 {
- 855 4 ucZero_Cnt++;
- 856 4 }
- 857 3
- 858 3 if( bSec_Part == 1 )
- 859 3 {
- 860 4 switch(ucZero_Cnt)
- 861 4 {
- 862 5 case 0:
- 863 5 bSec_Part = 0;
- 864 5 ucZero_Cnt = 0;
- 865 5 return 0;
- 866 5
- 867 5 case 1:
- 868 5 Getbit(array);
- 869 5 bSec_Part = 0;
- 870 5 ucZero_Cnt = 0;
- 871 5
- 872 5 if(!bBit)
- 873 5 {
- 874 6 return 1;
- 875 6 }
- 876 5 else
- 877 5 {
- 878 6 return 15;
- 879 6 }
- 880 5
- 881 5 case 2:
- 882 5 Getbit(array);
- 883 5 bSec_Part = 0;
- 884 5 ucZero_Cnt = 0;
- 885 5
- 886 5 if(!bBit)
- 887 5 {
- 888 6 return 2;
- 889 6 }
- 890 5 else
- 891 5 {
- 892 6 return 8;
- 893 6 }
- 894 5
- 895 5 case 3:
- 896 5 Getbit(array);
- 897 5 bSec_Part = 0;
- 898 5 ucZero_Cnt = 0;
- 899 5
- 900 5 if(!bBit)
- 901 5 {
- 902 6 return 12;
- 903 6 }
- 904 5 else
- 905 5 {
- 906 6 return 7;
- 907 6 }
- 908 5
- 909 5 case 4:
- 910 5 Getbit(array);
- 911 5 bSec_Part = 0;
- 912 5 ucZero_Cnt = 0;
- 913 5
- 914 5 if(bBit)
- 915 5 {
- C51 COMPILER V7.06 ACCESS 11/21/2005 13:47:43 PAGE 16
- 916 6 Getbit(array);
- 917 6
- 918 6 if(!bBit)
- 919 6 {
- 920 7 return 4;
- 921 7 }
- 922 6 else
- 923 6 {
- 924 7 return 9;
- 925 7 }
- 926 6 }
- 927 5 else
- 928 5 {
- 929 6 Getbit(array);
- 930 6
- 931 6 if(!bBit)
- 932 6 {
- 933 7 Getbit(array);
- 934 7
- 935 7 if(!bBit)
- 936 7 {
- 937 8 return 3;
- 938 8 }
- 939 7 else
- 940 7 {
- 941 8 return 11;
- 942 8 }
- 943 7
- 944 7 }
- 945 6 else
- 946 6 {
- 947 7 Getbit(array);
- 948 7
- 949 7 if(!bBit)
- 950 7 {
- 951 8 return 10;
- 952 8 }
- 953 7 else
- 954 7 {
- 955 8 return 5;
- 956 8 }
- 957 7
- 958 7 }
- 959 6 }
- 960 5
- 961 5 case 5:
- 962 5 Getbit(array);
- 963 5 bSec_Part = 0;
- 964 5 ucZero_Cnt = 0;
- 965 5
- 966 5 if(bBit)
- 967 5 {
- 968 6 Getbit(array);
- 969 6
- 970 6 if(!bBit)
- 971 6 {
- 972 7 return 14;
- 973 7 }
- 974 6 else
- 975 6 {
- 976 7 return 13;
- 977 7 }
- C51 COMPILER V7.06 ACCESS 11/21/2005 13:47:43 PAGE 17
- 978 6 }
- 979 5 else
- 980 5 {
- 981 6 Getbit(array);
- 982 6 if(bBit)
- 983 6 {
- 984 7 return 6;
- 985 7 }
- 986 6 }
- 987 5 }
- 988 4 }
- 989 3 }
- 990 2 }
- 991 1 }
- 992
- 993 void Getbit(unsigned char code *array)
- 994 {
- 995 1 if( ucCnt == 0 )
- 996 1 {
- 997 2 ucByte_Temp = *(array + uiCount);
- 998 2 ucCnt = 0x80;
- 999 2 uiCount++;
- 1000 2 }
- 1001 1
- 1002 1 bBit = (bit)(ucByte_Temp & ucCnt);
- 1003 1 ucCnt >>= 1;
- 1004 1
- 1005 1 }
- 1006 #else
- //length represent the number of character
- // character number of 1 bit font = 1
- // character number of 2 bit font = 2
- // character number of 4 bit font = 4
- // length = (1 bit font amount) x 1 + (2 bit font amount) x 2 + (4 bit font amount) x 4
- void Load_Font(unsigned char code *array, unsigned int start, unsigned int length)
- {
- unsigned char n,m;
- unsigned char ucTemp[3];
- #if(PARALLEL_PORT)
- // unsigned char ucTemp1;
- #endif
-
- start = start * 9;
- start += FONT_BASE_ADDRESS;
-
- bRTD_SCSB = 0;
- RTDSendAddr(OSD_ROW_90, WRITE, Y_INC);
- ucTemp[0] = (unsigned char)((start >> 8) & 0x000f) | 0xd0;
- RTDSendByte(ucTemp[0]);
- ucTemp[0] = (unsigned char)(start & 0x00ff);
- RTDSendByte(ucTemp[0]);
-
- RTDSendStop();
-
- bRTD_SCSB = 0;
- RTDSendAddr(OSD_DATA_92, WRITE, N_INC);
-
- do
- {
- for(m=0; m<9; m++)
- {
- //Rearrange the byte order
- C51 COMPILER V7.06 ACCESS 11/21/2005 13:47:43 PAGE 18
-
- ucTemp[0] = (*(array + 1) << 4) | (*(array + 2) & 0x0f);
- ucTemp[1] = (*(array + 2) & 0xf0) | (*array & 0x0f);
- ucTemp[2] = (*array & 0xf0) | (*(array + 1) >> 4);
-
- for(n=0;n<3;n++)
- {
- #if(PARALLEL_PORT)
-
- #if(1)
- bRTD_SDIO_0 = (bit)(ucTemp[n] & 0x01);
- bRTD_SDIO_1 = (bit)(ucTemp[n] & 0x02);
- bRTD_SDIO_2 = (bit)(ucTemp[n] & 0x04);
- bRTD_SDIO_3 = (bit)(ucTemp[n] & 0x08);
- bRTD_SCLK = 1;
- bRTD_SCLK = 0;
- bRTD_SDIO_0 = (bit)(ucTemp[n] & 0x10);
- bRTD_SDIO_1 = (bit)(ucTemp[n] & 0x20);
- bRTD_SDIO_2 = (bit)(ucTemp[n] & 0x40);
- bRTD_SDIO_3 = (bit)(ucTemp[n] & 0x80);
- bRTD_SCLK = 1;
- bRTD_SCLK = 0;
- bRTD_SDIO_0 = 1;
- bRTD_SDIO_1 = 1;
- bRTD_SDIO_2 = 1;
- bRTD_SDIO_3 = 1;
- bRTD_SCLK = 1;
- #else
- ucTemp1 = P0 & 0xf0;
-
- P0 = ucTemp1 | (ucTemp[n] & 0x0f);
- bRTD_SCLK = 1;
- bRTD_SCLK = 0;
- P0 = ucTemp1 | (ucTemp[n] >> 4);
- bRTD_SCLK = 1;
- bRTD_SCLK = 0;
- P0 = ucTemp1 | 0x0f;
- bRTD_SCLK = 1;
- #endif
-
- #else
- bRTD_SDIO_0 = (bit)(ucTemp[n] & 0x01);
- bRTD_SCLK = 1;
- bRTD_SCLK = 0;
- bRTD_SDIO_0 = (bit)(ucTemp[n] & 0x02);
- bRTD_SCLK = 1;
- bRTD_SCLK = 0;
- bRTD_SDIO_0 = (bit)(ucTemp[n] & 0x04);
- bRTD_SCLK = 1;
- bRTD_SCLK = 0;
- bRTD_SDIO_0 = (bit)(ucTemp[n] & 0x08);
- bRTD_SCLK = 1;
- bRTD_SCLK = 0;
- bRTD_SDIO_0 = (bit)(ucTemp[n] & 0x10);
- bRTD_SCLK = 1;
- bRTD_SCLK = 0;
- bRTD_SDIO_0 = (bit)(ucTemp[n] & 0x20);
- bRTD_SCLK = 1;
- bRTD_SCLK = 0;
- bRTD_SDIO_0 = (bit)(ucTemp[n] & 0x40);
- bRTD_SCLK = 1;
- bRTD_SCLK = 0;
- C51 COMPILER V7.06 ACCESS 11/21/2005 13:47:43 PAGE 19
- bRTD_SDIO_0 = (bit)(ucTemp[n] & 0x80);
- bRTD_SCLK = 1;
- bRTD_SCLK = 0;
- bRTD_SDIO_0 = 1;
- bRTD_SCLK = 1;
- #endif
- }
- array += 3;
- }
- }
- while (--length);
-
- RTDSendStop();
- }
- #endif
- 1117
- 1118
- 1119 #if(HDCP_ENABLE)
- void KEYCodeW(unsigned char code *array)
- {
- unsigned int m;
-
- RTDSetBit(DVI_CTRL1_AF, 0x7f,0x00); //Reset the HDCP key download index
- RTDSetBit(DVI_CTRL1_AF, 0x7f,0x80);
-
- for(m = 0; m < 320; m++) //Key 0 ~ Key39
- {
- RTDSetByte(0xb1,array[m]);
- }
-
- RTDSetBit(DVI_CTRL1_AF, 0x7f,0x00); //Disable the Key Access Download port
- RTDSetBit(TMDS_INPUT_ENA_A1, 0x7f, 0x00); // Turn on HDCP DDC channel
- }
- #endif
- C51 COMPILER V7.06 ACCESS 11/21/2005 13:47:43 PAGE 20
- ASSEMBLY LISTING OF GENERATED OBJECT CODE
- ; FUNCTION Com008D (BEGIN)
- 0000 L?0142:
- 0000 A2E1 MOV C,ACC.1
- 0002 9290 MOV bRTD_SDIO_0,C
- 0004 D294 SETB bRTD_SCLK
- 0006 C294 CLR bRTD_SCLK
- 0008 A2E2 MOV C,ACC.2
- 000A 9290 MOV bRTD_SDIO_0,C
- 000C D294 SETB bRTD_SCLK
- 000E C294 CLR bRTD_SCLK
- 0010 A2E3 MOV C,ACC.3
- 0012 9290 MOV bRTD_SDIO_0,C
- 0014 D294 SETB bRTD_SCLK
- 0016 C294 CLR bRTD_SCLK
- 0018 A2E4 MOV C,ACC.4
- 001A 9290 MOV bRTD_SDIO_0,C
- 001C D294 SETB bRTD_SCLK
- 001E C294 CLR bRTD_SCLK
- 0020 A2E5 MOV C,ACC.5
- 0022 9290 MOV bRTD_SDIO_0,C
- 0024 D294 SETB bRTD_SCLK
- 0026 C294 CLR bRTD_SCLK
- 0028 A2E6 MOV C,ACC.6
- 002A 9290 MOV bRTD_SDIO_0,C
- 002C D294 SETB bRTD_SCLK
- 002E C294 CLR bRTD_SCLK
- 0030 33 RLC A
- 0031 L?0143:
- 0031 9290 MOV bRTD_SDIO_0,C
- 0033 D294 SETB bRTD_SCLK
- 0035 C294 CLR bRTD_SCLK
- 0037 22 RET
- 0038 L?0150:
- 0038 L?0151:
- 0038 D294 SETB bRTD_SCLK
- 003A C294 CLR bRTD_SCLK
- 003C A290 MOV C,bRTD_SDIO_0
- 003E 22 RET
- 003F L?0153:
- 003F L?0154:
- 003F 850082 R MOV DPL,array+01H
- 0042 850083 R MOV DPH,array
- 0045 22 RET
- 0046 L?0157:
- 0046 93 MOVC A,@A+DPTR
- 0047 FF MOV R7,A
- 0048 E4 CLR A
- 0049 FD MOV R5,A
- 004A 120000 R LCALL _RTDSendAddr
- 004D 7402 MOV A,#02H
- 004F 2500 R ADD A,array+01H
- 0051 F500 R MOV array+01H,A
- 0053 E4 CLR A
- 0054 3500 R ADDC A,array
- 0056 F500 R MOV array,A
- 0058 22 RET
- 0059 L?0158:
- 0059 9297 MOV bIIC_SDA,C
- 005B 120000 R LCALL BitDly
- C51 COMPILER V7.06 ACCESS 11/21/2005 13:47:43 PAGE 21
- 005E L?0159:
- 005E D296 SETB bIIC_SCL
- 0060 120000 R LCALL BitDly
- 0063 C296 CLR bIIC_SCL
- 0065 22 RET
- 0066 L?0160:
- 0066 3500 R ADDC A,uiCount
- 0068 F583 MOV DPH,A
- 006A E4 CLR A
- 006B 93 MOVC A,@A+DPTR
- 006C F500 R MOV ucByte_Temp,A
- 006E 750080 R MOV ucCnt,#080H
- 0071 0500 R INC uiCount+01H
- 0073 E500 R MOV A,uiCount+01H
- 0075 22 RET
- 0076 L?0161:
- 0076 E500 R MOV A,ucByte_Temp
- 0078 5500 R ANL A,ucCnt
- 007A 24FF ADD A,#0FFH
- 007C 9200 R MOV bBit,C
- 007E E500 R MOV A,ucCnt
- 0080 C3 CLR C
- 0081 13 RRC A
- 0082 F500 R MOV ucCnt,A
- 0084 22 RET
- 0085 L?0162:
- 0085 120000 R LCALL RTDSendStop
- 0088 C295 CLR bRTD_SCSB
- 008A 0B INC R3
- 008B 7F92 MOV R7,#092H
- 008D 020000 R LJMP _RTDSendAddr
- 0090 L?0164:
- 0090 C295 CLR bRTD_SCSB
- 0092 E4 CLR A
- 0093 FB MOV R3,A
- 0094 FD MOV R5,A
- 0095 7F90 MOV R7,#090H
- 0097 020000 R LJMP _RTDSendAddr
- 009A L?0165:
- 009A L?0166:
- 009A 0500 R INC array+01H
- 009C E500 R MOV A,array+01H
- 009E AE00 R MOV R6,array
- 00A0 22 RET
- 00A1 L?0167:
- 00A1 7401 MOV A,#01H
- 00A3 93 MOVC A,@A+DPTR
- 00A4 24FC ADD A,#0FCH
- 00A6 FF MOV R7,A
- 00A7 020000 R LJMP _RTDSendByte
- ; FUNCTION Com008D (END)
- ; FUNCTION BitDly (BEGIN)
- ; SOURCE LINE # 120
- ; SOURCE LINE # 121
- ; SOURCE LINE # 122
- 0000 00 NOP
- 0001 00 NOP
- 0002 00 NOP
- 0003 00 NOP
- 0004 00 NOP
- 0005 00 NOP
- C51 COMPILER V7.06 ACCESS 11/21/2005 13:47:43 PAGE 22
- 0006 00 NOP
- 0007 00 NOP
- ; SOURCE LINE # 123
- 0008 00 NOP
- 0009 00 NOP
- 000A 00 NOP
- 000B 00 NOP
- 000C 00 NOP
- 000D 00 NOP
- 000E 00 NOP
- 000F 00 NOP
- ; SOURCE LINE # 124
- 0010 00 NOP
- 0011 00 NOP
- 0012 00 NOP
- 0013 00 NOP
- 0014 00 NOP
- 0015 00 NOP
- 0016 00 NOP
- 0017 00 NOP
- ; SOURCE LINE # 125
- 0018 00 NOP
- 0019 00 NOP
- 001A 00 NOP
- 001B 00 NOP
- 001C 00 NOP
- 001D 00 NOP
- 001E 00 NOP
- 001F 00 NOP
- ; SOURCE LINE # 126
- 0020 22 RET
- ; FUNCTION BitDly (END)
- ; FUNCTION _I2CRead (BEGIN)
- ; SOURCE LINE # 128
- 0000 8F00 R MOV addr,R7
- 0002 8B00 R MOV count,R3
- ;---- Variable 'index' assigned to Register 'R5' ----
- ; SOURCE LINE # 129
- ; SOURCE LINE # 132
- 0004 E500 R MOV A,count
- 0006 6039 JZ ?C0006
- ; SOURCE LINE # 133
- ; SOURCE LINE # 134
- 0008 E4 CLR A
- 0009 FB MOV R3,A
- 000A 120000 R LCALL _I2CSendAddr
- ; SOURCE LINE # 136
- 000D 7B01 MOV R3,#01H
- 000F E4 CLR A
- 0010 FD MOV R5,A
- 0011 AF00 R MOV R7,addr
- 0013 120000 R LCALL _I2CSendAddr
- ; SOURCE LINE # 138
- 0016 1500 R DEC count
- ; SOURCE LINE # 140
- 0018 E4 CLR A
- 0019 F500 R MOV n,A
- 001B ?C0003:
- 001B E500 R MOV A,n
- 001D C3 CLR C
- 001E 9500 R SUBB A,count
- C51 COMPILER V7.06 ACCESS 11/21/2005 13:47:43 PAGE 23
- 0020 5010 JNC ?C0004
- 0022 E4 CLR A
- 0023 FF MOV R7,A
- 0024 120000 R LCALL _I2CGetByte
- 0027 7400 R MOV A,#LOW Data
- 0029 2500 R ADD A,n
- 002B F8 MOV R0,A
- 002C A607 MOV @R0,AR7
- 002E 0500 R INC n
- 0030 80E9 SJMP ?C0003
- 0032 ?C0004:
- ; SOURCE LINE # 142
- 0032 7F01 MOV R7,#01H
- 0034 120000 R LCALL _I2CGetByte
- 0037 7400 R MOV A,#LOW Data
- 0039 2500 R ADD A,count
- 003B F8 MOV R0,A
- 003C A607 MOV @R0,AR7
- ; SOURCE LINE # 144
- 003E 120000 R LCALL I2CSendStop
- ; SOURCE LINE # 145
- ; SOURCE LINE # 146
- 0041 ?C0006:
- 0041 22 RET
- ; FUNCTION _I2CRead (END)
- ; FUNCTION _I2CWrite (BEGIN)
- ; SOURCE LINE # 148
- 0000 8B00 R MOV array,R3
- 0002 8A00 R MOV array+01H,R2
- 0004 8900 R MOV array+02H,R1
- ; SOURCE LINE # 149
- ; SOURCE LINE # 152
- 0006 120000 E LCALL ?C?CLDPTR
- 0009 FF MOV R7,A
- 000A 7403 MOV A,#03H
- 000C D3 SETB C
- 000D 9F SUBB A,R7
- 000E 5039 JNC ?C0011
- ; SOURCE LINE # 153
- ; SOURCE LINE # 154
- 0010 8F00 R MOV len,R7
- ; SOURCE LINE # 155
- 0012 900001 MOV DPTR,#01H
- 0015 120000 E LCALL ?C?CLDOPTR
- 0018 FF MOV R7,A
- 0019 900002 MOV DPTR,#02H
- 001C 120000 E LCALL ?C?CLDOPTR
- 001F FD MOV R5,A
- 0020 E4 CLR A
- 0021 FB MOV R3,A
- 0022 120000 R LCALL _I2CSendAddr