diff --git a/HAL_N_Middlewares/Src/main.c b/HAL_N_Middlewares/Src/main.c index b89d655..f6de927 100644 --- a/HAL_N_Middlewares/Src/main.c +++ b/HAL_N_Middlewares/Src/main.c @@ -27,12 +27,14 @@ #include "spi.h" #include "tim.h" #include "usart.h" +#include "i2c.h" #include "usb_device.h" #include "gpio.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "robot.h" +#include "oled.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ @@ -109,10 +111,10 @@ int main(void) MX_TIM10_Init(); MX_USART1_UART_Init(); MX_USART6_UART_Init(); + MX_I2C2_Init(); + MX_I2C3_Init(); /* USER CODE BEGIN 2 */ - RobotInit(); - /* USER CODE END 2 */ /* Call init function for freertos objects (in freertos.c) */ diff --git a/Makefile b/Makefile index a0a818a..dba6bf5 100644 --- a/Makefile +++ b/Makefile @@ -130,6 +130,7 @@ modules/motor/LKmotor/LK9025.c \ modules/motor/step_motor/step_motor.c \ modules/motor/servo_motor/servo_motor.c \ modules/motor/motor_task.c \ +modules/oled/oled.c \ modules/referee/crc.c \ modules/referee/referee.c \ modules/referee/referee_UI.c \ @@ -244,6 +245,7 @@ C_INCLUDES = \ -Imodules/motor/step_motor \ -Imodules/motor/servo_motor \ -Imodules/motor \ +-Imodules/oled \ -Imodules/referee \ -Imodules/remote \ -Imodules/super_cap \ diff --git a/modules/ist8310/ist8310.c b/modules/ist8310/ist8310.c new file mode 100644 index 0000000..e69de29 diff --git a/modules/ist8310/ist8310.h b/modules/ist8310/ist8310.h new file mode 100644 index 0000000..e69de29 diff --git a/modules/oled/oled.c b/modules/oled/oled.c new file mode 100644 index 0000000..a9e62c9 --- /dev/null +++ b/modules/oled/oled.c @@ -0,0 +1,378 @@ +#include "oled.h" +#include "oledfont.h" +#include "main.h" +#include +#include + +extern I2C_HandleTypeDef hi2c2; +static uint8_t OLED_GRAM[128][8]; + +/** + * @brief 写数据或者指令到OLED, 如果使用的是SPI,请重写这个函数 + * @param[in] dat: 要写入的字节 + * @param[in] cmd: OLED_CMD 代表写入的字节是指令; OLED_DATA 代表写入的字节是数据 + * @retval none + */ +void oled_write_byte(uint8_t dat, uint8_t cmd) +{ + static uint8_t cmd_data[2]; + if(cmd == OLED_CMD) + { + cmd_data[0] = 0x00; + } + else + { + cmd_data[0] = 0x40; + } + cmd_data[1] = dat; + HAL_I2C_Master_Transmit(&hi2c2, OLED_I2C_ADDRESS, cmd_data, 2, 10); +} + + +/** + * @brief 初始化OLED模块, + * @param[in] none + * @retval none + */ +void OLED_init(void) +{ + oled_write_byte(0xAE, OLED_CMD); //display off + oled_write_byte(0x20, OLED_CMD); //Set Memory Addressing Mode + oled_write_byte(0x10, OLED_CMD); //00,Horizontal Addressing Mode;01,Vertical Addressing Mode;10,Page Addressing Mode (RESET);11,Invalid + oled_write_byte(0xb0, OLED_CMD); //Set Page Start Address for Page Addressing Mode,0-7 + oled_write_byte(0xc8, OLED_CMD); //Set COM Output Scan Direction + oled_write_byte(0x00, OLED_CMD); //---set low column address + oled_write_byte(0x10, OLED_CMD); //---set high column address + oled_write_byte(0x40, OLED_CMD); //--set start line address + oled_write_byte(0x81, OLED_CMD); //--set contrast control register + oled_write_byte(0xff, OLED_CMD); //brightness 0x00~0xff + oled_write_byte(0xa1, OLED_CMD); //--set segment re-map 0 to 127 + oled_write_byte(0xa6, OLED_CMD); //--set normal display + oled_write_byte(0xa8, OLED_CMD); //--set multiplex ratio(1 to 64) + oled_write_byte(0x3F, OLED_CMD); // + oled_write_byte(0xa4, OLED_CMD); //0xa4,Output follows RAM content;0xa5,Output ignores RAM content + oled_write_byte(0xd3, OLED_CMD); //-set display offset + oled_write_byte(0x00, OLED_CMD); //-not offset + oled_write_byte(0xd5, OLED_CMD); //--set display clock divide ratio/oscillator frequency + oled_write_byte(0xf0, OLED_CMD); //--set divide ratio + oled_write_byte(0xd9, OLED_CMD); //--set pre-charge period + oled_write_byte(0x22, OLED_CMD); // + oled_write_byte(0xda, OLED_CMD); //--set com pins hardware configuration + oled_write_byte(0x12, OLED_CMD); + oled_write_byte(0xdb, OLED_CMD); //--set vcomh + oled_write_byte(0x20, OLED_CMD); //0x20,0.77xVcc + oled_write_byte(0x8d, OLED_CMD); //--set DC-DC enable + oled_write_byte(0x14, OLED_CMD); // + oled_write_byte(0xaf, OLED_CMD); //--turn on oled panel +} + + +/** + * @brief 打开OLED显示 + * @param[in] none + * @retval none + */ +void OLED_display_on(void) +{ + oled_write_byte(0x8d, OLED_CMD); + oled_write_byte(0x14, OLED_CMD); + oled_write_byte(0xaf, OLED_CMD); +} + + +/** + * @brief 关闭OLED显示 + * @param[in] none + * @retval none + */ +void OLED_display_off(void) +{ + oled_write_byte(0x8d, OLED_CMD); + oled_write_byte(0x10, OLED_CMD); + oled_write_byte(0xae, OLED_CMD); +} + + +/** + * @brief 操作GRAM内存(128*8char数组) + * @param[in] pen: 操作类型. + PEN_CLEAR: 设置为0x00 + PEN_WRITE: 设置为0xff + PEN_INVERSION: 按位取反 + * @retval none + */ +void OLED_operate_gram(pen_typedef pen) +{ + uint8_t i, n; + + for (i = 0; i < 8; i++) + { + for (n = 0; n < 128; n++) + { + if (pen == PEN_WRITE) + { + OLED_GRAM[n][i] = 0xff; + } + else if (pen == PEN_CLEAR) + { + OLED_GRAM[n][i] = 0x00; + } + else + { + OLED_GRAM[n][i] = 0xff - OLED_GRAM[n][i]; + } + } + } +} + +/** + * @brief 设置光标起点(x,y) + * @param[in] x:x轴, 从 0 到 127 + * @param[in] y:y轴, 从 0 到 7 + * @retval none + */ +void OLED_set_pos(uint8_t x, uint8_t y) +{ + oled_write_byte((0xb0 + y), OLED_CMD); //set page address y + oled_write_byte(((x&0xf0)>>4)|0x10, OLED_CMD); //set column high address + oled_write_byte((x&0x0f), OLED_CMD); //set column low address +} + +/** + * @brief 操作GRAM中的一个位,相当于操作屏幕的一个点 + * @param[in] x:x轴, [0,X_WIDTH-1] + * @param[in] y:y轴, [0,Y_WIDTH-1] + * @param[in] pen: 操作类型, + PEN_CLEAR: 设置 (x,y) 点为 0 + PEN_WRITE: 设置 (x,y) 点为 1 + PEN_INVERSION: (x,y) 值反转 + * @retval none + */ +void OLED_draw_point(int8_t x, int8_t y, pen_typedef pen) +{ + uint8_t page = 0, row = 0; + + /* check the corrdinate */ + if ((x < 0) || (x > (X_WIDTH - 1)) || (y < 0) || (y > (Y_WIDTH - 1))) + { + return; + } + page = y / 8; + row = y % 8; + + if (pen == PEN_WRITE) + { + OLED_GRAM[x][page] |= 1 << row; + } + else if (pen == PEN_INVERSION) + { + OLED_GRAM[x][page] ^= 1 << row; + } + else + { + OLED_GRAM[x][page] &= ~(1 << row); + } +} + + +/** + * @brief 画一条直线,从(x1,y1)到(x2,y2) + * @param[in] x1: 起点 + * @param[in] y1: 起点 + * @param[in] x2: 终点 + * @param[in] y2: 终点 + * @param[in] pen: 操作类型,PEN_CLEAR,PEN_WRITE,PEN_INVERSION. + * @retval none + */ + +void OLED_draw_line(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, pen_typedef pen) +{ + uint8_t col = 0, row = 0; + uint8_t x_st = 0, x_ed = 0, y_st = 0, y_ed = 0; + float k = 0.0f, b = 0.0f; + + if (y1 == y2) + { + (x1 <= x2) ? (x_st = x1):(x_st = x2); + (x1 <= x2) ? (x_ed = x2):(x_ed = x1); + + for (col = x_st; col <= x_ed; col++) + { + OLED_draw_point(col, y1, pen); + } + } + else if (x1 == x2) + { + (y1 <= y2) ? (y_st = y1):(y_st = y2); + (y1 <= y2) ? (y_ed = y2):(y_ed = y1); + + for (row = y_st; row <= y_ed; row++) + { + OLED_draw_point(x1, row, pen); + } + } + else + { + k = ((float)(y2 - y1)) / (x2 - x1); + b = (float)y1 - k * x1; + + (x1 <= x2) ? (x_st = x1):(x_st = x2); + (x1 <= x2) ? (x_ed = x2):(x_ed = x2); + + for (col = x_st; col <= x_ed; col++) + { + OLED_draw_point(col, (uint8_t)(col * k + b), pen); + } + } +} + +/** + * @brief 显示一个字符 + * @param[in] row: 字符的开始行 + * @param[in] col: 字符的开始列 + * @param[in] chr: 字符 + * @retval none + */ +void OLED_show_char(uint8_t row, uint8_t col, uint8_t chr) +{ + uint8_t x = col * 6; + uint8_t y = row * 12; + uint8_t temp, t, t1; + uint8_t y0 = y; + chr = chr - ' '; + + for (t = 0; t < 12; t++) + { + temp = asc2_1206[chr][t]; + + for (t1 = 0; t1 < 8; t1++) + { + if (temp&0x80) + OLED_draw_point(x, y, PEN_WRITE); + else + OLED_draw_point(x, y, PEN_CLEAR); + + temp <<= 1; + y++; + if ((y - y0) == 12) + { + y = y0; + x++; + break; + } + } + } +} + +/** + * @brief 显示一个字符串 + * @param[in] row: 字符串的开始行 + * @param[in] col: 字符串的开始列 + * @param[in] chr: 字符串 + * @retval none + */ +void OLED_show_string(uint8_t row, uint8_t col, uint8_t *chr) +{ + uint8_t n =0; + + while (chr[n] != '\0') + { + OLED_show_char(row, col, chr[n]); + col++; + + if (col > 20) + { + col = 0; + row += 1; + } + n++; + } +} + + +/** + * @brief 格式输出 + * @param[in] row: 开始列,0 <= row <= 4; + * @param[in] col: 开始行, 0 <= col <= 20; + * @param[in] *fmt:格式化输出字符串 + * @note 如果字符串长度大于一行,额外的字符会换行 + * @retval none + */ +void OLED_printf(uint8_t row, uint8_t col, const char *fmt,...) +{ + static uint8_t LCD_BUF[128] = {0}; + static va_list ap; + uint8_t remain_size = 0; + + if ((row > 4) || (col > 20) ) + { + return; + } + va_start(ap, fmt); + + vsprintf((char *)LCD_BUF, fmt, ap); + + va_end(ap); + + remain_size = 21 - col; + + LCD_BUF[remain_size] = '\0'; + + OLED_show_string(row, col, LCD_BUF); +} + +/** + * @brief 发送数据到OLED的GRAM + * @param[in] none + * @retval none + */ +void OLED_refresh_gram(void) +{ + uint8_t i, n; + + for (i = 0; i < 8; i++) + { + OLED_set_pos(0, i); + for (n = 0; n < 128; n++) + { + oled_write_byte(OLED_GRAM[n][i], OLED_DATA); + } + } +} + + + +/** + * @brief 显示RM的LOGO + * @param[in] none + * @retval none + */ +void OLED_LOGO(void) +{ + uint8_t temp_char = 0; + uint8_t x = 0, y = 0; + uint8_t i = 0; + OLED_operate_gram(PEN_CLEAR); + + + for(; y < 64; y += 8) + { + for(x = 0; x < 128; x++) + { + temp_char = LOGO_BMP[x][y/8]; + for(i = 0; i < 8; i++) + { + if(temp_char & 0x80) + { + OLED_draw_point(x, y + i,PEN_WRITE); + } + else + { + OLED_draw_point(x,y + i,PEN_CLEAR); + } + temp_char <<= 1; + } + } + } + OLED_refresh_gram(); +} \ No newline at end of file diff --git a/modules/oled/oled.h b/modules/oled/oled.h new file mode 100644 index 0000000..078ac42 --- /dev/null +++ b/modules/oled/oled.h @@ -0,0 +1,133 @@ +#ifndef OLED_H +#define OLED_H +#include + +// the I2C address of oled +#define OLED_I2C_ADDRESS 0x78 + +// the resolution of oled 128*64 +#define MAX_COLUMN 128 +#define MAX_ROW 64 + +#define X_WIDTH MAX_COLUMN +#define Y_WIDTH MAX_ROW + +#define OLED_CMD 0x00 +#define OLED_DATA 0x01 + +#define CHAR_SIZE_WIDTH 6 +#define CHAR_SIZE_HIGHT 12 + +typedef enum +{ + PEN_CLEAR = 0x00, + PEN_WRITE = 0x01, + PEN_INVERSION = 0x02, +} pen_typedef; + +/** + * @brief 初始化OLED模块, + * @param[in] none + * @retval none + */ +extern void OLED_init(void); + +/** + * @brief 打开OLED显示 + * @param[in] none + * @retval none + */ +extern void OLED_display_on(void); + +/** + * @brief 关闭OLED显示 + * @param[in] none + * @retval none + */ +extern void OLED_display_off(void); + +/** + * @brief 操作GRAM内存(128*8char数组) + * @param[in] pen: 操作类型. + PEN_CLEAR: 设置为0x00 + PEN_WRITE: 设置为0xff + PEN_INVERSION: 按位取反 + * @retval none + */ +extern void OLED_operate_gram(pen_typedef pen); + +/** + * @brief 设置光标起点(x,y) + * @param[in] x:x轴, 从 0 到 127 + * @param[in] y:y轴, 从 0 到 7 + * @retval none + */ +extern void OLED_set_pos(uint8_t x, uint8_t y); + +/** + * @brief 操作GRAM中的一个位,相当于操作屏幕的一个点 + * @param[in] x:x轴, [0,X_WIDTH-1] + * @param[in] y:y轴, [0,Y_WIDTH-1] + * @param[in] pen: 操作类型, + PEN_CLEAR: 设置 (x,y) 点为 0 + PEN_WRITE: 设置 (x,y) 点为 1 + PEN_INVERSION: (x,y) 值反转 + * @retval none + */ +extern void OLED_draw_point(int8_t x, int8_t y, pen_typedef pen); + +/** + * @brief 画一条直线,从(x1,y1)到(x2,y2) + * @param[in] x1: 起点 + * @param[in] y1: 起点 + * @param[in] x2: 终点 + * @param[in] y2: 终点 + * @param[in] pen: 操作类型,PEN_CLEAR,PEN_WRITE,PEN_INVERSION. + * @retval none + */ +extern void OLED_draw_line(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, pen_typedef pen); + +/** + * @brief 显示一个字符 + * @param[in] row: 字符的开始行 + * @param[in] col: 字符的开始列 + * @param[in] chr: 字符 + * @retval none + */ +extern void OLED_show_char(uint8_t row, uint8_t col, uint8_t chr); + +/** + * @brief 显示一个字符串 + * @param[in] row: 字符串的开始行 + * @param[in] col: 字符串的开始列 + * @param[in] chr: 字符串 + * @retval none + */ +extern void OLED_show_string(uint8_t row, uint8_t col, uint8_t *chr); + +/** + * @brief 格式输出 + * @param[in] row: 开始列,0 <= row <= 4; + * @param[in] col: 开始行, 0 <= col <= 20; + * @param[in] *fmt:格式化输出字符串 + * @note 如果字符串长度大于一行,额外的字符会换行 + * @retval none + */ +extern void OLED_printf(uint8_t row, uint8_t col, const char *fmt, ...); + + +/** + * @brief 发送数据到OLED的GRAM + * @param[in] none + * @retval none + */ +extern void OLED_refresh_gram(void); + + +/** + * @brief 显示RM的LOGO + * @param[in] none + * @retval none + */ +extern void OLED_LOGO(void); +#endif diff --git a/modules/oled/oledfont.h b/modules/oled/oledfont.h new file mode 100644 index 0000000..1a916d8 --- /dev/null +++ b/modules/oled/oledfont.h @@ -0,0 +1,245 @@ +/** + ***************************************(C) COPYRIGHT 2019 DJI*************************************** + * @file oledfont.h + * @brief character lib of oled + * @note + * @Version V1.0.0 + * @Date Oct-7-2019 + ***************************************(C) COPYRIGHT 2019 DJI*************************************** + */ + +#ifndef __OLED__FONT__H +#define __OLED__FONT__H +//the common ascii character +const unsigned char asc2_1206[95][12]={ +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*" ",0*/ +{0x00,0x00,0x00,0x00,0x3F,0x40,0x00,0x00,0x00,0x00,0x00,0x00},/*"!",1*/ +{0x00,0x00,0x30,0x00,0x40,0x00,0x30,0x00,0x40,0x00,0x00,0x00},/*""",2*/ +{0x09,0x00,0x0B,0xC0,0x3D,0x00,0x0B,0xC0,0x3D,0x00,0x09,0x00},/*"#",3*/ +{0x18,0xC0,0x24,0x40,0x7F,0xE0,0x22,0x40,0x31,0x80,0x00,0x00},/*"$",4*/ +{0x18,0x00,0x24,0xC0,0x1B,0x00,0x0D,0x80,0x32,0x40,0x01,0x80},/*"%",5*/ +{0x03,0x80,0x1C,0x40,0x27,0x40,0x1C,0x80,0x07,0x40,0x00,0x40},/*"&",6*/ +{0x10,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"'",7*/ +{0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x80,0x20,0x40,0x40,0x20},/*"(",8*/ +{0x00,0x00,0x40,0x20,0x20,0x40,0x1F,0x80,0x00,0x00,0x00,0x00},/*")",9*/ +{0x09,0x00,0x06,0x00,0x1F,0x80,0x06,0x00,0x09,0x00,0x00,0x00},/*"*",10*/ +{0x04,0x00,0x04,0x00,0x3F,0x80,0x04,0x00,0x04,0x00,0x00,0x00},/*"+",11*/ +{0x00,0x10,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*",",12*/ +{0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x00,0x00},/*"-",13*/ +{0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*".",14*/ +{0x00,0x20,0x01,0xC0,0x06,0x00,0x38,0x00,0x40,0x00,0x00,0x00},/*"/",15*/ +{0x1F,0x80,0x20,0x40,0x20,0x40,0x20,0x40,0x1F,0x80,0x00,0x00},/*"0",16*/ +{0x00,0x00,0x10,0x40,0x3F,0xC0,0x00,0x40,0x00,0x00,0x00,0x00},/*"1",17*/ +{0x18,0xC0,0x21,0x40,0x22,0x40,0x24,0x40,0x18,0x40,0x00,0x00},/*"2",18*/ +{0x10,0x80,0x20,0x40,0x24,0x40,0x24,0x40,0x1B,0x80,0x00,0x00},/*"3",19*/ +{0x02,0x00,0x0D,0x00,0x11,0x00,0x3F,0xC0,0x01,0x40,0x00,0x00},/*"4",20*/ +{0x3C,0x80,0x24,0x40,0x24,0x40,0x24,0x40,0x23,0x80,0x00,0x00},/*"5",21*/ +{0x1F,0x80,0x24,0x40,0x24,0x40,0x34,0x40,0x03,0x80,0x00,0x00},/*"6",22*/ +{0x30,0x00,0x20,0x00,0x27,0xC0,0x38,0x00,0x20,0x00,0x00,0x00},/*"7",23*/ +{0x1B,0x80,0x24,0x40,0x24,0x40,0x24,0x40,0x1B,0x80,0x00,0x00},/*"8",24*/ +{0x1C,0x00,0x22,0xC0,0x22,0x40,0x22,0x40,0x1F,0x80,0x00,0x00},/*"9",25*/ +{0x00,0x00,0x00,0x00,0x08,0x40,0x00,0x00,0x00,0x00,0x00,0x00},/*":",26*/ +{0x00,0x00,0x00,0x00,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00},/*";",27*/ +{0x00,0x00,0x04,0x00,0x0A,0x00,0x11,0x00,0x20,0x80,0x40,0x40},/*"<",28*/ +{0x09,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x00,0x00},/*"=",29*/ +{0x00,0x00,0x40,0x40,0x20,0x80,0x11,0x00,0x0A,0x00,0x04,0x00},/*">",30*/ +{0x18,0x00,0x20,0x00,0x23,0x40,0x24,0x00,0x18,0x00,0x00,0x00},/*"?",31*/ +{0x1F,0x80,0x20,0x40,0x27,0x40,0x29,0x40,0x1F,0x40,0x00,0x00},/*"@",32*/ +{0x00,0x40,0x07,0xC0,0x39,0x00,0x0F,0x00,0x01,0xC0,0x00,0x40},/*"A",33*/ +{0x20,0x40,0x3F,0xC0,0x24,0x40,0x24,0x40,0x1B,0x80,0x00,0x00},/*"B",34*/ +{0x1F,0x80,0x20,0x40,0x20,0x40,0x20,0x40,0x30,0x80,0x00,0x00},/*"C",35*/ +{0x20,0x40,0x3F,0xC0,0x20,0x40,0x20,0x40,0x1F,0x80,0x00,0x00},/*"D",36*/ +{0x20,0x40,0x3F,0xC0,0x24,0x40,0x2E,0x40,0x30,0xC0,0x00,0x00},/*"E",37*/ +{0x20,0x40,0x3F,0xC0,0x24,0x40,0x2E,0x00,0x30,0x00,0x00,0x00},/*"F",38*/ +{0x0F,0x00,0x10,0x80,0x20,0x40,0x22,0x40,0x33,0x80,0x02,0x00},/*"G",39*/ +{0x20,0x40,0x3F,0xC0,0x04,0x00,0x04,0x00,0x3F,0xC0,0x20,0x40},/*"H",40*/ +{0x20,0x40,0x20,0x40,0x3F,0xC0,0x20,0x40,0x20,0x40,0x00,0x00},/*"I",41*/ +{0x00,0x60,0x20,0x20,0x20,0x20,0x3F,0xC0,0x20,0x00,0x20,0x00},/*"J",42*/ +{0x20,0x40,0x3F,0xC0,0x24,0x40,0x0B,0x00,0x30,0xC0,0x20,0x40},/*"K",43*/ +{0x20,0x40,0x3F,0xC0,0x20,0x40,0x00,0x40,0x00,0x40,0x00,0xC0},/*"L",44*/ +{0x3F,0xC0,0x3C,0x00,0x03,0xC0,0x3C,0x00,0x3F,0xC0,0x00,0x00},/*"M",45*/ +{0x20,0x40,0x3F,0xC0,0x0C,0x40,0x23,0x00,0x3F,0xC0,0x20,0x00},/*"N",46*/ +{0x1F,0x80,0x20,0x40,0x20,0x40,0x20,0x40,0x1F,0x80,0x00,0x00},/*"O",47*/ +{0x20,0x40,0x3F,0xC0,0x24,0x40,0x24,0x00,0x18,0x00,0x00,0x00},/*"P",48*/ +{0x1F,0x80,0x21,0x40,0x21,0x40,0x20,0xE0,0x1F,0xA0,0x00,0x00},/*"Q",49*/ +{0x20,0x40,0x3F,0xC0,0x24,0x40,0x26,0x00,0x19,0xC0,0x00,0x40},/*"R",50*/ +{0x18,0xC0,0x24,0x40,0x24,0x40,0x22,0x40,0x31,0x80,0x00,0x00},/*"S",51*/ +{0x30,0x00,0x20,0x40,0x3F,0xC0,0x20,0x40,0x30,0x00,0x00,0x00},/*"T",52*/ +{0x20,0x00,0x3F,0x80,0x00,0x40,0x00,0x40,0x3F,0x80,0x20,0x00},/*"U",53*/ +{0x20,0x00,0x3E,0x00,0x01,0xC0,0x07,0x00,0x38,0x00,0x20,0x00},/*"V",54*/ +{0x38,0x00,0x07,0xC0,0x3C,0x00,0x07,0xC0,0x38,0x00,0x00,0x00},/*"W",55*/ +{0x20,0x40,0x39,0xC0,0x06,0x00,0x39,0xC0,0x20,0x40,0x00,0x00},/*"X",56*/ +{0x20,0x00,0x38,0x40,0x07,0xC0,0x38,0x40,0x20,0x00,0x00,0x00},/*"Y",57*/ +{0x30,0x40,0x21,0xC0,0x26,0x40,0x38,0x40,0x20,0xC0,0x00,0x00},/*"Z",58*/ +{0x00,0x00,0x00,0x00,0x7F,0xE0,0x40,0x20,0x40,0x20,0x00,0x00},/*"[",59*/ +{0x00,0x00,0x70,0x00,0x0C,0x00,0x03,0x80,0x00,0x40,0x00,0x00},/*"\",60*/ +{0x00,0x00,0x40,0x20,0x40,0x20,0x7F,0xE0,0x00,0x00,0x00,0x00},/*"]",61*/ +{0x00,0x00,0x20,0x00,0x40,0x00,0x20,0x00,0x00,0x00,0x00,0x00},/*"^",62*/ +{0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10},/*"_",63*/ +{0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"`",64*/ +{0x00,0x00,0x02,0x80,0x05,0x40,0x05,0x40,0x03,0xC0,0x00,0x40},/*"a",65*/ +{0x20,0x00,0x3F,0xC0,0x04,0x40,0x04,0x40,0x03,0x80,0x00,0x00},/*"b",66*/ +{0x00,0x00,0x03,0x80,0x04,0x40,0x04,0x40,0x06,0x40,0x00,0x00},/*"c",67*/ +{0x00,0x00,0x03,0x80,0x04,0x40,0x24,0x40,0x3F,0xC0,0x00,0x40},/*"d",68*/ +{0x00,0x00,0x03,0x80,0x05,0x40,0x05,0x40,0x03,0x40,0x00,0x00},/*"e",69*/ +{0x00,0x00,0x04,0x40,0x1F,0xC0,0x24,0x40,0x24,0x40,0x20,0x00},/*"f",70*/ +{0x00,0x00,0x02,0xE0,0x05,0x50,0x05,0x50,0x06,0x50,0x04,0x20},/*"g",71*/ +{0x20,0x40,0x3F,0xC0,0x04,0x40,0x04,0x00,0x03,0xC0,0x00,0x40},/*"h",72*/ +{0x00,0x00,0x04,0x40,0x27,0xC0,0x00,0x40,0x00,0x00,0x00,0x00},/*"i",73*/ +{0x00,0x10,0x00,0x10,0x04,0x10,0x27,0xE0,0x00,0x00,0x00,0x00},/*"j",74*/ +{0x20,0x40,0x3F,0xC0,0x01,0x40,0x07,0x00,0x04,0xC0,0x04,0x40},/*"k",75*/ +{0x20,0x40,0x20,0x40,0x3F,0xC0,0x00,0x40,0x00,0x40,0x00,0x00},/*"l",76*/ +{0x07,0xC0,0x04,0x00,0x07,0xC0,0x04,0x00,0x03,0xC0,0x00,0x00},/*"m",77*/ +{0x04,0x40,0x07,0xC0,0x04,0x40,0x04,0x00,0x03,0xC0,0x00,0x40},/*"n",78*/ +{0x00,0x00,0x03,0x80,0x04,0x40,0x04,0x40,0x03,0x80,0x00,0x00},/*"o",79*/ +{0x04,0x10,0x07,0xF0,0x04,0x50,0x04,0x40,0x03,0x80,0x00,0x00},/*"p",80*/ +{0x00,0x00,0x03,0x80,0x04,0x40,0x04,0x50,0x07,0xF0,0x00,0x10},/*"q",81*/ +{0x04,0x40,0x07,0xC0,0x02,0x40,0x04,0x00,0x04,0x00,0x00,0x00},/*"r",82*/ +{0x00,0x00,0x06,0x40,0x05,0x40,0x05,0x40,0x04,0xC0,0x00,0x00},/*"s",83*/ +{0x00,0x00,0x04,0x00,0x1F,0x80,0x04,0x40,0x00,0x40,0x00,0x00},/*"t",84*/ +{0x04,0x00,0x07,0x80,0x00,0x40,0x04,0x40,0x07,0xC0,0x00,0x40},/*"u",85*/ +{0x04,0x00,0x07,0x00,0x04,0xC0,0x01,0x80,0x06,0x00,0x04,0x00},/*"v",86*/ +{0x06,0x00,0x01,0xC0,0x07,0x00,0x01,0xC0,0x06,0x00,0x00,0x00},/*"w",87*/ +{0x04,0x40,0x06,0xC0,0x01,0x00,0x06,0xC0,0x04,0x40,0x00,0x00},/*"x",88*/ +{0x04,0x10,0x07,0x10,0x04,0xE0,0x01,0x80,0x06,0x00,0x04,0x00},/*"y",89*/ +{0x00,0x00,0x04,0x40,0x05,0xC0,0x06,0x40,0x04,0x40,0x00,0x00},/*"z",90*/ +{0x00,0x00,0x00,0x00,0x04,0x00,0x7B,0xE0,0x40,0x20,0x00,0x00},/*"{",91*/ +{0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xF0,0x00,0x00,0x00,0x00},/*"|",92*/ +{0x00,0x00,0x40,0x20,0x7B,0xE0,0x04,0x00,0x00,0x00,0x00,0x00},/*"}",93*/ +{0x40,0x00,0x80,0x00,0x40,0x00,0x20,0x00,0x20,0x00,0x40,0x00},/*"~",94*/ +}; + + +//the logo of robomaster +const unsigned char LOGO_BMP[128][8] = { +{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,0x06}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDE}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDE}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF6}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x72}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC6}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC6}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC6}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDE}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD6}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD6}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD6}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD6}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDE}, +{0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xFE}, +{0x60,0x00,0x00,0x00,0x00,0x10,0x00,0x6C}, +{0x70,0x00,0x00,0x00,0x00,0x30,0x00,0x00}, +{0x78,0x00,0x00,0x00,0x00,0xF0,0x00,0x7C}, +{0x7C,0x00,0x00,0x00,0x07,0xF0,0x00,0xFE}, +{0x7E,0x00,0x00,0x00,0x3F,0xF0,0x00,0xC6}, +{0x7F,0x00,0x00,0x01,0xFF,0xF0,0x00,0xC6}, +{0x7F,0x80,0x00,0x0F,0xFF,0xF0,0x00,0xC6}, +{0x7F,0xC0,0x00,0x7F,0xFF,0xF0,0x00,0xFE}, +{0x7F,0xE0,0x03,0xFF,0xFF,0xF0,0x00,0x7C}, +{0x7F,0xF0,0x3F,0xFF,0xFF,0xF0,0x00,0x02}, +{0x7F,0xF8,0x3F,0xFF,0xFF,0xF0,0x00,0x06}, +{0x7F,0xFC,0x3F,0xFF,0xFF,0xF0,0x00,0x1E}, +{0x7F,0xFE,0x3F,0xFF,0xFF,0xF0,0x00,0xBC}, +{0x7F,0xFF,0x3F,0xFF,0xFF,0xF0,0x00,0xE0}, +{0x7F,0xFF,0xBF,0xFF,0xFF,0x80,0x00,0xF8}, +{0x7F,0xFF,0xFF,0xFF,0xFC,0x00,0x00,0x3E}, +{0x7F,0xFF,0xFF,0xFF,0xE0,0x00,0x00,0x0E}, +{0x7F,0xFF,0xFF,0xFF,0x00,0x00,0x00,0xB8}, +{0x7F,0xFF,0xFF,0xF8,0x00,0x00,0x00,0xE0}, +{0x7F,0xFF,0xFF,0xF0,0x00,0x00,0x00,0xFE}, +{0x7F,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x1E}, +{0x7F,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x02}, +{0x7F,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00}, +{0x7F,0xEF,0xFF,0xF0,0x02,0x00,0x00,0x06}, +{0x7F,0xE7,0xFF,0xF0,0x02,0x00,0x00,0x0E}, +{0x7F,0xE3,0xFF,0xF0,0x02,0x00,0x00,0x1C}, +{0x7F,0xE1,0xFF,0xF8,0x03,0x00,0x00,0xBA}, +{0x7F,0xE0,0xFF,0xFC,0x03,0x00,0x00,0xF6}, +{0x7F,0xE0,0x7F,0xFE,0x03,0x80,0x00,0xE6}, +{0x7F,0xE0,0x3F,0xFF,0x03,0x80,0x00,0xF6}, +{0x7F,0xE0,0x3F,0xFF,0x83,0xC0,0x00,0x3E}, +{0x7F,0xE0,0x3F,0xFF,0xC3,0xC0,0x00,0x0E}, +{0x7F,0xE0,0x3F,0xFF,0xE3,0xE0,0x00,0x02}, +{0x7F,0xE0,0x3F,0xFF,0xF3,0xE0,0x00,0x00}, +{0x7F,0xE0,0x3F,0xFF,0xFB,0xF0,0x00,0x02}, +{0x7F,0xE0,0x3F,0xFF,0xFF,0xF0,0x00,0x66}, +{0x7F,0xE0,0x3F,0xFF,0xFF,0xF8,0x00,0xF6}, +{0x7F,0xE0,0x3F,0xFF,0xFF,0xF8,0x00,0xD6}, +{0x7F,0xE0,0x3F,0xFF,0xFF,0xFC,0x00,0xD6}, +{0x7F,0xF0,0x7F,0xFF,0xFF,0xFC,0x00,0xD6}, +{0x7F,0xF8,0xFF,0xF7,0xFF,0xFE,0x00,0xD6}, +{0x7F,0xFF,0xFF,0xF3,0xFF,0xFE,0x00,0xDE}, +{0x3F,0xFF,0xFF,0xE1,0xFF,0xFF,0x00,0x8C}, +{0x3F,0xFF,0xFF,0xE0,0xFF,0xCF,0x00,0x40}, +{0x1F,0xFF,0xFF,0xC0,0x7F,0xC7,0x80,0xC0}, +{0x1F,0xFF,0xFF,0xC0,0x3F,0xC3,0x80,0xC0}, +{0x0F,0xFF,0xFF,0x80,0x1F,0xC1,0xC0,0xFE}, +{0x07,0xFF,0xFF,0x00,0x0F,0xC0,0xC0,0xFE}, +{0x03,0xFF,0xFE,0x00,0x07,0xC0,0x60,0xC0}, +{0x01,0xFF,0xFC,0x00,0x03,0xC0,0x20,0xC0}, +{0x00,0x7F,0xF0,0x00,0x01,0xC0,0x00,0x86}, +{0x00,0x0F,0x80,0x00,0x00,0xC0,0x00,0x16}, +{0x00,0x00,0x00,0x00,0x00,0x40,0x00,0xD6}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD6}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD6}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD6}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD6}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD0}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDE}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDE}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDE}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF6}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x72}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x62}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF6}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF6}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD6}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD6}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD6}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDE}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8C}, +{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,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}, +}; + +#endif