最近需要用stm32精英版控制一个miniLCD12864(普中51单片机开发板上附带的),驱动IC是ST7565P,本人看了很多资料,也调试了很...

2019-07-21 07:24发布

//lcd12864.h
#ifndef LCD12864_H
#define LCD12864_H

#include "sys.h"

#define RS PGout(13)
#define WR PGout(14)
#define RD PGout(15)
#define CS PBout(3)
#define RST PBout(4)

//PC0-PC7,作为数据线
#define DataPort(x) GPIOC->ODR=(GPIOC->ODR&0xff00)|(x&0x00ff);

void LCD12864_Init(void);

void display_map(unsigned char *p);

#endif





//lcd12864.c
#include "lcd12864.h"
#include "delay.h"

void write_cmd(u8 cmd)
{   
        CS = 0;
        RD = 1;
    WR = 0;
        RS = 0;
        delay_us(2);
    DataPort(cmd);
        delay_us(2);
        WR = 1;
}

void write_dat(u8 dat)
{   
        CS = 0;
        RD = 1;
    WR = 0;
        RS = 1;
        delay_us(2);
    DataPort(dat);
        delay_us(2);
        WR = 1;
}

//void Setadd(u8 xl,u8 yl)
//{    u8 i;
//     xl+=4;
//     i=(xl+0)&0x0f;
//     xl=(xl>>4)+0x10;

//     write_cmd(0xb0+yl);           
//         write_cmd(xl);
//          write_cmd(i);       
//}

//void Clear()
//{
//   u8  i,j;
//   for(i=0;i<8;i++)   
//    {
//     Setadd(0,i);                     
//     for(j=0;j<128;j++)
//          write_dat(0x00);
//     }
//}

void LCD12864_Init(void)
{
        GPIO_InitTypeDef GPIO_InitStructure;
       
        RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB,ENABLE);
        RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC,ENABLE);
        RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOG,ENABLE);
       
        GPIO_InitStructure.GPIO_Mode=GPIO_Mode_Out_PP;
        GPIO_InitStructure.GPIO_Pin=GPIO_Pin_3|GPIO_Pin_4;
        GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
        GPIO_Init(GPIOB,&GPIO_InitStructure);
        GPIO_SetBits(GPIOC,GPIO_Pin_3|GPIO_Pin_4);
       
        GPIO_InitStructure.GPIO_Pin=GPIO_Pin_13|GPIO_Pin_14|GPIO_Pin_15;
        GPIO_Init(GPIOG,&GPIO_InitStructure);
        GPIO_SetBits(GPIOG,GPIO_Pin_13|GPIO_Pin_14|GPIO_Pin_15);
       
        GPIO_InitStructure.GPIO_Pin=GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7;
        GPIO_Init(GPIOC,&GPIO_InitStructure);
       
        //软复位
        RST = 0;
        delay_ms(50);
        RST = 1;
        delay_ms(20);
       
    write_cmd(0xAF);        
    delay_ms(5);
    write_cmd(0x40);
    delay_ms(5);
        write_cmd(0xa0);
        delay_ms(5);
        write_cmd(0xa6);
        delay_ms(5);
        write_cmd(0xa4);
        delay_ms(5);
        write_cmd(0xa2);
        delay_ms(5);
        write_cmd(0xC8);
        delay_ms(5);
       
        write_cmd(0x2f);
        delay_ms(5);
        write_cmd(0x24);
        delay_ms(5);
        write_cmd(0x81);
        delay_ms(5);
        write_cmd(0x24);
        delay_ms(5);
    //----------------Star Initial Sequence-------//
//------程序初始化设置,具体命令可以看文件夹下---//

////--软件初始化--//
//write_cmd(0xE2); //reset
//for (i=0; i<100; i++);        //延时一下

////--表格第8个命令,0xA0段(左右)方向选择正常方向(0xA1为反方向)--//
//write_cmd(0xA1); //ADC select segment direction

////--表格第15个命令,0xC8普通(上下)方向选择选择反向,0xC0为正常方向--//
//write_cmd(0xC8); //Common direction

////--表格第9个命令,0xA6为设置字体为黑 {MOD},背景为白 {MOD}---//
////--0xA7为设置字体为白 {MOD},背景为黑 {MOD}---//
//write_cmd(0xA6); //reverse display

