`
lovnet
  • 浏览: 6724702 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
文章分类
社区版块
存档分类
最新评论

时代民芯MXT0106 全彩LED驱动DM163代码

 
阅读更多

这段时间在用时代民芯的MXT0106做全彩LED控制,SPARC V8架构的,刷新速度还是有一些问题,不过基本显示还可以了。

主函数


#include "config.h"
#include "stdio.h"
#include "flashTest.h"
#include "eIntTest.h"
#include "gpiotest.h"
#include "sysTimerTest.h"
#include "advTimerTest.h"
#include "counterTest.h"
#include "adcTest.h"
#include "iicTest.h"
#include "sdramTest.h"
#include "GPIOTest.h"


#define DDR_RST (1<<2)
#define DDR_LAT (1<<3)
#define DDR_SLB (1<<4)
#define DDR_SDA (1<<5)
#define DDR_SCL (1<<6)


#define DDR_openline_BIT0   (1<<0)
#define DDR_openline_BIT1   (1<<1)
#define DDR_openline_BIT2   (1<<2)
#define DDR_openline_BIT3   (1<<3)
#define DDR_openline_BIT4   (1<<4)
#define DDR_openline_BIT5   (1<<5)
#define DDR_openline_BIT6   (1<<6)
#define DDR_openline_BIT7   (1<<7)

#define DATA_RST (1<<2)
#define DATA_LAT (1<<3)
#define DATA_SLB (1<<4)
#define DATA_SDA (1<<5)
#define DATA_SCL (1<<6)
#define DATA_openline_BIT0   (1<<0)
#define DATA_openline_BIT1   (1<<1)
#define DATA_openline_BIT2   (1<<2)
#define DATA_openline_BIT3   (1<<3)
#define DATA_openline_BIT4   (1<<4)
#define DATA_openline_BIT5   (1<<5)
#define DATA_openline_BIT6   (1<<6)
#define DATA_openline_BIT7   (1<<7)

static StructCPURegs *regs = (StructCPURegs *)0x80000000;    /*指向配置寄存器*/

unsigned char dots[2][8][8][3];
unsigned char Gamma_Value[3] = {10,63,63};
//Gamma correctly value, every LED plane is different.value range is 0~63
//[3]:RGB data, 0 for Red; 1 for green, 2 for Blue
unsigned char Page_Index = 0; // the index of buffer
unsigned char row = 0;//the value of row in LED plane, from 0~7
unsigned char column = 0;//the value of every row, from 0~7
unsigned char color = 0;//the value of every dots, 0 is Red, 1 is Green, 2 is Blue
unsigned char line = 0;

/**************************************************
define the extern data zone
**************************************************/
extern unsigned char font8_8[92][8];
extern unsigned char pic[4][8][8][3];
/***************************************************
all parts inition functions zone
***************************************************/

/*
*函数说明:GPIO初始化 
*入口参数:无
*返回值:无
*/
INT32 GPIO_init(void)
{
    gpioInit(
    3 << 8 | (100 - 1) , /* 100分频 */
    0xff,                         /*  0~31 output */
    0xff,                         /* 32~63 output */
    0xff, /* 使能滤波 */
    0, /* 使能 GPIO0中断,上升沿有效,对应GPIO7 */
    0);/*使能  GPIO4中断,上升沿有效,对应中断号GPI32 */
    //输入输出设置 
    regs->pioDir1 = regs->pioDir1|DDR_RST|DDR_LAT|DDR_SLB|DDR_SDA|DDR_SCL;
    regs->pioDir2 = regs->pioDir2|DDR_openline_BIT0|DDR_openline_BIT1|DDR_openline_BIT2|DDR_openline_BIT3|DDR_openline_BIT4|DDR_openline_BIT5|DDR_openline_BIT6|DDR_openline_BIT7;
    //数据 
    //初始置0 
    regs->pioData1 = regs->pioData1&~(DATA_RST|DATA_LAT|DATA_SLB|DATA_SDA|DATA_SCL);
    regs->pioData2 = regs->pioData2&~(DATA_openline_BIT0|DATA_openline_BIT1|DATA_openline_BIT2|DATA_openline_BIT3|DATA_openline_BIT4|DATA_openline_BIT5|DATA_openline_BIT6|DATA_openline_BIT7);    
    //regs->pioData1 = regs->pioData1|(DATA_RST|DATA_LAT|DATA_SLB|DATA_SDA|DATA_SCL);
    //regs->pioData2 |= (DATA_openline_BIT0|DATA_openline_BIT1|DATA_openline_BIT2|DATA_openline_BIT3|DATA_openline_BIT4|DATA_openline_BIT5|DATA_openline_BIT6|DATA_openline_BIT7); 
    return 1;
}
/****************************************************
the LED Hardware operate functions zone
****************************************************/
void LED_SDA(unsigned char temp)
{
  if (temp) 
    regs->pioData1|=DDR_SDA;
  else
    regs->pioData1&=~DDR_SDA;
}

void LED_SCL(unsigned char temp)
{
  if (temp) 
    regs->pioData1|=DDR_SCL;
  else
    regs->pioData1&=~DDR_SCL;
}

void LED_RST(unsigned char temp)
{
  if (temp) 
    regs->pioData1|=DDR_RST;
  else
    regs->pioData1&=~DDR_RST;
}

void LED_LAT(unsigned char temp)
{
  if (temp) 
    regs->pioData1|=DDR_LAT;
  else
    regs->pioData1&=~DDR_LAT;
}

void LED_SLB(unsigned char temp)
{
  if (temp) 
    regs->pioData1|=DDR_SLB;
  else
    regs->pioData1&=~DDR_SLB;
}
/***************************************************
the LED datas operate functions zone
***************************************************/
void SetGamma()
{
  unsigned char i = 0;
  unsigned char j = 0;
  unsigned char k = 0;
  unsigned char temp = 0;
  LED_LAT(0);
  LED_SLB(0);
  for(k=0;k<8;k++)
    for(i = 3;i > 0 ;i--)
    {
      temp = Gamma_Value[i-1]<<2;
      for(j = 0;j<6;j++)
      {
        if(temp &0x80)
          LED_SDA(1);
        else
          LED_SDA(0);
        temp = temp << 1;
        LED_SCL(0);
        LED_SCL(1);
    }
  }
  LED_SLB(1);
}
void run(unsigned char k)
{
  unsigned char i = 0;
  unsigned char j = 0;
  unsigned char p = 0;
  unsigned char temp = 0;
  LED_SLB(1);
  LED_LAT(0);
  for(i = 0;i<8;i++)
  {
    
    for(j=0;j<3;j++)
    {
      temp = dots[Page_Index][k][i][2-j];
      for(p=0;p<8;p++)
      {
         if(temp & 0x80)
           LED_SDA(1);
         else
           LED_SDA(0);
           
         temp = temp<<1;  
         LED_SCL(0);
         LED_SCL(1);
       }
     }
  }
  LED_LAT(1);
  LED_LAT(0);
}
void open_line(unsigned char x)
{
  switch (x)
  {  
    case 0 :
        {
            regs->pioData2 = regs->pioData2&~(DATA_openline_BIT0|DATA_openline_BIT1|DATA_openline_BIT2|DATA_openline_BIT3|DATA_openline_BIT4|DATA_openline_BIT5|DATA_openline_BIT6|DATA_openline_BIT7);  
            regs->pioData2 = regs->pioData2|DATA_openline_BIT0;
            break;
        }    
    case 1 :
        {
            regs->pioData2 = regs->pioData2&~(DATA_openline_BIT0|DATA_openline_BIT1|DATA_openline_BIT2|DATA_openline_BIT3|DATA_openline_BIT4|DATA_openline_BIT5|DATA_openline_BIT6|DATA_openline_BIT7);  
            regs->pioData2 = regs->pioData2|DATA_openline_BIT1;
            break;
        } 
    case 2 :
        {
            regs->pioData2 = regs->pioData2&~(DATA_openline_BIT0|DATA_openline_BIT1|DATA_openline_BIT2|DATA_openline_BIT3|DATA_openline_BIT4|DATA_openline_BIT5|DATA_openline_BIT6|DATA_openline_BIT7);  
            regs->pioData2 = regs->pioData2|DATA_openline_BIT2;
            break;
        } 
    case 3 :
        {
            regs->pioData2 = regs->pioData2&~(DATA_openline_BIT0|DATA_openline_BIT1|DATA_openline_BIT2|DATA_openline_BIT3|DATA_openline_BIT4|DATA_openline_BIT5|DATA_openline_BIT6|DATA_openline_BIT7);  
            regs->pioData2 = regs->pioData2|DATA_openline_BIT3;
            break;
        } 
    case 4 :
        {
            regs->pioData2 = regs->pioData2&~(DATA_openline_BIT0|DATA_openline_BIT1|DATA_openline_BIT2|DATA_openline_BIT3|DATA_openline_BIT4|DATA_openline_BIT5|DATA_openline_BIT6|DATA_openline_BIT7);  
            regs->pioData2 = regs->pioData2|DATA_openline_BIT4;
            break;
        } 
    case 5 :
        {
            regs->pioData2 = regs->pioData2&~(DATA_openline_BIT0|DATA_openline_BIT1|DATA_openline_BIT2|DATA_openline_BIT3|DATA_openline_BIT4|DATA_openline_BIT5|DATA_openline_BIT6|DATA_openline_BIT7);  
            regs->pioData2 = regs->pioData2|DATA_openline_BIT5;
            break;
        } 
    case 6 :
        {
            regs->pioData2 = regs->pioData2&~(DATA_openline_BIT0|DATA_openline_BIT1|DATA_openline_BIT2|DATA_openline_BIT3|DATA_openline_BIT4|DATA_openline_BIT5|DATA_openline_BIT6|DATA_openline_BIT7);  
            regs->pioData2 = regs->pioData2|DATA_openline_BIT6;
            break;
        } 
    case 7 :
        {
            regs->pioData2 = regs->pioData2&~(DATA_openline_BIT0|DATA_openline_BIT1|DATA_openline_BIT2|DATA_openline_BIT3|DATA_openline_BIT4|DATA_openline_BIT5|DATA_openline_BIT6|DATA_openline_BIT7);  
            regs->pioData2 = regs->pioData2|DATA_openline_BIT7;
            break;
        } 
    default: 
        {
            regs->pioData2 = regs->pioData2&~(DATA_openline_BIT0|DATA_openline_BIT1|DATA_openline_BIT2|DATA_openline_BIT3|DATA_openline_BIT4|DATA_openline_BIT5|DATA_openline_BIT6|DATA_openline_BIT7);  
            break;
        } 
  }
}
/******************************************
the other operate functions zone
******************************************/
void LED_Delay(INT32 i)
{
  unsigned int y;
  y = i * 10;
  while(y--);
}
/********************************************************
Name:DispShowChar
Function:Display a English latter in LED matrix
Parameter:chr :the latter want to show
          R: the value of RED.   Range:RED 0~255
          G: the value of GREEN. Range:RED 0~255
          B: the value of BLUE.  Range:RED 0~255
          bias: the bias of a letter in LED Matrix.Range -7~7
********************************************************/
void DispShowChar(char chr,unsigned char R,unsigned char G,unsigned char B,char bias)
{
  unsigned char i,j,Page_Write,temp;
  unsigned char Char;
  unsigned char chrtemp[24] = {0};
  
  if ((bias > 8) || (bias < -8))
    return;
    
  
  Char = chr - 32;
  
  if(Page_Index == 0)
    Page_Write = 1;
  if(Page_Index == 1)
    Page_Write = 0;
  j = 8 - bias;
  for(i = 0;i< 8;i++)
  {
    chrtemp[j] = font8_8[Char][i];    
    j++;
  }  
  for(i = 0;i < 8;i++)
  {
    
    temp = chrtemp[i+8];
    for(j = 0;j < 8;j++)
    {
      if(temp & 0x80)
      {
        dots[Page_Write][j][i][0] = B;
        dots[Page_Write][j][i][1] = G;
        dots[Page_Write][j][i][2] = R;
      }
      else
      {
        dots[Page_Write][j][i][0] = 0;
        dots[Page_Write][j][i][1] = 0;
        dots[Page_Write][j][i][2] = 0;
      }
      temp = temp << 1;
    }
  }
  Page_Index = Page_Write;  
}
/********************************************************
Name:DispShowColor
Function:Fill a color in LED matrix
Parameter:R: the value of RED.   Range:RED 0~255
          G: the value of GREEN. Range:RED 0~255
          B: the value of BLUE.  Range:RED 0~255
********************************************************/
void DispShowColor(unsigned char R,unsigned char G,unsigned char B)
{
  unsigned char Page_Write,i,j;
  
  if(Page_Index == 0)
    Page_Write = 1;
  if(Page_Index == 1)
    Page_Write = 0;
    
  for (i = 0;i<8;i++)
    for(j = 0;j<8;j++)
    {
      dots[Page_Write][i][j][2] = R;
      dots[Page_Write][i][j][1] = G;
      dots[Page_Write][i][j][0] = B;
    }
  
  Page_Index = Page_Write;
}
/********************************************************
Name:DispShowPic
Function:Fill a picture in LED matrix from FLASH
Parameter:Index:the index of picture in Flash.
********************************************************/
void DispShowPic(unsigned char Index)
{
  unsigned char Page_Write,i,j;
  
  if(Page_Index == 0)
    Page_Write = 1;
  if(Page_Index == 1)
    Page_Write = 0;
    
  for (i = 0;i<8;i++)
  {
    
    for(j = 0;j<8;j++)
    {
      
      dots[Page_Write][i][j][0] = pic[Index][i][j][2];
      dots[Page_Write][i][j][1] = pic[Index][i][j][1];
      dots[Page_Write][i][j][2] = pic[Index][i][j][0];
    }
  }
  Page_Index = Page_Write;
  
}

//LED初始化 
INT32 _LED_Init()
{
  LED_RST(1);
  LED_Delay(1);
  LED_RST(0);
  LED_Delay(1);
  LED_RST(1);
  LED_Delay(1);
  SetGamma();
  line = 0;
  return 1;
}
/*
*函数说明:入口函数
*入口参数:无
*返回值:无
*/
INT32 main()
{
    //关闭中断 
    IrqInit();                  /* 关闭所有一级中断 */
    Irq2Init();                 /* 关闭所有二级中断 */
    //串口初始化
    AdvTimerInit(); 
    //Serial1Init(115200,3);      /* 串口1初始化,使能发送接收 */
    //Serial2Init(115200,3);      /* 串口2初始化,使能发送接收 */
    //Serial3Init(115200,0,3);    /* 串口3初始化,使能发送接收 */
    Serial4Init(115200,0,3);    /* 串口4初始化,使能发送接收 */
	
    Printf("\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n");
    
    Printf("*----------------------------------------------------------*\r\n\r\n");
    Printf("*                      MXT0106 全彩LED显示                     *\r\n");
    Printf("\r\n");
    Printf("*                  Copyright (c) 2011,Edward.xu                *\r\n");
    Printf("\r\n");                                                    
    Printf("*----------------------------------------------------------*\r\n\r\n");
    //GPIO初始化 
    if(GPIO_init()==1)
    {
        Printf("GPIO config is ok \r\n");
    } 
    if(_LED_Init()==1)
    {
        Printf("_LED config is ok \r\n");
    }
    //close_all_line  
    //regs->pioData2 = regs->pioData2&~(DATA_openline_BIT0|DATA_openline_BIT1|DATA_openline_BIT2|DATA_openline_BIT3|DATA_openline_BIT4|DATA_openline_BIT5|DATA_openline_BIT6|DATA_openline_BIT7);    
    Printf("Start LED program \r\n");
    //SysTimerTest(); 
    AdvTimerTest();
    Printf("Timeintrupt config is ok \r\n");
    while(1)
    {
         //DispShowChar('M',60,52,42,0);
         DispShowPic(0);
         Delay(5);
         DispShowPic(1);
         Delay(5);
         DispShowPic(2);
         Delay(5);
         DispShowPic(3);
         Delay(5);
         DispShowPic(4);
         Delay(5);
         DispShowPic(5);
         Delay(5);
    }
    return 0;
}


中断处理

/*
*函数说明:中断处理程序
*入口参数:无
*返回值:无
*/
void Timer0Irq()      //定时器中断处理程序,周期10ms 
{
    //stop
    IrqInit(); 
    //Printf("Timer0Irq\r\n");
    //Printf("HELLO THIS IS xfx\r\n"); 
    if(line > 7) line = 0;    
    //close_all_line
    regs->pioData2 &= ~(DATA_openline_BIT0|DATA_openline_BIT1|DATA_openline_BIT2|DATA_openline_BIT3|DATA_openline_BIT4|DATA_openline_BIT5|DATA_openline_BIT6|DATA_openline_BIT7);       
    run(line);
    open_line(line);
    line++;
    //start
    EnableIrq(14);    /* 使能14号中断(定时器1)   */
}


图像lib.c

//Font                             
char font8_8[92][8] =                                 
{                                                            
    { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },   // sp          
    { 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00 },   // !           
    { 0x00, 0x00, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00 },   // "           
    { 0x00, 0x00, 0x14, 0x7f, 0x14, 0x7f, 0x14, 0x00 },   // #           
    { 0x00, 0x00, 0x24, 0x2a, 0x7f, 0x2a, 0x12, 0x00 },   // $           
    { 0x00, 0x00, 0x62, 0x64, 0x08, 0x13, 0x23, 0x00 },   // %           
    { 0x00, 0x00, 0x36, 0x49, 0x55, 0x22, 0x50, 0x00 },   // &           
    { 0x00, 0x00, 0x00, 0x05, 0x03, 0x00, 0x00, 0x00 },   // '           
    { 0x00, 0x00, 0x00, 0x1c, 0x22, 0x41, 0x00, 0x00 },   // (           
    { 0x00, 0x00, 0x00, 0x41, 0x22, 0x1c, 0x00, 0x00 },   // )           
    { 0x00, 0x00, 0x14, 0x08, 0x3E, 0x08, 0x14, 0x00 },   // *           
    { 0x00, 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00 },   // +           
    { 0x00, 0x00, 0x00, 0x00, 0xA0, 0x60, 0x00, 0x00 },   // ,           
    { 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00 },   // -           
    { 0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x00 },   // .           
    { 0x00, 0x00, 0x20, 0x10, 0x08, 0x04, 0x02, 0x00 },   // /           
    { 0x00, 0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00 },   // 0           
    { 0x00, 0x00, 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00 },   // 1           
    { 0x00, 0x00, 0x42, 0x61, 0x51, 0x49, 0x46, 0x00 },   // 2           
    { 0x00, 0x00, 0x21, 0x41, 0x45, 0x4B, 0x31, 0x00 },   // 3           
    { 0x00, 0x00, 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00 },   // 4           
    { 0x00, 0x00, 0x27, 0x45, 0x45, 0x45, 0x39, 0x00 },   // 5           
    { 0x00, 0x00, 0x3C, 0x4A, 0x49, 0x49, 0x30, 0x00 },   // 6           
    { 0x00, 0x00, 0x01, 0x71, 0x09, 0x05, 0x03, 0x00 },   // 7           
    { 0x00, 0x00, 0x36, 0x49, 0x49, 0x49, 0x36, 0x00 },   // 8           
    { 0x00, 0x00, 0x06, 0x49, 0x49, 0x29, 0x1E, 0x00 },   // 9           
    { 0x00, 0x00, 0x00, 0x36, 0x36, 0x00, 0x00, 0x00 },   // :           
    { 0x00, 0x00, 0x00, 0x56, 0x36, 0x00, 0x00, 0x00 },   // ;           
    { 0x00, 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, 0x00 },   // <           
    { 0x00, 0x00, 0x14, 0x14, 0x14, 0x14, 0x14, 0x00 },   // =           
    { 0x00, 0x00, 0x00, 0x41, 0x22, 0x14, 0x08, 0x00 },   // >           
    { 0x00, 0x00, 0x02, 0x01, 0x51, 0x09, 0x06, 0x00 },   // ?           
    { 0x00, 0x00, 0x32, 0x49, 0x59, 0x51, 0x3E, 0x00 },   // @           
    { 0x00, 0x00, 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00 },   // A           
    { 0x00, 0x00, 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00 },   // B           
    { 0x00, 0x00, 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00 },   // C           
    { 0x00, 0x00, 0x7F, 0x41, 0x41, 0x22, 0x1C, 0x00 },   // D           
    { 0x00, 0x00, 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00 },   // E           
    { 0x00, 0x00, 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00 },   // F           
    { 0x00, 0x00, 0x3E, 0x41, 0x49, 0x49, 0x7A, 0x00 },   // G           
    { 0x00, 0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00 },   // H           
    { 0x00, 0x00, 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00 },   // I           
    { 0x00, 0x00, 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00 },   // J           
    { 0x00, 0x00, 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00 },   // K           
    { 0x00, 0x00, 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00 },   // L           
    { 0x00, 0x00, 0x7F, 0x02, 0x0C, 0x02, 0x7F, 0x00 },   // M           
    { 0x00, 0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00 },   // N           
    { 0x00, 0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00 },   // O           
    { 0x00, 0x00, 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00 },   // P           
    { 0x00, 0x00, 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00 },   // Q           
    { 0x00, 0x00, 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00 },   // R           
    { 0x00, 0x00, 0x46, 0x49, 0x49, 0x49, 0x31, 0x00 },   // S           
    { 0x00, 0x00, 0x01, 0x01, 0x7F, 0x01, 0x01, 0x00 },   // T           
    { 0x00, 0x00, 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00 },   // U           
    { 0x00, 0x00, 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00 },   // V           
    { 0x00, 0x00, 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00 },   // W           
    { 0x00, 0x00, 0x63, 0x14, 0x08, 0x14, 0x63, 0x00 },   // X           
    { 0x00, 0x00, 0x07, 0x08, 0x70, 0x08, 0x07, 0x00 },   // Y           
    { 0x00, 0x00, 0x61, 0x51, 0x49, 0x45, 0x43, 0x00 },   // Z           
    { 0x00, 0x00, 0x00, 0x7F, 0x41, 0x41, 0x00, 0x00 },   // [           
    { 0x00, 0x00, 0x55, 0x2A, 0x55, 0x2A, 0x55, 0x00 },   // 55          
    { 0x00, 0x00, 0x00, 0x41, 0x41, 0x7F, 0x00, 0x00 },   // ]           
    { 0x00, 0x00, 0x04, 0x02, 0x01, 0x02, 0x04, 0x00 },   // ^           
    { 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00 },   // _           
    { 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x00, 0x00 },   // '           
    { 0x00, 0x00, 0x20, 0x54, 0x54, 0x54, 0x78, 0x00 },   // a           
    { 0x00, 0x00, 0x7F, 0x48, 0x44, 0x44, 0x38, 0x00 },   // b           
    { 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x20, 0x00 },   // c           
    { 0x00, 0x00, 0x38, 0x44, 0x44, 0x48, 0x7F, 0x00 },   // d           
    { 0x00, 0x00, 0x38, 0x54, 0x54, 0x54, 0x18, 0x00 },   // e           
    { 0x00, 0x00, 0x08, 0x7E, 0x09, 0x01, 0x02, 0x00 },   // f           
    { 0x00, 0x00, 0x18, 0xA4, 0xA4, 0xA4, 0x7C, 0x00 },   // g           
    { 0x00, 0x00, 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00 },   // h           
    { 0x00, 0x00, 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00 },   // i           
    { 0x00, 0x00, 0x40, 0x80, 0x84, 0x7D, 0x00, 0x00 },   // j           
    { 0x00, 0x00, 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00 },   // k           
    { 0x00, 0x00, 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00 },   // l           
    { 0x00, 0x00, 0x7C, 0x04, 0x18, 0x04, 0x78, 0x00 },   // m           
    { 0x00, 0x00, 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00 },   // n           
    { 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00 },   // o           
    { 0x00, 0x00, 0xFC, 0x24, 0x24, 0x24, 0x18, 0x00 },   // p           
    { 0x00, 0x00, 0x18, 0x24, 0x24, 0x18, 0xFC, 0x00 },   // q           
    { 0x00, 0x00, 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00 },   // r           
    { 0x00, 0x00, 0x48, 0x54, 0x54, 0x54, 0x20, 0x00 },   // s           
    { 0x00, 0x00, 0x04, 0x3F, 0x44, 0x40, 0x20, 0x00 },   // t           
    { 0x00, 0x00, 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00 },   // u           
    { 0x00, 0x00, 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00 },   // v           
    { 0x00, 0x00, 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00 },   // w           
    { 0x00, 0x00, 0x44, 0x28, 0x10, 0x28, 0x44, 0x00 },   // x           
    { 0x00, 0x00, 0x1C, 0xA0, 0xA0, 0xA0, 0x7C, 0x00 },   // y           
    { 0x00, 0x00, 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00 },   // z           
    { 0x00, 0x00, 0x00, 0x06, 0x09, 0x09, 0x06, 0x00 }    // horiz lines  
}; 

//pic
char pic[6][8][8][3] = {
                                 {{{0,0,255},   {0,0,255},   {0,165,255}, {0,165,255},  {0,255,255},  {0,255,255}, {0,255,0},    {0,255,0}},
                                  {{0,0,255},   {0,165,255}, {0,165,255}, {0,255,255},  {0,255,255},  {0,255,0},   {0,255,0},    {255,127,0}},
                                  {{0,165,255}, {0,165,255}, {0,255,255}, {0,255,255},  {0,255,0},    {0,255,0},   {255,127,0},  {255,127,0}},
                                  {{0,165,255}, {0,255,255}, {0,255,255}, {0,255,0},    {0,255,0},    {255,127,0}, {255,127,0},  {255,0,0}},
                                  {{0,255,255}, {0,255,255}, {0,255,0},   {0,255,0},    {255,127,0},  {255,127,0}, {255,0,0},    {255,0,0}},
                                  {{0,255,255}, {0,255,0},   {0,255,0},   {255,127,0},  {255,127,0},  {255,0,0},   {255,0,0},    {255,0,139}},
                                  {{0,255,0},   {0,255,0},   {255,127,0}, {255,127,0},  {255,0,0},    {255,0,0},   {255,0,139},  {255,0,139}},
                                  {{0,255,0},   {255,127,0}, {255,127,0}, {255,0,0},    {255,0,0},    {255,0,139}, {255,0,139},  {255,255,255}}
                                 },
                                 
                                 {{{255,0,0},     {255,0,0},      {255,0,0},     {255,0,0},    {0,255,0},      {0,255,0},       {0,255,0},        {0,255,0}},
                                  {{255,0,0},     {255,0,0},      {255,0,0},     {255,0,0},    {0,255,0},      {0,255,0},       {0,255,0},        {0,255,0}},
                                  {{255,0,0},     {255,0,0},      {255,0,0},     {255,0,0},    {0,255,0},      {0,255,0},       {0,255,0},        {0,255,0}},
                                  {{255,0,0},     {255,0,0},      {255,0,0},     {255,0,0},    {0,255,0},      {0,255,0},       {0,255,0},        {0,255,0}},
                                  {{0,0,255},     {0,0,255},      {0,0,255},     {0,0,255},    {255,255,255},  {255,255,255},   {255,255,255},    {255,255,255}},
                                  {{0,0,255},     {0,0,255},      {0,0,255},     {0,0,255},    {255,255,255},  {255,255,255},   {255,255,255},    {255,255,255}},
                                  {{0,0,255},     {0,0,255},      {0,0,255},     {0,0,255},    {255,255,255},  {255,255,255},   {255,255,255},    {255,255,255}},
                                  {{0,0,255},     {0,0,255},      {0,0,255},     {0,0,255},    {255,255,255},  {255,255,255},   {255,255,255},    {255,255,255}}
                                 },
                                 
                                 {{{0,0,255},     {0,0,255},      {0,0,255},     {0,0,255},    {0,0,255},      {0,0,255},       {0,0,255},        {0,0,255}},
                                  {{0,165,255},   {0,165,255},    {0,165,255},   {0,165,255},  {0,165,255},    {0,165,255},     {0,165,255},      {0,165,255}},
                                  {{0,255,255},   {0,255,255},    {0,255,255},   {0,255,255},  {0,255,255},    {0,255,255},     {0,255,255},      {0,255,255}},
                                  {{0,255,0},     {0,255,0},      {0,255,0},     {0,255,0},    {0,255,0},      {0,255,0},       {0,255,0},        {0,255,0}},
                                  {{255,127,0},   {255,127,0},    {255,127,0},   {255,127,0},  {255,127,0},    {255,127,0},     {255,127,0},      {255,127,0}},
                                  {{255,0,0},     {255,0,0},      {255,0,0},     {255,0,0},    {255,0,0},      {255,0,0},       {255,0,0},        {255,0,0}},
                                  {{255,0,139},   {255,0,139},    {255,0,139},   {255,0,139},  {255,0,139},    {255,0,139},     {255,0,139},      {255,0,139}},
                                  {{255,255,254}, {255,255,255},  {255,255,255}, {255,255,254},{255,255,255},  {255,255,255},   {255,255,254},    {255,255,255}}
                                 },
                                 
                                 {{{255,255,254},     {255,255,255},      {255,255,255},     {255,255,255},    {255,255,255},      {255,255,255},       {255,255,255},        {255,255,255}},
                                  {{255,255,254},     {255,255,255},      {255,255,255},     {255,255,255},    {255,255,255},      {255,255,255},       {255,255,255},        {255,255,255}},
                                  {{255,255,254},     {255,255,255},      {255,255,255},     {255,255,255},    {255,255,255},      {255,255,255},       {255,255,255},        {255,255,255}},
                                  {{255,255,254},     {255,255,255},      {255,255,255},     {255,255,255},    {255,255,255},      {255,255,255},       {255,255,255},        {255,255,255}},
                                  {{255,255,254},     {255,255,255},      {255,255,255},     {255,255,255},    {255,255,255},      {255,255,255},       {255,255,255},        {255,255,255}},
                                  {{255,255,254},     {255,255,255},      {255,255,255},     {255,255,255},    {255,255,255},      {255,255,255},       {255,255,255},        {255,255,255}},
                                  {{255,255,254},     {255,255,255},      {255,255,255},     {255,255,255},    {255,255,255},      {255,255,255},       {255,255,255},        {255,255,255}},
                                  {{255,255,254},     {255,255,255},      {255,255,255},     {255,255,255},    {255,255,255},      {255,255,255},       {255,255,255},        {255,255,255}}
                                 },
                                 
                                 {{{254,254,254},     {254,254,254},      {254,254,254},     {254,254,254},    {254,254,254},      {254,254,254},       {254,254,254},        {254,254,254}},
                                  {{255,255,254},     {0,0,0},            {0,0,0},           {254,254,254},    {254,254,254},      {0,0,0},             {0,0,0},              {254,254,254}},
                                  {{255,255,254},     {0,0,0},            {254,254,254},     {0,0,0},          {0,0,0},            {254,254,254},       {0,0,0},              {254,254,254}},
                                  {{255,255,254},     {254,254,254},      {0,0,0},           {0,0,0},          {0,0,0},            {0,0,0},             {254,254,254},        {254,254,254}},
                                  {{255,255,254},     {0,0,0},            {254,254,254},     {254,254,254},    {254,254,254},      {254,254,254},       {0,0,0},              {254,254,254}},
                                  {{255,255,254},     {0,0,0},            {254,254,254},     {0,0,0},          {0,0,0},            {254,254,254},       {0,0,0},              {254,254,254}},
                                  {{255,255,254},     {0,0,0},            {254,254,254},     {254,254,254},    {254,254,254},      {254,254,254},       {0,0,0},              {254,254,254}},
                                  {{255,255,254},     {254,254,254},      {254,254,254},     {254,254,254},    {254,254,254},      {254,254,254},       {254,254,254},        {254,254,254}}
                                 },
                                 
                                 {{{0,0,0},           {0,0,0},            {0,0,0},           {0,0,0},          {0,0,0},            {0,0,0},             {0,0,0},              {0,0,0}},
                                  {{0,0,0},           {254,254,254},      {254,254,254},     {0,0,0},          {0,0,0},            {254,254,254},       {254,254,254},        {0,0,0}},
                                  {{0,0,0},           {254,254,254},      {0,0,0},           {0,0,0},          {0,0,0},            {0,0,0},             {254,254,254},        {0,0,0}},
                                  {{0,0,0},           {0,0,0},            {0,0,0},           {254,254,254},    {254,254,254},      {0,0,0},             {0,0,0},              {0,0,0}},
                                  {{0,0,0},           {0,0,0},            {0,0,0},           {254,254,254},    {254,254,254},      {0,0,0},             {0,0,0},              {0,0,0}},
                                  {{0,0,0},           {254,254,254},      {0,0,0},           {0,0,0},          {0,0,0},            {0,0,0},             {254,254,254},        {0,0,0}},
                                  {{0,0,0},           {0,0,0},            {254,254,254},     {254,254,254},    {254,254,254},      {254,254,254},       {0,0,0},              {0,0,0}},
                                  {{0,0,0},           {0,0,0},            {0,0,0},           {0,0,0},          {0,0,0},            {0,0,0},             {0,0,0},              {0,0,0}}
                                 }
};


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics