Fix garbled code about bmp.h oled.c oled.h oledfont.h .
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
//////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
//<EFBFBD>洢ͼƬ<EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>ͼƬ<EFBFBD><EFBFBD>СΪ64*32<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
//存储图片数据,图片大小为64*32像素
|
||||||
//
|
//
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ unsigned char BMP1[] =
|
|||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x20,0x40,0x40,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x20,0x40,0x40,
|
||||||
0x40,0x50,0x20,0x5F,0x80,0x00,0x1F,0x20,0x40,0x40,0x40,0x50,0x20,0x5F,0x80,0x00,/*"C:\Users\evk\Desktop\??2014.bmp",0*/
|
0x40,0x50,0x20,0x5F,0x80,0x00,0x1F,0x20,0x40,0x40,0x40,0x50,0x20,0x5F,0x80,0x00,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
#include "oled.h"
|
#include "oled.h"
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "oledfont.h"
|
#include "oledfont.h"
|
||||||
//OLED<EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD>
|
//OLED的显存
|
||||||
//<EFBFBD><EFBFBD><EFBFBD>Ÿ<EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
//存放格式如下.
|
||||||
//-----------------------------------
|
//-----------------------------------
|
||||||
//|x<EFBFBD><EFBFBD>[0,127] |
|
//|x→[0,127] |
|
||||||
//| OLED<EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> |
|
//| OLED显示坐标 |
|
||||||
//|y <EFBFBD><EFBFBD>Χ |
|
//|y 范围 |
|
||||||
//|<EFBFBD><EFBFBD> |
|
//|↓ |
|
||||||
//|[0,31] |
|
//|[0,31] |
|
||||||
//-----------------------------------
|
//-----------------------------------
|
||||||
/**********************************************
|
/**********************************************
|
||||||
@@ -120,60 +120,60 @@ void fill_picture(unsigned char fill_Data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
//坐标设置
|
||||||
void OLED_Set_Pos(unsigned char x, unsigned char y)
|
void OLED_Set_Pos(unsigned char x, unsigned char y)
|
||||||
{
|
{
|
||||||
OLED_WR_Byte(0xb0+y,OLED_CMD);
|
OLED_WR_Byte(0xb0+y,OLED_CMD);
|
||||||
OLED_WR_Byte(((x&0xf0)>>4)|0x10,OLED_CMD);
|
OLED_WR_Byte(((x&0xf0)>>4)|0x10,OLED_CMD);
|
||||||
OLED_WR_Byte((x&0x0f),OLED_CMD);
|
OLED_WR_Byte((x&0x0f),OLED_CMD);
|
||||||
}
|
}
|
||||||
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD>OLED<EFBFBD><EFBFBD>ʾ
|
//开启OLED显示
|
||||||
void OLED_Display_On(void)
|
void OLED_Display_On(void)
|
||||||
{
|
{
|
||||||
OLED_WR_Byte(0X8D,OLED_CMD); //SET DCDC<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
OLED_WR_Byte(0X8D,OLED_CMD); //SET DCDC命令
|
||||||
OLED_WR_Byte(0X14,OLED_CMD); //DCDC ON
|
OLED_WR_Byte(0X14,OLED_CMD); //DCDC ON
|
||||||
OLED_WR_Byte(0XAF,OLED_CMD); //DISPLAY ON
|
OLED_WR_Byte(0XAF,OLED_CMD); //DISPLAY ON
|
||||||
}
|
}
|
||||||
//<EFBFBD>ر<EFBFBD>OLED<EFBFBD><EFBFBD>ʾ
|
//关闭OLED显示
|
||||||
void OLED_Display_Off(void)
|
void OLED_Display_Off(void)
|
||||||
{
|
{
|
||||||
OLED_WR_Byte(0X8D,OLED_CMD); //SET DCDC<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
OLED_WR_Byte(0X8D,OLED_CMD); //SET DCDC命令
|
||||||
OLED_WR_Byte(0X10,OLED_CMD); //DCDC OFF
|
OLED_WR_Byte(0X10,OLED_CMD); //DCDC OFF
|
||||||
OLED_WR_Byte(0XAE,OLED_CMD); //DISPLAY OFF
|
OLED_WR_Byte(0XAE,OLED_CMD); //DISPLAY OFF
|
||||||
}
|
}
|
||||||
//ע<EFBFBD>⣺<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD>Ǻ<EFBFBD>ɫ<EFBFBD><C9AB>!<21><>û<EFBFBD><C3BB><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>!!!
|
//注意:清屏函数,清完屏,整个屏幕是黑色的!和没点亮一样!!!
|
||||||
void OLED_Clear(void)
|
void OLED_Clear(void)
|
||||||
{
|
{
|
||||||
uint8_t i,n;
|
uint8_t i,n;
|
||||||
for(i=0;i<8;i++)
|
for(i=0;i<8;i++)
|
||||||
{
|
{
|
||||||
OLED_WR_Byte (0xb0+i,OLED_CMD); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD>0~7<EFBFBD><EFBFBD>
|
OLED_WR_Byte (0xb0+i,OLED_CMD); //设置页地址(0~7)
|
||||||
OLED_WR_Byte (0x00,OLED_CMD); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾλ<EFBFBD>á<EFBFBD><EFBFBD>е͵<EFBFBD>ַ
|
OLED_WR_Byte (0x00,OLED_CMD); //设置显示位置—列低地址
|
||||||
OLED_WR_Byte (0x10,OLED_CMD); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾλ<EFBFBD>á<EFBFBD><EFBFBD>иߵ<EFBFBD>ַ
|
OLED_WR_Byte (0x10,OLED_CMD); //设置显示位置—列高地址
|
||||||
for(n=0;n<128;n++)
|
for(n=0;n<128;n++)
|
||||||
OLED_WR_Byte(0,OLED_DATA);
|
OLED_WR_Byte(0,OLED_DATA);
|
||||||
} //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
} //更新显示
|
||||||
}
|
}
|
||||||
void OLED_On(void)
|
void OLED_On(void)
|
||||||
{
|
{
|
||||||
uint8_t i,n;
|
uint8_t i,n;
|
||||||
for(i=0;i<8;i++)
|
for(i=0;i<8;i++)
|
||||||
{
|
{
|
||||||
OLED_WR_Byte (0xb0+i,OLED_CMD); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD>0~7<EFBFBD><EFBFBD>
|
OLED_WR_Byte (0xb0+i,OLED_CMD); //设置页地址(0~7)
|
||||||
OLED_WR_Byte (0x00,OLED_CMD); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾλ<EFBFBD>á<EFBFBD><EFBFBD>е͵<EFBFBD>ַ
|
OLED_WR_Byte (0x00,OLED_CMD); //设置显示位置—列低地址
|
||||||
OLED_WR_Byte (0x10,OLED_CMD); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾλ<EFBFBD>á<EFBFBD><EFBFBD>иߵ<EFBFBD>ַ
|
OLED_WR_Byte (0x10,OLED_CMD); //设置显示位置—列高地址
|
||||||
for(n=0;n<128;n++)OLED_WR_Byte(1,OLED_DATA);
|
for(n=0;n<128;n++)OLED_WR_Byte(1,OLED_DATA);
|
||||||
} //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
} //更新显示
|
||||||
}
|
}
|
||||||
//<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾһ<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD>
|
//在指定位置显示一个字符,包括部分字符
|
||||||
//x:0~127
|
//x:0~127
|
||||||
//y:0~63
|
//y:0~63
|
||||||
//
|
//
|
||||||
//size:ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 16/12
|
//size:选择字体 16/12
|
||||||
void OLED_ShowChar(uint8_t x,uint8_t y,uint8_t chr,uint8_t Char_Size)
|
void OLED_ShowChar(uint8_t x,uint8_t y,uint8_t chr,uint8_t Char_Size)
|
||||||
{
|
{
|
||||||
unsigned char c=0,i=0;
|
unsigned char c=0,i=0;
|
||||||
c=chr-' ';//<EFBFBD>õ<EFBFBD>ƫ<EFBFBD>ƺ<EFBFBD><EFBFBD><EFBFBD>ֵ
|
c=chr-' ';//得到偏移后的值
|
||||||
if(x>Max_Column-1){x=0;y=y+2;}
|
if(x>Max_Column-1){x=0;y=y+2;}
|
||||||
if(Char_Size ==16)
|
if(Char_Size ==16)
|
||||||
{
|
{
|
||||||
@@ -183,9 +183,10 @@ void OLED_ShowChar(uint8_t x,uint8_t y,uint8_t chr,uint8_t Char_Size)
|
|||||||
OLED_WR_Byte(F8X16[c*16+i],OLED_DATA);
|
OLED_WR_Byte(F8X16[c*16+i],OLED_DATA);
|
||||||
}
|
}
|
||||||
OLED_Set_Pos(x,y+1);
|
OLED_Set_Pos(x,y+1);
|
||||||
for(i=0;i<8;i++)
|
for(i=0;i<8;i++){
|
||||||
OLED_WR_Byte(F8X16[c*16+i+8],OLED_DATA);
|
OLED_WR_Byte(F8X16[c*16+i+8],OLED_DATA);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OLED_Set_Pos(x,y);
|
OLED_Set_Pos(x,y);
|
||||||
@@ -193,19 +194,19 @@ void OLED_ShowChar(uint8_t x,uint8_t y,uint8_t chr,uint8_t Char_Size)
|
|||||||
OLED_WR_Byte(F6x8[c][i],OLED_DATA);
|
OLED_WR_Byte(F6x8[c][i],OLED_DATA);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//m^n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
//m^n函数
|
||||||
uint32_t oled_pow(uint8_t m,uint8_t n)
|
uint32_t oled_pow(uint8_t m,uint8_t n)
|
||||||
{
|
{
|
||||||
uint32_t result=1;
|
uint32_t result=1;
|
||||||
while(n--)result*=m;
|
while(n--)result*=m;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
//<EFBFBD><EFBFBD>ʾ2<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
//显示2个数字
|
||||||
//x,y :<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
//x,y :起点坐标
|
||||||
//len :<EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD>λ<EFBFBD><EFBFBD>
|
//len :数字的位数
|
||||||
//size:<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С
|
//size:字体大小
|
||||||
//
|
//
|
||||||
//num:<EFBFBD><EFBFBD>ֵ(0~4294967295);
|
//num:数值(0~4294967295);
|
||||||
void OLED_ShowNum(uint8_t x,uint8_t y,uint32_t num,uint8_t len,uint8_t size2)
|
void OLED_ShowNum(uint8_t x,uint8_t y,uint32_t num,uint8_t len,uint8_t size2)
|
||||||
{
|
{
|
||||||
uint8_t t,temp;
|
uint8_t t,temp;
|
||||||
@@ -225,7 +226,7 @@ void OLED_ShowNum(uint8_t x,uint8_t y,uint32_t num,uint8_t len,uint8_t size2)
|
|||||||
OLED_ShowChar(x+(size2/2)*t,y,temp+'0',size2);
|
OLED_ShowChar(x+(size2/2)*t,y,temp+'0',size2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//<EFBFBD><EFBFBD>ʾһ<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD>Ŵ<EFBFBD>
|
//显示一个字符号串
|
||||||
void OLED_ShowString(uint8_t x,uint8_t y,uint8_t *chr,uint8_t Char_Size)
|
void OLED_ShowString(uint8_t x,uint8_t y,uint8_t *chr,uint8_t Char_Size)
|
||||||
{
|
{
|
||||||
unsigned char j=0;
|
unsigned char j=0;
|
||||||
@@ -240,7 +241,7 @@ void OLED_ShowString(uint8_t x,uint8_t y,uint8_t *chr,uint8_t Char_Size)
|
|||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//<EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
//显示汉字
|
||||||
void OLED_ShowCHinese(uint8_t x,uint8_t y,uint8_t no)
|
void OLED_ShowCHinese(uint8_t x,uint8_t y,uint8_t no)
|
||||||
{
|
{
|
||||||
uint8_t t,adder=0;
|
uint8_t t,adder=0;
|
||||||
@@ -257,7 +258,7 @@ void OLED_ShowCHinese(uint8_t x,uint8_t y,uint8_t no)
|
|||||||
adder+=1;
|
adder+=1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/***********<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD>ʾBMPͼƬ128<EFBFBD><EFBFBD>64<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(x,y),x<>ķ<EFBFBD>Χ0<CEA7><30>127<32><37>yΪҳ<CEAA>ķ<EFBFBD>Χ0<CEA7><30>7*****************/
|
/***********功能描述:显示显示BMP图片128×64起始点坐标(x,y),x的范围0〜127,y为页的范围0〜7*****************/
|
||||||
void OLED_DrawBMP(unsigned char x0, unsigned char y0,unsigned char x1, unsigned char y1,unsigned char BMP[])
|
void OLED_DrawBMP(unsigned char x0, unsigned char y0,unsigned char x1, unsigned char y1,unsigned char BMP[])
|
||||||
{
|
{
|
||||||
unsigned int j=0;
|
unsigned int j=0;
|
||||||
@@ -275,25 +276,25 @@ void OLED_DrawBMP(unsigned char x0, unsigned char y0,unsigned char x1, unsigned
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>OLED
|
//初始化OLED
|
||||||
void OLED_Init(void)
|
void OLED_Init(void)
|
||||||
{
|
{
|
||||||
HAL_Delay(200);
|
HAL_Delay(200);
|
||||||
OLED_WR_Byte(0xAE,OLED_CMD);//<EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD>ʾ
|
OLED_WR_Byte(0xAE,OLED_CMD);//关闭显示
|
||||||
|
|
||||||
OLED_WR_Byte(0x40,OLED_CMD);//---set low column address
|
OLED_WR_Byte(0x40,OLED_CMD);//---set low column address
|
||||||
OLED_WR_Byte(0xB0,OLED_CMD);//---set high column address
|
OLED_WR_Byte(0xB0,OLED_CMD);//---set high column address
|
||||||
|
|
||||||
OLED_WR_Byte(0xC8,OLED_CMD);//-not offset
|
OLED_WR_Byte(0xC8,OLED_CMD);//-not offset
|
||||||
|
|
||||||
OLED_WR_Byte(0x81,OLED_CMD);//<EFBFBD><EFBFBD><EFBFBD>öԱȶ<EFBFBD>
|
OLED_WR_Byte(0x81,OLED_CMD);//设置对比度
|
||||||
OLED_WR_Byte(0xff,OLED_CMD);
|
OLED_WR_Byte(0xff,OLED_CMD);
|
||||||
|
|
||||||
OLED_WR_Byte(0xa1,OLED_CMD);//<EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
OLED_WR_Byte(0xa1,OLED_CMD);//段重定向设置
|
||||||
|
|
||||||
OLED_WR_Byte(0xa6,OLED_CMD);//
|
OLED_WR_Byte(0xa6,OLED_CMD);//
|
||||||
|
|
||||||
OLED_WR_Byte(0xa8,OLED_CMD);//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>
|
OLED_WR_Byte(0xa8,OLED_CMD);//设置驱动路数
|
||||||
OLED_WR_Byte(0x1f,OLED_CMD);
|
OLED_WR_Byte(0x1f,OLED_CMD);
|
||||||
|
|
||||||
OLED_WR_Byte(0xd3,OLED_CMD);
|
OLED_WR_Byte(0xd3,OLED_CMD);
|
||||||
|
@@ -11,20 +11,20 @@
|
|||||||
#define Brightness 0xFF
|
#define Brightness 0xFF
|
||||||
#define X_WIDTH 128
|
#define X_WIDTH 128
|
||||||
#define Y_WIDTH 64
|
#define Y_WIDTH 64
|
||||||
//-----------------OLED IIC<EFBFBD>˿ڶ<EFBFBD><EFBFBD><EFBFBD>----------------
|
//-----------------OLED IIC端口定义----------------
|
||||||
//HAL_GPIO_WritePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState);
|
//HAL_GPIO_WritePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState);
|
||||||
#define OLED_SCLK_Clr() HAL_GPIO_WritePin(GPIOB,GPIO_PIN_10, GPIO_PIN_RESET);//SDA IIC<EFBFBD>ӿڵ<EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD>
|
#define OLED_SCLK_Clr() HAL_GPIO_WritePin(GPIOB,GPIO_PIN_10, GPIO_PIN_RESET);//SDA IIC接口的时钟信号
|
||||||
#define OLED_SCLK_Set() HAL_GPIO_WritePin(GPIOB,GPIO_PIN_10, GPIO_PIN_SET);
|
#define OLED_SCLK_Set() HAL_GPIO_WritePin(GPIOB,GPIO_PIN_10, GPIO_PIN_SET);
|
||||||
|
|
||||||
#define OLED_SDIN_Clr() HAL_GPIO_WritePin(GPIOB,GPIO_PIN_3, GPIO_PIN_RESET);//SCL IIC<EFBFBD>ӿڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD>
|
#define OLED_SDIN_Clr() HAL_GPIO_WritePin(GPIOB,GPIO_PIN_3, GPIO_PIN_RESET);//SCL IIC接口的数据信号
|
||||||
#define OLED_SDIN_Set() HAL_GPIO_WritePin(GPIOB,GPIO_PIN_3, GPIO_PIN_SET);
|
#define OLED_SDIN_Set() HAL_GPIO_WritePin(GPIOB,GPIO_PIN_3, GPIO_PIN_SET);
|
||||||
|
|
||||||
|
|
||||||
#define OLED_CMD 0 //д<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
#define OLED_CMD 0 //写命令
|
||||||
#define OLED_DATA 1 //д<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
#define OLED_DATA 1 //写数据
|
||||||
|
|
||||||
|
|
||||||
//OLED<EFBFBD>ӿڿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD>
|
//OLED接口控制用函数
|
||||||
void OLED_ShowNum(uint8_t x,uint8_t y,uint32_t num,uint8_t len,uint8_t size);
|
void OLED_ShowNum(uint8_t x,uint8_t y,uint32_t num,uint8_t len,uint8_t size);
|
||||||
void OLED_ShowString(uint8_t x,uint8_t y, uint8_t *p,uint8_t Char_Size);
|
void OLED_ShowString(uint8_t x,uint8_t y, uint8_t *p,uint8_t Char_Size);
|
||||||
void OLED_ShowCHinese(uint8_t x,uint8_t y,uint8_t no);
|
void OLED_ShowCHinese(uint8_t x,uint8_t y,uint8_t no);
|
||||||
@@ -32,14 +32,10 @@ void OLED_DrawBMP(unsigned char x0, unsigned char y0,unsigned char x1, unsigned
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//OLED<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
//OLED基础函数
|
||||||
void OLED_Init(void);
|
void OLED_Init(void);
|
||||||
void OLED_Clear(void);
|
void OLED_Clear(void);
|
||||||
void OLED_Display_On(void);
|
void OLED_Display_On(void);
|
||||||
void OLED_Display_Off(void);
|
void OLED_Display_Off(void);
|
||||||
void OLED_Set_Pos(unsigned char x, unsigned char y);
|
void OLED_Set_Pos(unsigned char x, unsigned char y);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,11 +1,11 @@
|
|||||||
#ifndef __OLEDFONT_H
|
#ifndef __OLEDFONT_H
|
||||||
#define __OLEDFONT_H
|
#define __OLEDFONT_H
|
||||||
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ASCII<EFBFBD><EFBFBD>
|
//常用ASCII表
|
||||||
//ƫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>32
|
//偏移量32
|
||||||
//ASCII<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>
|
//ASCII字符集
|
||||||
//ƫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>32
|
//偏移量32
|
||||||
//<EFBFBD><EFBFBD>С:12*6
|
//大小:12*6
|
||||||
/************************************6*8<EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD>************************************/
|
/************************************6*8的点阵************************************/
|
||||||
const unsigned char F6x8[][6] =
|
const unsigned char F6x8[][6] =
|
||||||
{
|
{
|
||||||
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00},// sp
|
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00},// sp
|
||||||
@@ -101,7 +101,7 @@ const unsigned char F6x8[][6] =
|
|||||||
{0x00, 0x44, 0x64, 0x54, 0x4C, 0x44},// z
|
{0x00, 0x44, 0x64, 0x54, 0x4C, 0x44},// z
|
||||||
{0x14, 0x14, 0x14, 0x14, 0x14, 0x14},// horiz lines
|
{0x14, 0x14, 0x14, 0x14, 0x14, 0x14},// horiz lines
|
||||||
};
|
};
|
||||||
/****************************************8*16<EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD>************************************/
|
/****************************************8*16的点阵************************************/
|
||||||
const unsigned char F8X16[]=
|
const unsigned char F8X16[]=
|
||||||
{
|
{
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// 0
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// 0
|
||||||
@@ -203,30 +203,28 @@ const unsigned char F8X16[]=
|
|||||||
char Hzk[][32]={
|
char Hzk[][32]={
|
||||||
|
|
||||||
{0x40,0x3C,0x10,0xFF,0x10,0x10,0x20,0x10,0x8F,0x78,0x08,0xF8,0x08,0xF8,0x00,0x00},
|
{0x40,0x3C,0x10,0xFF,0x10,0x10,0x20,0x10,0x8F,0x78,0x08,0xF8,0x08,0xF8,0x00,0x00},
|
||||||
{0x02,0x06,0x02,0xFF,0x01,0x01,0x04,0x42,0x21,0x18,0x46,0x81,0x40,0x3F,0x00,0x00},/*"<EFBFBD><EFBFBD>",0*/
|
{0x02,0x06,0x02,0xFF,0x01,0x01,0x04,0x42,0x21,0x18,0x46,0x81,0x40,0x3F,0x00,0x00},/*"物",0*/
|
||||||
/* (16 X 16 , <EFBFBD><EFBFBD><EFBFBD><EFBFBD> )*/
|
/* (16 X 16 , 宋体 )*/
|
||||||
|
|
||||||
{0x02,0xFE,0x92,0x92,0xFE,0x02,0x00,0x10,0x11,0x16,0xF0,0x14,0x13,0x10,0x00,0x00},
|
{0x02,0xFE,0x92,0x92,0xFE,0x02,0x00,0x10,0x11,0x16,0xF0,0x14,0x13,0x10,0x00,0x00},
|
||||||
{0x10,0x1F,0x08,0x08,0xFF,0x04,0x81,0x41,0x31,0x0D,0x03,0x0D,0x31,0x41,0x81,0x00},/*"<EFBFBD><EFBFBD>",1*/
|
{0x10,0x1F,0x08,0x08,0xFF,0x04,0x81,0x41,0x31,0x0D,0x03,0x0D,0x31,0x41,0x81,0x00},/*"联",1*/
|
||||||
/* (16 X 16 , <EFBFBD><EFBFBD><EFBFBD><EFBFBD> )*/
|
/* (16 X 16 , 宋体 )*/
|
||||||
|
|
||||||
{0x00,0xFE,0x02,0x22,0x42,0x82,0x72,0x02,0x22,0x42,0x82,0x72,0x02,0xFE,0x00,0x00},
|
{0x00,0xFE,0x02,0x22,0x42,0x82,0x72,0x02,0x22,0x42,0x82,0x72,0x02,0xFE,0x00,0x00},
|
||||||
{0x00,0xFF,0x10,0x08,0x06,0x01,0x0E,0x10,0x08,0x06,0x01,0x4E,0x80,0x7F,0x00,0x00},/*"<EFBFBD><EFBFBD>",2*/
|
{0x00,0xFF,0x10,0x08,0x06,0x01,0x0E,0x10,0x08,0x06,0x01,0x4E,0x80,0x7F,0x00,0x00},/*"网",2*/
|
||||||
/* (16 X 16 , <EFBFBD><EFBFBD><EFBFBD><EFBFBD> )*/
|
/* (16 X 16 , 宋体 )*/
|
||||||
|
|
||||||
{0x00,0x80,0x60,0xF8,0x07,0x00,0xFE,0x52,0x52,0x52,0x52,0x52,0xFE,0x00,0x00,0x00},
|
{0x00,0x80,0x60,0xF8,0x07,0x00,0xFE,0x52,0x52,0x52,0x52,0x52,0xFE,0x00,0x00,0x00},
|
||||||
{0x01,0x00,0x00,0xFF,0x08,0x88,0x4F,0x29,0x09,0x09,0x09,0x29,0x4F,0x88,0x08,0x00},/*"<EFBFBD><EFBFBD>",3*/
|
{0x01,0x00,0x00,0xFF,0x08,0x88,0x4F,0x29,0x09,0x09,0x09,0x29,0x4F,0x88,0x08,0x00},/*"俱",3*/
|
||||||
/* (16 X 16 , <EFBFBD><EFBFBD><EFBFBD><EFBFBD> )*/
|
/* (16 X 16 , 宋体 )*/
|
||||||
|
|
||||||
{0x00,0x00,0xE0,0x9C,0x84,0x84,0x84,0xF4,0x82,0x82,0x83,0x82,0x80,0x80,0x00,0x00},
|
{0x00,0x00,0xE0,0x9C,0x84,0x84,0x84,0xF4,0x82,0x82,0x83,0x82,0x80,0x80,0x00,0x00},
|
||||||
{0x00,0x20,0x10,0x08,0x06,0x40,0x80,0x7F,0x00,0x00,0x02,0x04,0x08,0x30,0x00,0x00},/*"<EFBFBD><EFBFBD>",4*/
|
{0x00,0x20,0x10,0x08,0x06,0x40,0x80,0x7F,0x00,0x00,0x02,0x04,0x08,0x30,0x00,0x00},/*"乐",4*/
|
||||||
/* (16 X 16 , <EFBFBD><EFBFBD><EFBFBD><EFBFBD> )*/
|
/* (16 X 16 , 宋体 )*/
|
||||||
|
|
||||||
{0x40,0x44,0x54,0x65,0x46,0x44,0x64,0x54,0x44,0x40,0xFE,0x02,0x22,0xDA,0x06,0x00},
|
{0x40,0x44,0x54,0x65,0x46,0x44,0x64,0x54,0x44,0x40,0xFE,0x02,0x22,0xDA,0x06,0x00},
|
||||||
{0x00,0x00,0x7E,0x22,0x22,0x22,0x22,0x7E,0x00,0x00,0xFF,0x08,0x10,0x08,0x07,0x00},/*"<EFBFBD><EFBFBD>",5*/
|
{0x00,0x00,0x7E,0x22,0x22,0x22,0x22,0x7E,0x00,0x00,0xFF,0x08,0x10,0x08,0x07,0x00},/*"部",5*/
|
||||||
/* (16 X 16 , <EFBFBD><EFBFBD><EFBFBD><EFBFBD> )*/
|
/* (16 X 16 , 宋体 )*/
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user