📄 ipod_show_logo.c
字号:
#include "ipod_font.h"
unsigned char Fm_100,Fm_10,Fm_1,Fm_0;
main()
{
Fm_100=10;//1字符空
Fm_10=8;
Fm_1=7;
Fm_0=5;
Head_Cmd();
Head_Cmd();
Head_Cmd();
Show_Pictrue();
Fill_Rect_0_Region(0);//1 零区是特殊区域
Fill_Rect_any_Region(1,0);//1 在第一区填零
Show_Char_8(2,0); //1在第二区显示字符最高八点阵
Show_Char_8(3,1); //1在第三区显示字符中间八点阵
Show_Char_8(4,2); //1在第四区显示字符低八点阵
//Fill_Rect_any_Region(5,0);
//Fill_Rect_any_Region(6,0);
//Fill_Rect_any_Region(7,0);
//Exit_Show_Picture();
}
unsigned char Show_Char(unsigned char y1,unsigned char crc)
{
unsigned char temp;
unsigned char temp1=0;
int x,y;
for(y = y1;y < y1+8; y++ )
{
for(x = 0 ; x < Screen_With*2;)//F
{
if(x < FM_End)//发送fm内容
{
temp=FM[y][(x-Start_)/8];
crc+=temp;
//发送单个数据
SendiPodCmd(&temp,1);
}
else if(x < Fm_100_End)//100
{
temp1=FM_End;
temp=C_num[Fm_100][y][(x-temp1)/8];
crc+=temp;
//发送单个数据
SendiPodCmd(&temp,1);
}
else if(x < Fm_10_End )//10
{
temp1=Fm_100_End;
temp=C_num[Fm_10][y][(x-temp1)/8];
crc+=temp;
//发送单个数据
SendiPodCmd(&temp,1);
}
else if(x < Fm_1_End )//1
{
temp1=Fm_10_End;
temp=C_num[Fm_1][y][(x-temp1)/8];
crc+=temp;
//发送单个数据
SendiPodCmd(&temp,1);
}
else if(x < Fm_D_End)
{
temp1=Fm_1_End;
temp=D[y][(x-temp1)/8];
crc+=temp;
//发送单个数据
SendiPodCmd(&temp,1);
}
else if(x < Fm_0_End )//0
{
temp1=Fm_D_End;
temp=C_num[Fm_0][y][(x-temp1)/8];
crc+=temp;
//发送单个数据
SendiPodCmd(&temp,1);
}
else if(x < Fm_Mhz_End )
{
temp1=Fm_0_End;
temp=C_Mhz[y][(x-temp1)/8];
crc+=temp;
//发送单个数据
SendiPodCmd(&temp,1);
}
x+=8;
}
}
return crc;
}
const unsigned char show_pictrue_cmd[4][10]=
{
{0x08,0xFF,0x55,0x04,0x02,0x00,0x00,0x02,0xF8,},
{0x07,0xFF,0x55,0x03,0x02,0x00,0x00,0xFB,},
{0x09,0xFF,0x55,0x05,0x02,0x00,0x00,0x00,0x08,0xF1,},
{0x07,0xFF,0x55,0x03,0x00,0x01,0x04,0xF8,},
};
void Show_Pictrue()
{
unsigned char i,j,data;
for(i = 0; i < 4 ; i++)
{
for(j = 1 ; j <= show_pictrue_cmd[i][0];j++)
{
data=show_pictrue_cmd[i][j];
//发送单个字节
//SendiPodCmd(&crc,1);
}
}
}
//发送第一个八行
const unsigned char first_cmd[]=
{
0xff,0x55,0x00,0x01,0x0e,0x04,0x00,0x32,0x00,0x00,0x01,0x00,Screen_With,0x00,Screen_High,0x00,0x00,0x00,0x20
};
void Fill_Rect_0_Region(unsigned char color)
{
unsigned char crc,data;
unsigned char i;
crc=0;
for( i = 0 ; i < 19 ; i++)
{
data=first_cmd[i];
if(i>1)
crc+=data;
SendiPodCmd(&data,1);
}
//第一个八行以零填充 连续发送256个零(8行*(128/4))
data=color;
for( i = 0 ; i < 255 ; i++)
{
crc+=data;
SendiPodCmd(&data,1);
}
crc+=data;
SendiPodCmd(&data,1);
crc^=0xff;
crc++;
SendiPodCmd(&crc,1);
}
//第三次发送
const unsigned char second_cmd[]=
{
0xff,0x55,0x00,0x01,0x05,0x04,0x00,0x32,0x00
};
//region 范围是1---7区
void Fill_Rect_any_Region(unsigned char region ,unsigned char color)
{
unsigned char crc;
unsigned char i,data;
crc=0;
for( i = 0 ; i < 9 ; i++)
{
data=second_cmd[i];
if(i>1)
crc+=data;
SendiPodCmd(&data,1);
}
data=region;
crc+=data;
SendiPodCmd(&data,1);
//第一个八行以零填充 连续发送256个零(8行*(128/4))
data=color;
for( i = 0 ; i < 255 ; i++)
{
crc+=data;
SendiPodCmd(&data,1);
}
crc+=data;
SendiPodCmd(&data,1);
crc^=0xff;
crc++;
SendiPodCmd(&crc,1);
}
//region 范围是1---7区
void Show_Char_8(unsigned char region,unsigned char y1)
{
unsigned char crc=0,data;
unsigned char i;
crc=0;
for( i = 0 ; i < 9 ; i++)
{
data=second_cmd[i];
if(i>1)
crc+=data;
SendiPodCmd(&data,1);
}
data=region;
crc+=data;
SendiPodCmd(&data,1);
//发送字符的高八行共256个字符
crc=Show_Char(y1<<3,crc);
crc^=0xff;
crc++;
SendiPodCmd(&crc,1);
}
const unsigned char Exit_Cmd[8][11]=
{
{0x04,0x02,0x00,0x03,0xFB},
{0x09,0xFF,0x55,0x05,0x02,0x00,0x00,0x00,0x08,0xF1},
{0x0a,0xFF,0x55,0x06,0x02,0x00,0x00,0x00,0x00,0x00,0xF8},
{0x06,0xFF,0x55,0x02,0x00,0x06,0xF8},
{0x06,0xFF,0x55,0x02,0x00,0x03,0xFB},
{0x07,0xFF,0x55,0x03,0x02,0x00,0x01,0xFA },
{0x0a,0xFF,0x55,0x06,0x02,0x00,0x00,0x00,0x00,0x00,0xF8 },
{0x02,0x00,0x3F},
};
void Exit_Show_Picture()
{
unsigned char i,j,data;
for(i = 0; i < 8 ; i++)
{
for(j = 1 ; j <= Exit_Cmd[i][0];j++)
{
data=Exit_Cmd[i][j];
//发送单个字节
//SendiPodCmd(&crc,1);
}
}
}
const unsigned char cmd[7][11]=
{
{0x06,0xFF,0x55,0x02,0x00,0x03,0xFB,},
{0x09,0xFF,0x55,0x05,0x02,0x00,0x00,0x00,0x08,0xF1,},
{0x0A,0xFF,0x55,0x06,0x02,0x00,0x00,0x00,0x00,0x00,0xF8,},
{0x06,0xFF,0x55,0x02,0x00,0x06,0xF8,},
{0x06,0xFF,0x55,0x02,0x00,0x03,0xFB,},
{0x07,0xFF,0x55,0x03,0x02,0x00,0x01,0xFA,},
{0x0A,0xFF,0x55,0x06,0x02,0x00,0x00,0x00,0x00,0x00,0xF8,},
};
void Head_Cmd()
{
unsigned char i,j,data;
for(i = 0; i < 7 ; i++)
{
for(j = 1 ; j <= cmd[i][0];j++)
{
data=cmd[i][j];
//发送单个字节
//SendiPodCmd(&crc,1);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -