MiaoUI/display/dispDirver.c

288 lines
8.6 KiB
C
Raw Permalink Normal View History

/**
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <2024> <JianFeng>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
2024-02-06 09:38:48 +00:00
#include "dispDirver.h"
// #include "u8g2.h"
// u8g2_t u8g2;
/**
*
* OLED显示器
*
* @
* @
*/
void diapInit(void)
{
// 初始化U8g2库为OLED显示做准备
}
/**
* OLED显示缓冲区
*
* OLED显示器的缓冲区
*
* :
*
*
* :
*
*/
void Disp_ClearBuffer(void)
{
// u8g2_ClearBuffer(&u8g2); // 清除OLED显示缓冲区的具体实现使用u8g2库提供的函数。
}
/**
* OLED发送缓冲区数据
*
*
*/
void Disp_SendBuffer(void)
{
/* 将U8G2实例的缓冲区数据发送到OLED设备 */
// u8g2_SendBuffer(&u8g2);
}
/**
* OLED显示器的字体
*
* @param font 使
*
* u8g2的设置函数OLED显示的字体
*/
void Disp_SetFont(const uint8_t *font)
{
// u8g2_SetFont(&u8g2, font); // 设置U8g2实例的字体
}
/**
* OLED显示器上绘制一条线
*
* @param x1 X坐标
* @param y1 Y坐标
* @param x2 X坐标
* @param y2 Y坐标
*
* u8g2的DrawLine函数使OLED显示器上绘制一条线
*/
void Disp_DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2)
{
// u8g2_DrawLine(&u8g2, x1, y1, x2, y2);
}
/**
* OLED屏幕上绘制字符串
*
* @param x x坐标
* @param y y坐标
* @param str
* @return u8g2库的实现
*/
uint16_t Disp_DrawStr(uint16_t x, uint16_t y, const char *str)
{
// 调用u8g2库的DrawStr函数在指定位置绘制字符串
// return u8g2_DrawStr(&u8g2, x, y, str);
}
/**
* OLED显示设备的绘制颜色
*
* @param color 使uint8_t类型表示OLED驱动库的实现
*
* u8g2库的u8g2_SetDrawColor函数
*/
void Disp_SetDrawColor(void *color)
{
// u8g2_SetDrawColor(&u8g2, *(uint8_t *)color); // 调用u8g2库的函数设置绘制颜色
}
/**
* OLED屏幕上绘制一个框架
*
* @param x x坐标
* @param y y坐标
* @param w
* @param h
*
* u8g2的绘制框架函数
*/
void Disp_DrawFrame(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
{
// u8g2_DrawFrame(&u8g2, x, y, w, h);
}
/**
* OLED屏幕上绘制一个矩形边框
*
* @param x x坐标
* @param y y坐标
* @param w
* @param h
* @param r
*
* u8g2的绘制函数
*/
void Disp_DrawRFrame(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t r)
{
// u8g2_DrawRFrame(&u8g2, x, y, w, h, r);
}
/**
* OLED显示器上绘制一个矩形框
*
* @param x x坐标
* @param y y坐标
* @param w
* @param h
*
* u8g2的绘制矩形框函数OLED屏幕上绘制矩形
*/
void Disp_DrawBox(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
{
// u8g2_DrawBox(&u8g2, x, y, w, h); // 调用u8g2库的绘制矩形函数
}
/**
* OLED显示器上绘制一个带圆角的矩形
*
* @param x x坐标
* @param y y坐标
* @param w
* @param h
* @param r
*
* u8g2的绘制函数OLED显示器上绘制一个带圆角的矩形
*/
void Disp_DrawRBox(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t r)
{
// u8g2_DrawRBox(&u8g2, x, y, w, h, r);
}
/**
* OLED显示器上绘制一个XBM图像
*
* @param x x坐标
* @param y y坐标
* @param w
* @param h
* @param bitmap XBM图像数据的缓冲区的指针
*
* 使u8g2库的u8g2_DrawXBMP函数来绘制图像XBM格式的
*/
void Disp_DrawXBMP(uint16_t x, uint16_t y, uint16_t w, uint16_t h, const uint8_t *bitmap)
{
// u8g2_DrawXBMP(&u8g2, x, y, w, h, bitmap);
}
/**
* OLED显示器的对比度
*
* @param value 0255
*
* u8g2库中的u8g2_SetContrast函数OLED显示器的对比度
* 使OLED显示器和u8g2配置来选择合适的对比度值
*/
void Disp_SetContrast(ui_t *ui)
{
// u8g2_SetContrast(&u8g2, *(uint8_t *)ui->nowItem->element->data->ptr); // 调用u8g2库函数设置对比度
}
/**
* OLED电源节省模式
*
* OLED的电源节省模式is_enable为1时
* is_enable为0时
*
* @param is_enable (uint8_t)
* 10
*/
void Disp_SetPowerSave(ui_t *ui)
{
// u8g2_SetPowerSave(&u8g2, *(uint8_t *)ui->nowItem->element->data->ptr); // 调用u8g2库的函数设置OLED的电源节省模式状态
}
/**
* OLED缓冲区的 tile
*
*
*
* @return OLED缓冲区的tile高度uint8_t类型8
*/
uint8_t Disp_GetBufferTileHeight(void)
{
// return u8g2_GetBufferTileHeight(&u8g2); // 调用u8g2库函数获取当前OLED缓冲区的tile高度
}
/**
* OLED缓冲区的单个瓦片宽度
*
* U8G2图形库当前配置的OLED缓冲区的单个瓦片宽度OLED屏幕
* OLED屏幕的物理分辨率
* U8G2库的内部处理方式
*
* @return OLED缓冲区单个瓦片的宽度
*/
uint8_t Disp_GetBufferTileWidth(void)
{
// return u8g2_GetBufferTileWidth(&u8g2);
}
/**
* OLED显示缓冲区的指针
*
* OLED显示设备的显示缓冲区的指针uint8_t类型的数组
* OLED屏幕上的图像数据
*
* @return uint8_t*OLED显示缓冲区的起始位置
*/
uint8_t *Disp_GetBufferPtr(void)
{
// 调用u8g2库的函数获取显示缓冲区指针
// return u8g2_GetBufferPtr(&u8g2);
}
void Disp_SetClipWindow(uint16_t clip_x0, uint16_t clip_y0, uint16_t clip_x1, uint16_t clip_y1)
{
// u8g2_SetClipWindow(&u8g2, clip_x0, clip_y0, clip_x1, clip_y1);
}
void Disp_SetMaxClipWindow(void)
{
// u8g2_SetMaxClipWindow(&u8g2);
}
void Disp_SetBufferCurrTileRow(uint8_t row)
{
// u8g2_SetBufferCurrTileRow(&u8g2, row);
}
uint16_t Disp_DrawUTF8(uint16_t x, uint16_t y, const char *str)
{
// return u8g2_DrawUTF8(&u8g2, x, y, str);
}
uint16_t Disp_GetUTF8Width(const char *str)
{
// return u8g2_GetUTF8Width(&u8g2, str);
}
void Disp_UpdateDisplayArea(uint8_t tx, uint8_t ty, uint8_t tw, uint8_t th)
{
// u8g2_UpdateDisplayArea(&u8g2, tx, ty, tw, th);
}