////--表格第10个命令,0xA4像素正常显示,0xA5像素全开--//
//write_cmd(0xA4); //normal display

////--表格第11个命令,0xA3偏压为1/7,0xA2偏压为1/9--//
//write_cmd(0xA2); //bias set 1/9

////--表格第19个命令,这个是个双字节的命令,0xF800选择增压为4X;--//
////--0xF801,选择增压为5X,其实效果差不多--//       
//write_cmd(0xF8); //Boost ratio set
//write_cmd(0x01); //x4

////--表格第18个命令,这个是个双字节命令,高字节为0X81,低字节可以--//
////--选择从0x00到0X3F。用来设置背景光对比度。---/
//write_cmd(0x81); //V0 a set
//write_cmd(0x23);

////--表格第17个命令,选择调节电阻率--//
//write_cmd(0x25); //Ra/Rb set

////--表格第16个命令,电源设置。--//
//write_cmd(0x2F);
//for (i=0; i<100; i++);

////--表格第2个命令,设置显示开始位置--//
//write_cmd(0x40); //start line

////--表格第1个命令,开启显示--//
//write_cmd(0xAF); // display on
//for (i=0; i<100; i++);
//    write_cmd(0xe2);          
//       
//        write_cmd(0xa0);
//        write_cmd(0xc8);        //??

//        write_cmd(0x2f);
//       
//        write_cmd(0x27);

//        write_cmd(0xaf);        //          kaiqi

//        write_cmd(0x40);        //  dizhi
//        write_cmd(0xc8);        //  dizhi


//        write_cmd(0xa6);
//        write_cmd(0xa4);
//        write_cmd(0xa3);           //起到了关键性作用

//        write_cmd(0x81);        //
//        write_cmd(0x0);        //
//        write_cmd(0xf8);        //       
//        write_cmd(0x3);
//       
//        Clear();
}

//void Display(unsigned char sda,unsigned char sda1)
//{
//   unsigned char  i,j,k=0;
//   for(i=0;i<8;i++)   
//    {
//     write_cmd(0xb0+k);           
//          write_cmd(0x10);
//         write_cmd(0x00);          
//       for(j=0;j<64;j++)
//          { write_dat(sda);
//            write_dat(sda1);
//          }
//    k++;
//    }
//}

//void lcd_pos(u8 X,u8 Y)
//{                          
//   u8  pos;
//   if (X==0)
//     {X=0x80;}
//   else if (X==1)
//     {X=0x90;}
//   else if (X==2)
//     {X=0x88;}
//   else if (X==3)
//     {X=0x98;}
//   pos = X+Y ;  
//   write_cmd(pos);     //显示地址
//}

//void lcd_display()
//{
//        lcd_pos(0,0);   //设置显示位置为第1行的第1个字符
//        i=0;
//        while(lcd12864_dis1[i]!='')
//    {
//       write_dat(lcd12864_dis1[i]);      //显示字符
//       i++;
//    }

//        lcd_pos(1,0);             //设置显示位置为第2行的第1个字符
//        i=0;
//        while(lcd12864_dis2[i]!='')
//    {
//       write_dat(lcd12864_dis2[i]);      //显示字符
//       i++;
//    }
//        
//        lcd_pos(2,0);             //设置显示位置为第3行的第1个字符
//    i=0;
//        while(lcd12864_dis3[i]!='')
//    {
//       write_dat(lcd12864_dis3[i]);      //显示字符
//       i++;
//    }
//       
//        lcd_pos(3,0);             //设置显示位置为第4行的第1个字符
//    i=0;
//        while(lcd12864_dis4[i]!='')
//    {
//       write_dat(lcd12864_dis4[i]);      //显示字符
//       i++;
//    }
//}

