本文主要是介绍一、hal库配置0.96寸oled屏幕+tftlcd屏幕演示,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
一、硬件iic配置(使用oled演示)
图省事复制即可(注意:从机地址0x78或0x7a)
//初始化
void MX_I2C1_Init(void)
{hi2c1.Instance = I2C1;hi2c1.Init.ClockSpeed = 100000;//标准hi2c1.Init.DutyCycle = I2C_DUTYCYCLE_2;//对应标准hi2c1.Init.OwnAddress1 = 0x78;//第一个设备自己的地址hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;//不使用地址扩展hi2c1.Init.OwnAddress2 = 0;//不生效,(配置 hi2c1.Init.DualAddressMode使能,则有效,hi2c1.Init.OwnAddress1便无效)hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;//广播hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;//延时if (HAL_I2C_Init(&hi2c1) != HAL_OK){Error_Handler();}}
初始化oled
//写数据
void OLED_WriteData(uint8_t Byte)
{uint8_t date=0x40;HAL_I2C_Mem_Write(&hi2c1, 0x78,0x40, I2C_MEMADD_SIZE_8BIT,(uint8_t *)&Byte, 1, 0xff);if(HAL_I2C_IsDeviceReady(&hi2c1,0x78,100,0xffff)==HAL_OK){}
}
//写指令
void OLED_WriteCommand(uint8_t Command)
{uint8_t date=0;HAL_I2C_Mem_Write(&hi2c1, 0x78,0x00, I2C_MEMADD_SIZE_8BIT,(uint8_t *)&Command, 1, 0xff);if(HAL_I2C_IsDeviceReady(&hi2c1,0x78,100,0xffff)==HAL_OK){}}
//初始化
void OLED_Init(void)
{HAL_Delay(200);/*写入一系列的命令,对OLED进行初始化配置*/OLED_WriteCommand(0xAE); OLED_WriteCommand(0x20); OLED_WriteCommand(0x10); OLED_WriteCommand(0xb0); OLED_WriteCommand(0xc8); OLED_WriteCommand(0x00); OLED_WriteCommand(0x10); OLED_WriteCommand(0x40); OLED_WriteCommand(0x81); OLED_WriteCommand(0xff); OLED_WriteCommand(0xa1); OLED_WriteCommand(0xa6);OLED_WriteCommand(0xa8);OLED_WriteCommand(0x3f); OLED_WriteCommand(0xa4); OLED_WriteCommand(0xd3);OLED_WriteCommand(0x00); OLED_WriteCommand(0xd5);OLED_WriteCommand(0xf0); OLED_WriteCommand(0xd9); OLED_WriteCommand(0x22); OLED_WriteCommand(0xda);OLED_WriteCommand(0x12); OLED_WriteCommand(0xdb); OLED_WriteCommand(0x20); OLED_WriteCommand(0x8d); OLED_WriteCommand(0x14); OLED_WriteCommand(0xaf);
}
oled应用函数
/************************************6*8的点阵************************************/
const unsigned char F6x8[][6] =
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00,// sp0x00, 0x00, 0x00, 0x2f, 0x00, 0x00,// !0x00, 0x00, 0x07, 0x00, 0x07, 0x00,// "0x00, 0x14, 0x7f, 0x14, 0x7f, 0x14,// #0x00, 0x24, 0x2a, 0x7f, 0x2a, 0x12,// $0x00, 0x62, 0x64, 0x08, 0x13, 0x23,// %0x00, 0x36, 0x49, 0x55, 0x22, 0x50,// &0x00, 0x00, 0x05, 0x03, 0x00, 0x00,// '0x00, 0x00, 0x1c, 0x22, 0x41, 0x00,// (0x00, 0x00, 0x41, 0x22, 0x1c, 0x00,// )0x00, 0x14, 0x08, 0x3E, 0x08, 0x14,// *0x00, 0x08, 0x08, 0x3E, 0x08, 0x08,// +0x00, 0x00, 0x00, 0xA0, 0x60, 0x00,// ,0x00, 0x08, 0x08, 0x08, 0x08, 0x08,// -0x00, 0x00, 0x60, 0x60, 0x00, 0x00,// .0x00, 0x20, 0x10, 0x08, 0x04, 0x02,// /0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E,// 00x00, 0x00, 0x42, 0x7F, 0x40, 0x00,// 10x00, 0x42, 0x61, 0x51, 0x49, 0x46,// 20x00, 0x21, 0x41, 0x45, 0x4B, 0x31,// 30x00, 0x18, 0x14, 0x12, 0x7F, 0x10,// 40x00, 0x27, 0x45, 0x45, 0x45, 0x39,// 50x00, 0x3C, 0x4A, 0x49, 0x49, 0x30,// 60x00, 0x01, 0x71, 0x09, 0x05, 0x03,// 70x00, 0x36, 0x49, 0x49, 0x49, 0x36,// 80x00, 0x06, 0x49, 0x49, 0x29, 0x1E,// 90x00, 0x00, 0x36, 0x36, 0x00, 0x00,// :0x00, 0x00, 0x56, 0x36, 0x00, 0x00,// ;0x00, 0x08, 0x14, 0x22, 0x41, 0x00,// <0x00, 0x14, 0x14, 0x14, 0x14, 0x14,// =0x00, 0x00, 0x41, 0x22, 0x14, 0x08,// >0x00, 0x02, 0x01, 0x51, 0x09, 0x06,// ?0x00, 0x32, 0x49, 0x59, 0x51, 0x3E,// @0x00, 0x7C, 0x12, 0x11, 0x12, 0x7C,// A0x00, 0x7F, 0x49, 0x49, 0x49, 0x36,// B0x00, 0x3E, 0x41, 0x41, 0x41, 0x22,// C0x00, 0x7F, 0x41, 0x41, 0x22, 0x1C,// D0x00, 0x7F, 0x49, 0x49, 0x49, 0x41,// E0x00, 0x7F, 0x09, 0x09, 0x09, 0x01,// F0x00, 0x3E, 0x41, 0x49, 0x49, 0x7A,// G0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F,// H0x00, 0x00, 0x41, 0x7F, 0x41, 0x00,// I0x00, 0x20, 0x40, 0x41, 0x3F, 0x01,// J0x00, 0x7F, 0x08, 0x14, 0x22, 0x41,// K0x00, 0x7F, 0x40, 0x40, 0x40, 0x40,// L0x00, 0x7F, 0x02, 0x0C, 0x02, 0x7F,// M0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F,// N0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E,// O0x00, 0x7F, 0x09, 0x09, 0x09, 0x06,// P0x00, 0x3E, 0x41, 0x51, 0x21, 0x5E,// Q0x00, 0x7F, 0x09, 0x19, 0x29, 0x46,// R0x00, 0x46, 0x49, 0x49, 0x49, 0x31,// S0x00, 0x01, 0x01, 0x7F, 0x01, 0x01,// T0x00, 0x3F, 0x40, 0x40, 0x40, 0x3F,// U0x00, 0x1F, 0x20, 0x40, 0x20, 0x1F,// V0x00, 0x3F, 0x40, 0x38, 0x40, 0x3F,// W0x00, 0x63, 0x14, 0x08, 0x14, 0x63,// X0x00, 0x07, 0x08, 0x70, 0x08, 0x07,// Y0x00, 0x61, 0x51, 0x49, 0x45, 0x43,// Z0x00, 0x00, 0x7F, 0x41, 0x41, 0x00,// [0x00, 0x55, 0x2A, 0x55, 0x2A, 0x55,// 550x00, 0x00, 0x41, 0x41, 0x7F, 0x00,// ]0x00, 0x04, 0x02, 0x01, 0x02, 0x04,// ^0x00, 0x40, 0x40, 0x40, 0x40, 0x40,// _0x00, 0x00, 0x01, 0x02, 0x04, 0x00,// '0x00, 0x20, 0x54, 0x54, 0x54, 0x78,// a0x00, 0x7F, 0x48, 0x44, 0x44, 0x38,// b0x00, 0x38, 0x44, 0x44, 0x44, 0x20,// c0x00, 0x38, 0x44, 0x44, 0x48, 0x7F,// d0x00, 0x38, 0x54, 0x54, 0x54, 0x18,// e0x00, 0x08, 0x7E, 0x09, 0x01, 0x02,// f0x00, 0x18, 0xA4, 0xA4, 0xA4, 0x7C,// g0x00, 0x7F, 0x08, 0x04, 0x04, 0x78,// h0x00, 0x00, 0x44, 0x7D, 0x40, 0x00,// i0x00, 0x40, 0x80, 0x84, 0x7D, 0x00,// j0x00, 0x7F, 0x10, 0x28, 0x44, 0x00,// k0x00, 0x00, 0x41, 0x7F, 0x40, 0x00,// l0x00, 0x7C, 0x04, 0x18, 0x04, 0x78,// m0x00, 0x7C, 0x08, 0x04, 0x04, 0x78,// n0x00, 0x38, 0x44, 0x44, 0x44, 0x38,// o0x00, 0xFC, 0x24, 0x24, 0x24, 0x18,// p0x00, 0x18, 0x24, 0x24, 0x18, 0xFC,// q0x00, 0x7C, 0x08, 0x04, 0x04, 0x08,// r0x00, 0x48, 0x54, 0x54, 0x54, 0x20,// s0x00, 0x04, 0x3F, 0x44, 0x40, 0x20,// t0x00, 0x3C, 0x40, 0x40, 0x20, 0x7C,// u0x00, 0x1C, 0x20, 0x40, 0x20, 0x1C,// v0x00, 0x3C, 0x40, 0x30, 0x40, 0x3C,// w0x00, 0x44, 0x28, 0x10, 0x28, 0x44,// x0x00, 0x1C, 0xA0, 0xA0, 0xA0, 0x7C,// y0x00, 0x44, 0x64, 0x54, 0x4C, 0x44,// z0x14, 0x14, 0x14, 0x14, 0x14, 0x14,// horiz lines
};
/****************************************8*16的点阵************************************/
const unsigned char F8X16[]=
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// 00x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x30,0x00,0x00,0x00,//! 10x00,0x10,0x0C,0x06,0x10,0x0C,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//" 20x40,0xC0,0x78,0x40,0xC0,0x78,0x40,0x00,0x04,0x3F,0x04,0x04,0x3F,0x04,0x04,0x00,//# 30x00,0x70,0x88,0xFC,0x08,0x30,0x00,0x00,0x00,0x18,0x20,0xFF,0x21,0x1E,0x00,0x00,//$ 40xF0,0x08,0xF0,0x00,0xE0,0x18,0x00,0x00,0x00,0x21,0x1C,0x03,0x1E,0x21,0x1E,0x00,//% 50x00,0xF0,0x08,0x88,0x70,0x00,0x00,0x00,0x1E,0x21,0x23,0x24,0x19,0x27,0x21,0x10,//& 60x10,0x16,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//' 70x00,0x00,0x00,0xE0,0x18,0x04,0x02,0x00,0x00,0x00,0x00,0x07,0x18,0x20,0x40,0x00,//( 80x00,0x02,0x04,0x18,0xE0,0x00,0x00,0x00,0x00,0x40,0x20,0x18,0x07,0x00,0x00,0x00,//) 90x40,0x40,0x80,0xF0,0x80,0x40,0x40,0x00,0x02,0x02,0x01,0x0F,0x01,0x02,0x02,0x00,//* 100x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x1F,0x01,0x01,0x01,0x00,//+ 110x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xB0,0x70,0x00,0x00,0x00,0x00,0x00,//, 120x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,//- 130x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x00,//. 140x00,0x00,0x00,0x00,0x80,0x60,0x18,0x04,0x00,0x60,0x18,0x06,0x01,0x00,0x00,0x00,/// 150x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,//0 160x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//1 170x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00,//2 180x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,0x00,0x18,0x20,0x20,0x20,0x11,0x0E,0x00,//3 190x00,0x00,0xC0,0x20,0x10,0xF8,0x00,0x00,0x00,0x07,0x04,0x24,0x24,0x3F,0x24,0x00,//4 200x00,0xF8,0x08,0x88,0x88,0x08,0x08,0x00,0x00,0x19,0x21,0x20,0x20,0x11,0x0E,0x00,//5 210x00,0xE0,0x10,0x88,0x88,0x18,0x00,0x00,0x00,0x0F,0x11,0x20,0x20,0x11,0x0E,0x00,//6 220x00,0x38,0x08,0x08,0xC8,0x38,0x08,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,//7 230x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00,//8 240x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x31,0x22,0x22,0x11,0x0F,0x00,//9 250x00,0x00,0x00,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,//: 260x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x60,0x00,0x00,0x00,0x00,//; 270x00,0x00,0x80,0x40,0x20,0x10,0x08,0x00,0x00,0x01,0x02,0x04,0x08,0x10,0x20,0x00,//< 280x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x00,//= 290x00,0x08,0x10,0x20,0x40,0x80,0x00,0x00,0x00,0x20,0x10,0x08,0x04,0x02,0x01,0x00,//> 300x00,0x70,0x48,0x08,0x08,0x08,0xF0,0x00,0x00,0x00,0x00,0x30,0x36,0x01,0x00,0x00,//? 310xC0,0x30,0xC8,0x28,0xE8,0x10,0xE0,0x00,0x07,0x18,0x27,0x24,0x23,0x14,0x0B,0x00,//@ 320x00,0x00,0xC0,0x38,0xE0,0x00,0x00,0x00,0x20,0x3C,0x23,0x02,0x02,0x27,0x38,0x20,//A 330x08,0xF8,0x88,0x88,0x88,0x70,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x11,0x0E,0x00,//B 340xC0,0x30,0x08,0x08,0x08,0x08,0x38,0x00,0x07,0x18,0x20,0x20,0x20,0x10,0x08,0x00,//C 350x08,0xF8,0x08,0x08,0x08,0x10,0xE0,0x00,0x20,0x3F,0x20,0x20,0x20,0x10,0x0F,0x00,//D 360x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x20,0x23,0x20,0x18,0x00,//E 370x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x00,0x03,0x00,0x00,0x00,//F 380xC0,0x30,0x08,0x08,0x08,0x38,0x00,0x00,0x07,0x18,0x20,0x20,0x22,0x1E,0x02,0x00,//G 390x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x20,0x3F,0x21,0x01,0x01,0x21,0x3F,0x20,//H 400x00,0x08,0x08,0xF8,0x08,0x08,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//I 410x00,0x00,0x08,0x08,0xF8,0x08,0x08,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,0x00,//J 420x08,0xF8,0x88,0xC0,0x28,0x18,0x08,0x00,0x20,0x3F,0x20,0x01,0x26,0x38,0x20,0x00,//K 430x08,0xF8,0x08,0x00,0x00,0x00,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x20,0x30,0x00,//L 440x08,0xF8,0xF8,0x00,0xF8,0xF8,0x08,0x00,0x20,0x3F,0x00,0x3F,0x00,0x3F,0x20,0x00,//M 450x08,0xF8,0x30,0xC0,0x00,0x08,0xF8,0x08,0x20,0x3F,0x20,0x00,0x07,0x18,0x3F,0x00,//N 460xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x10,0x20,0x20,0x20,0x10,0x0F,0x00,//O 470x08,0xF8,0x08,0x08,0x08,0x08,0xF0,0x00,0x20,0x3F,0x21,0x01,0x01,0x01,0x00,0x00,//P 480xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x18,0x24,0x24,0x38,0x50,0x4F,0x00,//Q 490x08,0xF8,0x88,0x88,0x88,0x88,0x70,0x00,0x20,0x3F,0x20,0x00,0x03,0x0C,0x30,0x20,//R 500x00,0x70,0x88,0x08,0x08,0x08,0x38,0x00,0x00,0x38,0x20,0x21,0x21,0x22,0x1C,0x00,//S 510x18,0x08,0x08,0xF8,0x08,0x08,0x18,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,//T 520x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,//U 530x08,0x78,0x88,0x00,0x00,0xC8,0x38,0x08,0x00,0x00,0x07,0x38,0x0E,0x01,0x00,0x00,//V 540xF8,0x08,0x00,0xF8,0x00,0x08,0xF8,0x00,0x03,0x3C,0x07,0x00,0x07,0x3C,0x03,0x00,//W 550x08,0x18,0x68,0x80,0x80,0x68,0x18,0x08,0x20,0x30,0x2C,0x03,0x03,0x2C,0x30,0x20,//X 560x08,0x38,0xC8,0x00,0xC8,0x38,0x08,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,//Y 570x10,0x08,0x08,0x08,0xC8,0x38,0x08,0x00,0x20,0x38,0x26,0x21,0x20,0x20,0x18,0x00,//Z 580x00,0x00,0x00,0xFE,0x02,0x02,0x02,0x00,0x00,0x00,0x00,0x7F,0x40,0x40,0x40,0x00,//[ 590x00,0x0C,0x30,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x06,0x38,0xC0,0x00,//\ 600x00,0x02,0x02,0x02,0xFE,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x7F,0x00,0x00,0x00,//] 610x00,0x00,0x04,0x02,0x02,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//^ 620x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,//_ 630x00,0x02,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//` 640x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x19,0x24,0x22,0x22,0x22,0x3F,0x20,//a 650x08,0xF8,0x00,0x80,0x80,0x00,0x00,0x00,0x00,0x3F,0x11,0x20,0x20,0x11,0x0E,0x00,//b 660x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x0E,0x11,0x20,0x20,0x20,0x11,0x00,//c 670x00,0x00,0x00,0x80,0x80,0x88,0xF8,0x00,0x00,0x0E,0x11,0x20,0x20,0x10,0x3F,0x20,//d 680x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x22,0x22,0x22,0x22,0x13,0x00,//e 690x00,0x80,0x80,0xF0,0x88,0x88,0x88,0x18,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//f 700x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x6B,0x94,0x94,0x94,0x93,0x60,0x00,//g 710x08,0xF8,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,//h 720x00,0x80,0x98,0x98,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//i 730x00,0x00,0x00,0x80,0x98,0x98,0x00,0x00,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,//j 740x08,0xF8,0x00,0x00,0x80,0x80,0x80,0x00,0x20,0x3F,0x24,0x02,0x2D,0x30,0x20,0x00,//k 750x00,0x08,0x08,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//l 760x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x20,0x3F,0x20,0x00,0x3F,0x20,0x00,0x3F,//m 770x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,//n 780x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,//o 790x80,0x80,0x00,0x80,0x80,0x00,0x00,0x00,0x80,0xFF,0xA1,0x20,0x20,0x11,0x0E,0x00,//p 800x00,0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x0E,0x11,0x20,0x20,0xA0,0xFF,0x80,//q 810x80,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x20,0x20,0x3F,0x21,0x20,0x00,0x01,0x00,//r 820x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x33,0x24,0x24,0x24,0x24,0x19,0x00,//s 830x00,0x80,0x80,0xE0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x1F,0x20,0x20,0x00,0x00,//t 840x80,0x80,0x00,0x00,0x00,0x80,0x80,0x00,0x00,0x1F,0x20,0x20,0x20,0x10,0x3F,0x20,//u 850x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x00,0x01,0x0E,0x30,0x08,0x06,0x01,0x00,//v 860x80,0x80,0x00,0x80,0x00,0x80,0x80,0x80,0x0F,0x30,0x0C,0x03,0x0C,0x30,0x0F,0x00,//w 870x00,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x31,0x2E,0x0E,0x31,0x20,0x00,//x 880x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x80,0x81,0x8E,0x70,0x18,0x06,0x01,0x00,//y 890x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x21,0x30,0x2C,0x22,0x21,0x30,0x00,//z 900x00,0x00,0x00,0x00,0x80,0x7C,0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x3F,0x40,0x40,//{ 910x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,//| 920x00,0x02,0x02,0x7C,0x80,0x00,0x00,0x00,0x00,0x40,0x40,0x3F,0x00,0x00,0x00,0x00,//} 930x00,0x06,0x01,0x01,0x02,0x02,0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//~ 94
};
//填充 0xff点亮, 0x00清屏
void OLED_FILL(unsigned char fill_Data)
{unsigned char m,n;for(m=0;m<8;m++){OLED_WriteCommand(0xb0+m); //page0-page1OLED_WriteCommand(0x00); //low column start addressOLED_WriteCommand(0x10); //high column start addressfor(n=0;n<128;n++){OLED_WriteData(fill_Data);}}
}/*** 函 数:OLED设置显示光标位置* 参 数:Page 指定光标所在的页,范围:0~7* 参 数:X 指定光标所在的X轴坐标,范围:0~127* 返 回 值:无* 说 明:OLED默认的Y轴,只能8个Bit为一组写入,即1页等于8个Y轴坐标*/
void OLED_SetCursor(uint8_t Page, uint8_t X)
{ /*通过指令设置页地址和列地址*/OLED_WriteCommand(0xB0 + X ); OLED_WriteCommand(0x10 | ((Page & 0xF0) >> 4)); OLED_WriteCommand(0x01 | (Page & 0x0F));
}/*** 函数功能: 显示ASCII字符,有6*8和8*16可选择* 输入参数: x,y: 起始点坐标(x:0~127, y:0~7);* ch[]:要显示的字符串; * TextSize:字符大小(1:6*8 ; 2:8*16)* 返 回 值: 无* 说 明:无*/
void OLED_ShowStr(unsigned char x, unsigned char y, unsigned char ch[], unsigned char TextSize)
{unsigned char c = 0,i = 0,j = 0;switch(TextSize){case 1:{while(ch[j] != '\0'){c = ch[j] - 32;if(x > 126){x = 0;y++;}OLED_SetCursor(x,y);for(i=0;i<6;i++)OLED_WriteData(F6x8[c][i]);x += 6;j++;}}break;case 2:{while(ch[j] != '\0'){c = ch[j] - 32;if(x > 120){x = 0;y++;}OLED_SetCursor(x,y);for(i=0;i<8;i++)OLED_WriteData(F8X16[c*16+i]);OLED_SetCursor(x,y+1);for(i=0;i<8;i++)OLED_WriteData(F8X16[c*16+i+8]);x += 8;j++;}}break;}
}/*** 函数功能: 将OLED从休眠中唤醒* 输入参数: 无* 返 回 值: 无* 说 明:无*/
void OLED_ON(void)
{OLED_WriteCommand(0X8D); //设置电荷泵OLED_WriteCommand(0X14); //开启电荷泵OLED_WriteCommand(0XAF); //OLED唤醒
}/*** 函数功能: 让OLED休眠 -- 休眠模式下,OLED功耗不到10uA* 输入参数: 无* 返 回 值: 无* 说 明:无*/
void OLED_OFF(void)
{OLED_WriteCommand(0X8D); //设置电荷泵OLED_WriteCommand(0X10); //关闭电荷泵OLED_WriteCommand(0XAE); //OLED休眠
}
OLED_ShowStr(0,3,(unsigned char*)“zaicihuanxingle”,1); //测试6*8字符
二、模拟iic配置(使用tftlcd演示)
//配置gpio初始化 输出模式
void MX_GPIO_Init(void)
{GPIO_InitTypeDef GPIO_InitStruct = {0};__HAL_RCC_GPIOC_CLK_ENABLE();__HAL_RCC_GPIOH_CLK_ENABLE();__HAL_RCC_GPIOD_CLK_ENABLE();__HAL_RCC_GPIOA_CLK_ENABLE();__HAL_RCC_GPIOE_CLK_ENABLE();HAL_GPIO_WritePin(GPIOD, SDA_Pin|SCL_Pin, GPIO_PIN_SET);
HAL_GPIO_WritePin(GPIOE,RES_Pin|DC_Pin|CS_Pin|BLK_Pin,GPIO_PIN_SET);GPIO_InitStruct.Pin = RES_Pin|DC_Pin|CS_Pin|BLK_Pin;GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;GPIO_InitStruct.Pull = GPIO_PULLUP;GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);GPIO_InitStruct.Pin = SDA_Pin|SCL_Pin;GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;GPIO_InitStruct.Pull = GPIO_PULLUP;GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
}//模拟iic的发送数据
#define LCD_SCLK_Clr() HAL_GPIO_WritePin(GPIOD,SCL_Pin,GPIO_PIN_RESET)//SCL=SCLK
#define LCD_SCLK_Set() HAL_GPIO_WritePin(GPIOD,SCL_Pin,GPIO_PIN_SET)#define LCD_MOSI_Clr() HAL_GPIO_WritePin(GPIOD,SDA_Pin,GPIO_PIN_RESET)//SDA=MOSI
#define LCD_MOSI_Set() HAL_GPIO_WritePin(GPIOD,SDA_Pin,GPIO_PIN_SET)#define LCD_RES_Clr() HAL_GPIO_WritePin(GPIOE,RES_Pin,GPIO_PIN_RESET)//RES
#define LCD_RES_Set() HAL_GPIO_WritePin(GPIOE,RES_Pin,GPIO_PIN_SET)#define LCD_DC_Clr() HAL_GPIO_WritePin(GPIOE,DC_Pin,GPIO_PIN_RESET)//DC
#define LCD_DC_Set() HAL_GPIO_WritePin(GPIOE,DC_Pin,GPIO_PIN_SET)#define LCD_CS_Clr() HAL_GPIO_WritePin(GPIOE,CS_Pin,GPIO_PIN_RESET)//CS
#define LCD_CS_Set() HAL_GPIO_WritePin(GPIOE,CS_Pin,GPIO_PIN_SET)#define LCD_BLK_Clr() HAL_GPIO_WritePin(GPIOE,BLK_Pin,GPIO_PIN_RESET)//BLK
#define LCD_BLK_Set() HAL_GPIO_WritePin(GPIOE,BLK_Pin,GPIO_PIN_SET)/******************************************************************************函数说明:LCD串行数据写入函数入口数据:dat 要写入的串行数据返回值: 无
******************************************************************************/
void LCD_Writ_Bus(uint8_t dat)
{ uint8_t i;LCD_CS_Clr();for(i=0;i<8;i++){ LCD_SCLK_Clr();if(dat&0x80){LCD_MOSI_Set();}else{LCD_MOSI_Clr();}LCD_SCLK_Set();dat<<=1;} LCD_CS_Set();
}/******************************************************************************函数说明:LCD写入数据入口数据:dat 写入的数据返回值: 无
******************************************************************************/
void LCD_WR_DATA8(uint8_t dat)
{LCD_Writ_Bus(dat);
}/******************************************************************************函数说明:LCD写入数据入口数据:dat 写入的数据返回值: 无
******************************************************************************/
void LCD_WR_DATA(uint16_t dat)
{LCD_Writ_Bus(dat>>8);LCD_Writ_Bus(dat);
}/******************************************************************************函数说明:LCD写入命令入口数据:dat 写入的命令返回值: 无
******************************************************************************/
void LCD_WR_REG(uint8_t dat)
{LCD_DC_Clr();//写命令LCD_Writ_Bus(dat);LCD_DC_Set();//写数据
}
//初始化
#define USE_HORIZONTAL 1 //设置横屏或者竖屏显示 0或1为竖屏 2或3为横屏
#if USE_HORIZONTAL==0||USE_HORIZONTAL==1
#define LCD_W 128
#define LCD_H 160
#else
#define LCD_W 160
#define LCD_H 128
#endifvoid LCD_Init(void)
{MX_GPIO_Init();//初始化GPIOLCD_RES_Clr();//复位HAL_Delay(100);LCD_RES_Set();HAL_Delay(100);LCD_BLK_Set();//打开背光HAL_Delay(100);//************* Start Initial Sequence **********//LCD_WR_REG(0x11); //Sleep out HAL_Delay(120); //Delay 120ms //------------------------------------ST7735S Frame Rate-----------------------------------------// LCD_WR_REG(0xB1); LCD_WR_DATA8(0x05); LCD_WR_DATA8(0x3C); LCD_WR_DATA8(0x3C); LCD_WR_REG(0xB2); LCD_WR_DATA8(0x05);LCD_WR_DATA8(0x3C); LCD_WR_DATA8(0x3C); LCD_WR_REG(0xB3); LCD_WR_DATA8(0x05); LCD_WR_DATA8(0x3C); LCD_WR_DATA8(0x3C); LCD_WR_DATA8(0x05); LCD_WR_DATA8(0x3C); LCD_WR_DATA8(0x3C); //------------------------------------End ST7735S Frame Rate---------------------------------// LCD_WR_REG(0xB4); //Dot inversion LCD_WR_DATA8(0x03); //------------------------------------ST7735S Power Sequence---------------------------------// LCD_WR_REG(0xC0); LCD_WR_DATA8(0x28); LCD_WR_DATA8(0x08); LCD_WR_DATA8(0x04); LCD_WR_REG(0xC1); LCD_WR_DATA8(0XC0); LCD_WR_REG(0xC2); LCD_WR_DATA8(0x0D); LCD_WR_DATA8(0x00); LCD_WR_REG(0xC3); LCD_WR_DATA8(0x8D); LCD_WR_DATA8(0x2A); LCD_WR_REG(0xC4); LCD_WR_DATA8(0x8D); LCD_WR_DATA8(0xEE); //---------------------------------End ST7735S Power Sequence-------------------------------------// LCD_WR_REG(0xC5); //VCOM LCD_WR_DATA8(0x1A); LCD_WR_REG(0x36); //MX, MY, RGB mode if(USE_HORIZONTAL==0)LCD_WR_DATA8(0x00);else if(USE_HORIZONTAL==1)LCD_WR_DATA8(0xC0);else if(USE_HORIZONTAL==2)LCD_WR_DATA8(0x70);else LCD_WR_DATA8(0xA0); //------------------------------------ST7735S Gamma Sequence---------------------------------// LCD_WR_REG(0xE0); LCD_WR_DATA8(0x04); LCD_WR_DATA8(0x22); LCD_WR_DATA8(0x07); LCD_WR_DATA8(0x0A); LCD_WR_DATA8(0x2E); LCD_WR_DATA8(0x30); LCD_WR_DATA8(0x25); LCD_WR_DATA8(0x2A); LCD_WR_DATA8(0x28); LCD_WR_DATA8(0x26); LCD_WR_DATA8(0x2E); LCD_WR_DATA8(0x3A); LCD_WR_DATA8(0x00); LCD_WR_DATA8(0x01); LCD_WR_DATA8(0x03); LCD_WR_DATA8(0x13); LCD_WR_REG(0xE1); LCD_WR_DATA8(0x04); LCD_WR_DATA8(0x16); LCD_WR_DATA8(0x06); LCD_WR_DATA8(0x0D); LCD_WR_DATA8(0x2D); LCD_WR_DATA8(0x26); LCD_WR_DATA8(0x23); LCD_WR_DATA8(0x27); LCD_WR_DATA8(0x27); LCD_WR_DATA8(0x25); LCD_WR_DATA8(0x2D); LCD_WR_DATA8(0x3B); LCD_WR_DATA8(0x00); LCD_WR_DATA8(0x01); LCD_WR_DATA8(0x04); LCD_WR_DATA8(0x13); //------------------------------------End ST7735S Gamma Sequence-----------------------------// LCD_WR_REG(0x3A); //65k mode LCD_WR_DATA8(0x05); LCD_WR_REG(0x29); //Display on
}
lcd应用
/******************************************************************************函数说明:设置起始和结束地址入口数据:x1,x2 设置列的起始和结束地址y1,y2 设置行的起始和结束地址返回值: 无
******************************************************************************/
void LCD_Address_Set(uint16_t x1,uint16_t y1,uint16_t x2,uint16_t y2)
{if(USE_HORIZONTAL==0){LCD_WR_REG(0x2a);//列地址设置LCD_WR_DATA(x1+2);LCD_WR_DATA(x2+2);LCD_WR_REG(0x2b);//行地址设置LCD_WR_DATA(y1+1);LCD_WR_DATA(y2+1);LCD_WR_REG(0x2c);//储存器写}else if(USE_HORIZONTAL==1){LCD_WR_REG(0x2a);//列地址设置LCD_WR_DATA(x1+2);LCD_WR_DATA(x2+2);LCD_WR_REG(0x2b);//行地址设置LCD_WR_DATA(y1+1);LCD_WR_DATA(y2+1);LCD_WR_REG(0x2c);//储存器写}else if(USE_HORIZONTAL==2){LCD_WR_REG(0x2a);//列地址设置LCD_WR_DATA(x1+1);LCD_WR_DATA(x2+1);LCD_WR_REG(0x2b);//行地址设置LCD_WR_DATA(y1+2);LCD_WR_DATA(y2+2);LCD_WR_REG(0x2c);//储存器写}else{LCD_WR_REG(0x2a);//列地址设置LCD_WR_DATA(x1+1);LCD_WR_DATA(x2+1);LCD_WR_REG(0x2b);//行地址设置LCD_WR_DATA(y1+2);LCD_WR_DATA(y2+2);LCD_WR_REG(0x2c);//储存器写}
}/******************************************************************************函数说明:在指定区域填充颜色入口数据:xsta,ysta 起始坐标xend,yend 终止坐标color 要填充的颜色返回值: 无
******************************************************************************/
void LCD_Fill(uint16_t xsta,uint16_t ysta,uint16_t xend,uint16_t yend,uint16_t color)
{ uint16_t i,j; LCD_Address_Set(xsta,ysta,xend-1,yend-1);//设置显示范围for(i=ysta;i<yend;i++){ for(j=xsta;j<xend;j++){LCD_WR_DATA(color);}}
}
/******************************************************************************函数说明:显示单个字符入口数据:x,y显示坐标num 要显示的字符fc 字的颜色bc 字的背景色sizey 字号mode: 0非叠加模式 1叠加模式返回值: 无
******************************************************************************/
void LCD_ShowChar(uint16_t x,uint16_t y,uint8_t num,uint16_t fc,uint16_t bc,uint8_t sizey,uint8_t mode)
{uint8_t temp,sizex,t,m=0;uint16_t i,TypefaceNum;//一个字符所占字节大小uint16_t x0=x;sizex=sizey/2;TypefaceNum=(sizex/8+((sizex%8)?1:0))*sizey;num=num-' '; //得到偏移后的值LCD_Address_Set(x,y,x+sizex-1,y+sizey-1); //设置光标位置 for(i=0;i<TypefaceNum;i++){ if(sizey==12)temp=ascii_1206[num][i]; //调用6x12字体else if(sizey==16)temp=ascii_1608[num][i]; //调用8x16字体else if(sizey==24)temp=ascii_2412[num][i]; //调用12x24字体else if(sizey==32)temp=ascii_3216[num][i]; //调用16x32字体else return;for(t=0;t<8;t++){if(!mode)//非叠加模式{if(temp&(0x01<<t))LCD_WR_DATA(fc);else LCD_WR_DATA(bc);m++;if(m%sizex==0){m=0;break;}}else//叠加模式{if(temp&(0x01<<t))LCD_DrawPoint(x,y,fc);//画一个点x++;if((x-x0)==sizex){x=x0;y++;break;}}}}
}
/******************************************************************************函数说明:显示字符串入口数据:x,y显示坐标*p 要显示的字符串fc 字的颜色bc 字的背景色sizey 字号mode: 0非叠加模式 1叠加模式返回值: 无
******************************************************************************/
void LCD_ShowString(uint16_t x,uint16_t y,const uint8_t *p,uint16_t fc,uint16_t bc,uint8_t sizey,uint8_t mode)
{ while(*p!='\0'){ LCD_ShowChar(x,y,*p,fc,bc,sizey,mode);x+=sizey/2;p++;}
}//画笔颜色
#define WHITE 0xFFFF
#define BLACK 0x0000
#define BLUE 0x001F
#define BRED 0XF81F
#define GRED 0XFFE0
#define GBLUE 0X07FF
#define RED 0xF800
#define MAGENTA 0xF81F
#define GREEN 0x07E0
#define CYAN 0x7FFF
#define YELLOW 0xFFE0
#define BROWN 0XBC40 //棕色
#define BRRED 0XFC07 //棕红色
#define GRAY 0X8430 //灰色
#define DARKBLUE 0X01CF //深蓝色
#define LIGHTBLUE 0X7D7C //浅蓝色
#define GRAYBLUE 0X5458 //灰蓝色
#define LIGHTGREEN 0X841F //浅绿色
#define LGRAY 0XC618 //浅灰色(PANNEL),窗体背景色
#define LGRAYBLUE 0XA651 //浅灰蓝色(中间层颜色)
#define LBBLUE 0X2B12 //浅棕蓝色(选择条目的反色)const unsigned char ascii_1206[][12]={{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*" ",0*/
{0x00,0x00,0x04,0x04,0x04,0x04,0x04,0x00,0x00,0x04,0x00,0x00},/*"!",1*/
{0x14,0x14,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*""",2*/
{0x00,0x00,0x0A,0x0A,0x1F,0x0A,0x0A,0x1F,0x0A,0x0A,0x00,0x00},/*"#",3*/
{0x00,0x04,0x0E,0x15,0x05,0x06,0x0C,0x14,0x15,0x0E,0x04,0x00},/*"$",4*/
{0x00,0x00,0x12,0x15,0x0D,0x15,0x2E,0x2C,0x2A,0x12,0x00,0x00},/*"%",5*/
{0x00,0x00,0x04,0x0A,0x0A,0x36,0x15,0x15,0x29,0x16,0x00,0x00},/*"&",6*/
{0x02,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"'",7*/
{0x10,0x08,0x08,0x04,0x04,0x04,0x04,0x04,0x08,0x08,0x10,0x00},/*"(",8*/
{0x02,0x04,0x04,0x08,0x08,0x08,0x08,0x08,0x04,0x04,0x02,0x00},/*")",9*/
{0x00,0x00,0x00,0x04,0x15,0x0E,0x0E,0x15,0x04,0x00,0x00,0x00},/*"*",10*/
{0x00,0x00,0x00,0x08,0x08,0x3E,0x08,0x08,0x00,0x00,0x00,0x00},/*"+",11*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x02,0x01,0x00},/*",",12*/
{0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00},/*"-",13*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00},/*".",14*/
{0x00,0x20,0x10,0x10,0x08,0x08,0x04,0x04,0x02,0x02,0x01,0x00},/*"/",15*/
{0x00,0x00,0x0E,0x11,0x11,0x11,0x11,0x11,0x11,0x0E,0x00,0x00},/*"0",16*/
{0x00,0x00,0x04,0x06,0x04,0x04,0x04,0x04,0x04,0x0E,0x00,0x00},/*"1",17*/
{0x00,0x00,0x0E,0x11,0x11,0x08,0x04,0x02,0x01,0x1F,0x00,0x00},/*"2",18*/
{0x00,0x00,0x0E,0x11,0x10,0x0C,0x10,0x10,0x11,0x0E,0x00,0x00},/*"3",19*/
{0x00,0x00,0x08,0x0C,0x0C,0x0A,0x09,0x1F,0x08,0x1C,0x00,0x00},/*"4",20*/
{0x00,0x00,0x1F,0x01,0x01,0x0F,0x11,0x10,0x11,0x0E,0x00,0x00},/*"5",21*/
{0x00,0x00,0x0C,0x12,0x01,0x0D,0x13,0x11,0x11,0x0E,0x00,0x00},/*"6",22*/
{0x00,0x00,0x1E,0x10,0x08,0x08,0x04,0x04,0x04,0x04,0x00,0x00},/*"7",23*/
{0x00,0x00,0x0E,0x11,0x11,0x0E,0x11,0x11,0x11,0x0E,0x00,0x00},/*"8",24*/
{0x00,0x00,0x0E,0x11,0x11,0x19,0x16,0x10,0x09,0x06,0x00,0x00},/*"9",25*/
{0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x04,0x00,0x00},/*":",26*/
{0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x04,0x00},/*";",27*/
{0x00,0x00,0x10,0x08,0x04,0x02,0x02,0x04,0x08,0x10,0x00,0x00},/*"<",28*/
{0x00,0x00,0x00,0x00,0x3F,0x00,0x3F,0x00,0x00,0x00,0x00,0x00},/*"=",29*/
{0x00,0x00,0x02,0x04,0x08,0x10,0x10,0x08,0x04,0x02,0x00,0x00},/*">",30*/
{0x00,0x00,0x0E,0x11,0x11,0x08,0x04,0x04,0x00,0x04,0x00,0x00},/*"?",31*/
{0x00,0x00,0x1C,0x22,0x29,0x2D,0x2D,0x1D,0x22,0x1C,0x00,0x00},/*"@",32*/
{0x00,0x00,0x04,0x04,0x0C,0x0A,0x0A,0x1E,0x12,0x33,0x00,0x00},/*"A",33*/
{0x00,0x00,0x0F,0x12,0x12,0x0E,0x12,0x12,0x12,0x0F,0x00,0x00},/*"B",34*/
{0x00,0x00,0x1E,0x11,0x01,0x01,0x01,0x01,0x11,0x0E,0x00,0x00},/*"C",35*/
{0x00,0x00,0x0F,0x12,0x12,0x12,0x12,0x12,0x12,0x0F,0x00,0x00},/*"D",36*/
{0x00,0x00,0x1F,0x12,0x0A,0x0E,0x0A,0x02,0x12,0x1F,0x00,0x00},/*"E",37*/
{0x00,0x00,0x1F,0x12,0x0A,0x0E,0x0A,0x02,0x02,0x07,0x00,0x00},/*"F",38*/
{0x00,0x00,0x1C,0x12,0x01,0x01,0x39,0x11,0x12,0x0C,0x00,0x00},/*"G",39*/
{0x00,0x00,0x33,0x12,0x12,0x1E,0x12,0x12,0x12,0x33,0x00,0x00},/*"H",40*/
{0x00,0x00,0x1F,0x04,0x04,0x04,0x04,0x04,0x04,0x1F,0x00,0x00},/*"I",41*/
{0x00,0x00,0x3E,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x09,0x07},/*"J",42*/
{0x00,0x00,0x37,0x12,0x0A,0x06,0x0A,0x12,0x12,0x37,0x00,0x00},/*"K",43*/
{0x00,0x00,0x07,0x02,0x02,0x02,0x02,0x02,0x22,0x3F,0x00,0x00},/*"L",44*/
{0x00,0x00,0x3B,0x1B,0x1B,0x1B,0x15,0x15,0x15,0x35,0x00,0x00},/*"M",45*/
{0x00,0x00,0x3B,0x12,0x16,0x16,0x1A,0x1A,0x12,0x17,0x00,0x00},/*"N",46*/
{0x00,0x00,0x0E,0x11,0x11,0x11,0x11,0x11,0x11,0x0E,0x00,0x00},/*"O",47*/
{0x00,0x00,0x0F,0x12,0x12,0x0E,0x02,0x02,0x02,0x07,0x00,0x00},/*"P",48*/
{0x00,0x00,0x0E,0x11,0x11,0x11,0x11,0x17,0x19,0x0E,0x18,0x00},/*"Q",49*/
{0x00,0x00,0x0F,0x12,0x12,0x0E,0x0A,0x12,0x12,0x37,0x00,0x00},/*"R",50*/
{0x00,0x00,0x1E,0x11,0x01,0x06,0x08,0x10,0x11,0x0F,0x00,0x00},/*"S",51*/
{0x00,0x00,0x1F,0x15,0x04,0x04,0x04,0x04,0x04,0x0E,0x00,0x00},/*"T",52*/
{0x00,0x00,0x33,0x12,0x12,0x12,0x12,0x12,0x12,0x0C,0x00,0x00},/*"U",53*/
{0x00,0x00,0x33,0x12,0x12,0x0A,0x0A,0x0C,0x04,0x04,0x00,0x00},/*"V",54*/
{0x00,0x00,0x15,0x15,0x15,0x15,0x0E,0x0A,0x0A,0x0A,0x00,0x00},/*"W",55*/
{0x00,0x00,0x1B,0x0A,0x0A,0x04,0x04,0x0A,0x0A,0x1B,0x00,0x00},/*"X",56*/
{0x00,0x00,0x1B,0x0A,0x0A,0x0A,0x04,0x04,0x04,0x0E,0x00,0x00},/*"Y",57*/
{0x00,0x00,0x1F,0x09,0x08,0x04,0x04,0x02,0x12,0x1F,0x00,0x00},/*"Z",58*/
{0x1C,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x1C,0x00},/*"[",59*/
{0x00,0x02,0x02,0x04,0x04,0x04,0x08,0x08,0x08,0x10,0x10,0x00},/*"\",60*/
{0x0E,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x0E,0x00},/*"]",61*/
{0x04,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"^",62*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F},/*"_",63*/
{0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"`",64*/
{0x00,0x00,0x00,0x00,0x00,0x0C,0x12,0x1C,0x12,0x3C,0x00,0x00},/*"a",65*/
{0x00,0x03,0x02,0x02,0x02,0x0E,0x12,0x12,0x12,0x0E,0x00,0x00},/*"b",66*/
{0x00,0x00,0x00,0x00,0x00,0x1C,0x12,0x02,0x12,0x0C,0x00,0x00},/*"c",67*/
{0x00,0x18,0x10,0x10,0x10,0x1C,0x12,0x12,0x12,0x3C,0x00,0x00},/*"d",68*/
{0x00,0x00,0x00,0x00,0x00,0x0C,0x12,0x1E,0x02,0x1C,0x00,0x00},/*"e",69*/
{0x00,0x18,0x24,0x04,0x04,0x1E,0x04,0x04,0x04,0x1E,0x00,0x00},/*"f",70*/
{0x00,0x00,0x00,0x00,0x00,0x3C,0x12,0x0C,0x02,0x1C,0x22,0x1C},/*"g",71*/
{0x00,0x03,0x02,0x02,0x02,0x0E,0x12,0x12,0x12,0x37,0x00,0x00},/*"h",72*/
{0x00,0x04,0x04,0x00,0x00,0x06,0x04,0x04,0x04,0x0E,0x00,0x00},/*"i",73*/
{0x00,0x08,0x08,0x00,0x00,0x0C,0x08,0x08,0x08,0x08,0x08,0x07},/*"j",74*/
{0x00,0x03,0x02,0x02,0x02,0x1A,0x0A,0x06,0x0A,0x13,0x00,0x00},/*"k",75*/
{0x00,0x07,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x1F,0x00,0x00},/*"l",76*/
{0x00,0x00,0x00,0x00,0x00,0x0F,0x15,0x15,0x15,0x15,0x00,0x00},/*"m",77*/
{0x00,0x00,0x00,0x00,0x00,0x0F,0x12,0x12,0x12,0x37,0x00,0x00},/*"n",78*/
{0x00,0x00,0x00,0x00,0x00,0x0C,0x12,0x12,0x12,0x0C,0x00,0x00},/*"o",79*/
{0x00,0x00,0x00,0x00,0x00,0x0F,0x12,0x12,0x12,0x0E,0x02,0x07},/*"p",80*/
{0x00,0x00,0x00,0x00,0x00,0x1C,0x12,0x12,0x12,0x1C,0x10,0x38},/*"q",81*/
{0x00,0x00,0x00,0x00,0x00,0x1B,0x06,0x02,0x02,0x07,0x00,0x00},/*"r",82*/
{0x00,0x00,0x00,0x00,0x00,0x1E,0x02,0x0C,0x10,0x1E,0x00,0x00},/*"s",83*/
{0x00,0x00,0x00,0x04,0x04,0x1E,0x04,0x04,0x04,0x1C,0x00,0x00},/*"t",84*/
{0x00,0x00,0x00,0x00,0x00,0x1B,0x12,0x12,0x12,0x3C,0x00,0x00},/*"u",85*/
{0x00,0x00,0x00,0x00,0x00,0x1B,0x0A,0x0A,0x04,0x04,0x00,0x00},/*"v",86*/
{0x00,0x00,0x00,0x00,0x00,0x15,0x15,0x0E,0x0A,0x0A,0x00,0x00},/*"w",87*/
{0x00,0x00,0x00,0x00,0x00,0x1B,0x0A,0x04,0x0A,0x1B,0x00,0x00},/*"x",88*/
{0x00,0x00,0x00,0x00,0x00,0x33,0x12,0x12,0x0C,0x08,0x04,0x03},/*"y",89*/
{0x00,0x00,0x00,0x00,0x00,0x1E,0x08,0x04,0x04,0x1E,0x00,0x00},/*"z",90*/
{0x18,0x08,0x08,0x08,0x08,0x0C,0x08,0x08,0x08,0x08,0x18,0x00},/*"{",91*/
{0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08},/*"|",92*/
{0x06,0x04,0x04,0x04,0x04,0x08,0x04,0x04,0x04,0x04,0x06,0x00},/*"}",93*/
{0x16,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"~",94*/
};
LCD_ShowString(0,30,"power on to disk",WHITE,BLACK,12,0);
这篇关于一、hal库配置0.96寸oled屏幕+tftlcd屏幕演示的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!