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

📄 splc501.lst

📁 凌阳SPDA1000 MP3开发资料
💻 LST
📖 第 1 页 / 共 5 页
字号:
 737          void SSD1815_send_data_cmd(U8 OM4081_data_cmd)//lyh add
 738          {
 739   1              U8 i;
 740   1          Clear_SSD1815_CS_Pin;
 741   1              for(i=0;i<8;i++)//write data or command
 742   1              {
 743   2                      Clear_SSD1815_SCLK_Pin;//OM4081F_SCLK=0;
 744   2                      if(OM4081_data_cmd & 0x80)
 745   2                      {
 746   3                              Set_SSD1815_SData_Pin;//OM4081F_SDIN=1;
 747   3                      }
 748   2                      else
 749   2                      {
 750   3                              Clear_SSD1815_SData_Pin;//OM4081F_SDIN=0;
 751   3                      }
 752   2                      OM4081_data_cmd=OM4081_data_cmd<<1;
 753   2                      Set_SSD1815_SCLK_Pin;//OM4081F_SCLK=1;
 754   2                      
 755   2              }
 756   1          Set_SSD1815_CS_Pin;
 757   1      }
 758          //============================================================================
 759          void write_SPLC501CI(U8 instruct)//lyh add
 760          {
 761   1              Clear_SSD1815_DC_Pin;
 762   1              SSD1815_send_data_cmd(instruct);
 763   1          
 764   1      }
 765          //============================================================================
 766          void write_SPLC501CD(U8 showdata)//lyh add
 767          {
 768   1              Set_SSD1815_DC_Pin;
 769   1              SSD1815_send_data_cmd(showdata);
 770   1         
 771   1      }
 772          //============================================================================
 773          void SPLC501_Set_PageNColumn_Address(U8 Page,U8 Column)//lyh add
 774          {
 775   1              write_SPLC501CI(Page|0xb0);
 776   1              write_SPLC501CI((Column>>4)&0x0f|0x10);  //高位列地址
 777   1              write_SPLC501CI(Column&0x0f);//低位列地址
 778   1      }
 779          //==================================================================================
 780          //=================================================================================//
 781          void SPLC501_Erase_OnePage(U8 Page)
 782          {
 783   1              U8 i;
 784   1              SPLC501_Set_PageNColumn_Address(Page,0x00);
 785   1              for(i=0;i<132;i++)
 786   1              {
 787   2                      write_SPLC501CD(0);
 788   2              }
 789   1      }
 790          //=================================================================================//
 791          void LCD501_Clear_ALL()
 792          {
 793   1              U8 i;
 794   1              for(i=0;i<5;i++)
 795   1              {
 796   2                      SPLC501_Erase_OnePage(i);
C51 COMPILER V8.05a   SPLC501                                                              07/11/2007 20:43:08 PAGE 14  

 797   2              }
 798   1      }
 799          //=============================================================================
 800          void SPLC501_Write_CharABC(U8 Page,U8 Column,U8 ReverseDispOnOff,U8 CharABC)//lyh add
 801          {
 802   1              U8 i,j;
 803   1              U8 temp;
 804   1              temp=CharABC;
 805   1      //printf("%c",temp);
 806   1      //printf("%c",Page);
 807   1      //printf("%c",Column);
 808   1              if(CharABC>47 && CharABC<58)
 809   1              {
 810   2                      temp=CharABC-48;
 811   2              }
 812   1              if(CharABC>96 && CharABC<123)
 813   1              {
 814   2                      temp=CharABC-58;       //'abcd.....'
 815   2              }
 816   1              if(CharABC>64 && CharABC<91)
 817   1              {
 818   2                      temp=CharABC-52;       //'ABCD.....'
 819   2              }
 820   1              switch(CharABC)
 821   1              {
 822   2              case ' ':
 823   2                      temp=12;
 824   2                      break;
 825   2              case '-':
 826   2                      temp=11;
 827   2                      break;
 828   2              case ':':
 829   2                      temp=10;
 830   2                      break;
 831   2              case '.':
 832   2                      temp=65;
 833   2                      break;
 834   2              case '?':
 835   2                      temp=66;
 836   2                      break;
 837   2              case '!':
 838   2                      temp=67;
 839   2                      break;
 840   2              case '%':
 841   2                      temp=68;
 842   2                      break;
 843   2              case ',':
 844   2                      temp=69;
 845   2                      break;
 846   2              case '\'':
 847   2                      temp=70;
 848   2                      break;
 849   2              case ';':
 850   2                      temp=71;
 851   2                      break;
 852   2              case '\"':
 853   2                      temp=72;
 854   2                      break;
 855   2              case '<':
 856   2                      temp=73;
 857   2                      break;
 858   2              case '>':
C51 COMPILER V8.05a   SPLC501                                                              07/11/2007 20:43:08 PAGE 15  

 859   2                      temp=74;
 860   2                      break;
 861   2              case '^':
 862   2                      temp=75;
 863   2                      break;
 864   2              default:
 865   2                      break;
 866   2              }
 867   1      
 868   1              for(j=0;j<2;j++)
 869   1              {
 870   2                      SPLC501_Set_PageNColumn_Address(Page+j,Column);
 871   2      //printf("\n");
 872   2                      for(i=0;i<8;i++)
 873   2                      {
 874   3                              if(ReverseDispOnOff)
 875   3                              {
 876   4                                      write_SPLC501CD((~Char_BMP[temp][(j*8)+i]));
 877   4                              }else{
 878   4                                      write_SPLC501CD(Char_BMP[temp][(j*8)+i]);
 879   4      //                printf("%c",Char_BMP[temp][(j*8)+i]);
 880   4                              }
 881   3                      }
 882   2              }
 883   1      }
 884          
 885          //============================================================================
 886          void LCD_disp_HZKCharBMP(U8 Page, U8 Column,U8 *BMPdataBuf, U8 CharOrWord,U8 reverse)//lyh add
 887          {
 888   1              U8 i,j;// I think,to show the HZ,the upper of the HZ store in the BMPdataBuf
 889   1                            //in the even serial,the other page store in the odd serial
 890   1      
 891   1              if(CharOrWord)//char(8x16)--------word(12x16)
 892   1              {
 893   2                      i=0;j=22;
 894   2              }else{
 895   2                      i=4;j=18;
 896   2              }
 897   1              SPLC501_Set_PageNColumn_Address(Page,Column);
 898   1              for(;i<=j;i=i+2)
 899   1              {
 900   2                      if(reverse)
 901   2                              write_SPLC501CD(~*(BMPdataBuf+(i)));
 902   2                      else
 903   2                              write_SPLC501CD(*(BMPdataBuf+(i)));
 904   2              }
 905   1      
 906   1              if(CharOrWord)
 907   1              {
 908   2                      i=0;j=23;
 909   2              }else{
 910   2                      i=4;j=19;
 911   2              }
 912   1      
 913   1              SPLC501_Set_PageNColumn_Address(Page+1,Column);
 914   1              for(;i<=j;i=i+2)
 915   1              {
 916   2                      if(reverse)
 917   2                              write_SPLC501CD(~*(BMPdataBuf+(i+1)));
 918   2                      else
 919   2                              write_SPLC501CD(*(BMPdataBuf+(i+1)));
 920   2              }
C51 COMPILER V8.05a   SPLC501                                                              07

⌨️ 快捷键说明

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