//void Displayhz(unsigned char num,const unsigned char *p)//从(0,0)开始显示num个16*16的汉字(包括标点符号)
//{
//  u8 i,j;
//  if(num<=8)
//  {
//    write_cmd(0xb0);
//    write_cmd(0x10);//列地址,从第0列开始
//    write_cmd(0x40);//行地址,从第0行开始
//    for(i=0;i<8;i++)
//    {
//      for(j=0;j<16;j++)
//      {
//        if(16*2*i+j<32*num)
//        {write_dat(p[16*2*i+j]);}
//      }
//    }
//  
//    write_cmd(0xb1);
//    write_cmd(0x10);//列地址,从第0列开始
//    write_cmd(0x40);//行地址,从第0行开始
//    for(i=0;i<8;i++)
//    {
//      for(j=0;j<16;j++)
//      {
//        if(16*(2*i+1)+j<32*num)
//        {write_dat(p[16*(2*i+1)+j]);}
//      }
//    }
//  }
//  else if(num>8)
//    {
//      write_cmd(0xb0);
//      write_cmd(0x10);//列地址,从第0列开始
//      write_cmd(0x40);//行地址,从第0行开始
//      for(i=0;i<8;i++)
//       {
//        for(j=0;j<16;j++)
//         {
//          if(16*2*i+j<32*num)
//           {write_dat(p[16*2*i+j]);}
//         }
//       }
//  
//        write_cmd(0xb1);
//        write_cmd(0x10);//列地址,从第0列开始
//        write_cmd(0x40);//行地址,从第0行开始
//        for(i=0;i<8;i++)
//         {
//          for(j=0;j<16;j++)
//           {
//            if(16*(2*i+1)+j<32*num)
//             {write_dat(p[16*(2*i+1)+j]);}
//           }
//         }
//   
//        write_cmd(0xb2);
//        write_cmd(0x10);//列地址,从第0列开始
//        write_cmd(0x40);//行地址,从第0行开始
//        for(i=8;i<16;i++)
//         {
//          for(j=0;j<16;j++)
//           {
//             if(16*2*i+j<32*num)
//             {write_dat(p[16*2*i+j]);}
//           }
//         }
//   
//        write_cmd(0xb3);
//        write_cmd(0x10);//列地址,从第0列开始
//        write_cmd(0x40);//行地址,从第0行开始
//        for(i=8;i<16;i++)
//         {
//          for(j=0;j<16;j++)
//           {
//             if(16*(2*i+1)+j<32*num)
//             {write_dat(p[16*(2*i+1)+j]);}
//           }
//         }
//    }
//}

//void disp_ch(unsigned char c,u8 uCol,u8 uPage)
//{
//        unsigned char k,j,ch_w;
//        unsigned char width;
//        unsigned char len;

//        len=sizeof(ASC_16)/sizeof(ASC_16[0]);
//        for(k=0;k<len;k++)
//        {
//                if(c == ASC_16[k].Index[0] ) break;
//        }
//        if(k<len)
//        {
//               
//                if(c=='-'||c==':')
//                        width=ASC_CHR_WIDTH-2;
//                else if(c=='|')
//                        width=ASC_HZ_WIDTH-ASC_CHR_WIDTH;
//                else
//                        width=ASC_CHR_WIDTH;
//               
//                   Setadd(uCol,uPage);
//                        for(j=0;j<width;j++)
//                        {
//                                ch_w=ASC_16[k].Msk[j];                               
//                                write_dat(ch_w);
//                        }

//                        Setadd(uCol,uPage+1);
//                        for(j=0;j<width;j++)
//                        {
//                                ch_w=ASC_16[k].Msk[ASC_CHR_WIDTH+j];
//                                write_dat(ch_w);
//                        }               
//        }
//}


//void disp_hz(u8 *hz,u8 uCol,u8 uPage)
//{
//        unsigned char k,j,ch_w;
//    //sizeof 用来求一个变量或者一种类型所占用的字节数
//        for(k=0;k<sizeof(GB_16)/sizeof(GB_16[0]);k++)
//        {
//                if(hz[0] == GB_16[k].Index[0] && hz[1] == GB_16[k].Index[1])
//                        break;
//        }

//        Setadd(uCol,uPage);
//        for(j=0;j<ASC_HZ_WIDTH;j++)
//        {               
//                ch_w=GB_16[k].Msk[j];
//                write_dat(ch_w);
//        }

//        Setadd(uCol,uPage+1);
//        for(j=0;j<ASC_HZ_WIDTH;j++)
//        {
//                ch_w=GB_16[k].Msk[ASC_HZ_WIDTH+j];
//                write_dat(ch_w);
//        }
//}

//void disp_str(u8 *p,u8 uCol,u8 uPage)
//{
//        unsigned char i=0;
//        while(p[i]>0)
//        {
//                if(p[i] < 128)
//                {       
//                        disp_ch(p[i],uCol,uPage);
//            uCol+=8;
//                }
//                else
//                {       
//                        disp_hz(&p[i],uCol,uPage);
//                        uCol+=16;
//                        i++;
//                }
////                if(Flage1==1) Delayms(200);
//                i++;
//        }
//}

void display_map(unsigned char *p)//P 是图片数据的首地址
{
unsigned char seg;
unsigned char page;
for(page=0xb0;page<0xb9;page++) //写页地址共 8 页 0xb0----0xb8
{
write_cmd(page);
write_cmd(0x10); //列地址,高低字节两次写入,从第 0 列开始
write_cmd(0x00);
for(seg=0;seg<128;seg++)//写 128 列
{ write_dat(*p++); }
}
}


//main.c
#include "lcd12864.h"
#include "delay.h"
#include "led.h"

const unsigned char pic[]={
/*-- 宽度x高度=128x64 --*/
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x07,
0x57,0x53,0x57,0x07,0xFF,0x0F,0xE3,0x0F,0xEF,0xFF,0xEF,0xEF,0xEF,0x03,0xEF,0xEF,
0xEF,0x0F,0xE3,0x0F,0xEF,0xFF,0x77,0x77,0x17,0x57,0x57,0x53,0x57,0x57,0x17,0x77,
0x77,0xFF,0xFB,0x8B,0xAB,0x83,0xAB,0x83,0xAB,0x8B,0xFF,0x37,0xDB,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x07,
0x57,0x53,0x57,0x07,0xFF,0x0F,0xE3,0x0F,0xEF,0xFF,0xEF,0xEF,0xEF,0x03,0xEF,0xEF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0xFC,0xF9,0xF3,0xF7,0xFB,0xFD,0xFE,0xFF,0xDF,0xDF,0xC1,0xC8,0xDC,
0xFF,0xF8,0xF7,0xEF,0xDF,0xF8,0xF2,0xF2,0xF8,0xFC,0xFE,0xFC,0xFC,0xFE,0xFC,0xF8,
0xF2,0xD2,0xE8,0xF7,0xF8,0xFF,0xDC,0xC8,0xC1,0xC3,0xC7,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFC,0xF9,0xF3,0xF7,0xFB,0xFD,0xFE,0xFF,
0xFF,0xFF,0xFE,0xFC,0xF9,0xF3,0xF7,0xFB,0xFD,0xFE,0xFF,0xDF,0xDF,0xC1,0xC8,0xDC,
0xFF,0xF8,0xF7,0xEF,0xDF,0xF8,0xF2,0xF2,0xF8,0xFC,0xFE,0xFC,0xFC,0xFE,0xFC,0xF8,
0xF2,0xD2,0xE8,0xF7,0xF8,0xFF,0xDC,0xC8,0xC1,0xC3,0xC7,0xFF,0xFF,0xFF,0xFF,0xFF,
};

int main()
{
        delay_init();
        LCD12864_Init();
        LED_Init();
        while(1)
        {
//                Displayhz(2,tab4);
                LED0 = 0;
                delay_ms(1000);
                LED0 = 1;
                delay_ms(1000);
                display_map(&pic);
//                Clear();
//      Display(0xff,0xff);
//          delay_ms(2000);

//      Display(0x55,0xaa);
//          delay_ms(2000);

//      Display(0x00,0xff);
//          delay_ms(2000);

//      Display(0xaa,0xaa);
//          delay_ms(2000);

//      Display(0x55,0x55);
//          delay_ms(2000);
//                //Hanzi_Disp();delay_ms(5000);
//          Clear();
//        disp_str("液晶",0,0);delay_ms(1000);
//        disp_str("液晶",96,0);delay_ms(1000);
//        disp_str("液晶",48,3);delay_ms(1000);
//        disp_str("液晶",96,0);delay_ms(1000);
//        disp_str("液晶",0,6);delay_ms(1000);
//        disp_str("液晶",96,6);delay_ms(1000);
//        delay_ms(4000);
//    Clear();

//        disp_str("欢迎使用显示汉字",0,0);
//        disp_str("欢迎使用显示汉字",0,2);       
//        disp_str("欢迎使用显示汉字",0,4);
//        disp_str("012345678901234",0,6);
//        delay_ms(5000);
        }
}



友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。