//
// Created by lydxh on 24-7-5.
//

#ifndef HW_LIB_SIM_DISPLAY_H
#define HW_LIB_SIM_DISPLAY_H
#ifdef __cplusplus
extern "C" {
#endif

#include "stdint.h"

/**
 * @brief   定义颜色常量值,用于模拟显示
 */
#define BLACK         0          // 黑色
#define BLUE          0xAA0000    // 蓝色
#define GREEN         0x00AA00    // 绿色
#define CYAN          0xAAAA00    // 青色
#define RED           0x0000AA    // 红色
#define MAGENTA       0xAA00AA    // 品红
#define BROWN         0x0055AA    // 棕色
#define LIGHTGRAY     0xAAAAAA    // 亮灰色
#define DARKGRAY      0x555555    // 暗灰色
#define LIGHTBLUE     0xFF5555    // 亮蓝色
#define LIGHTGREEN    0x55FF55    // 亮绿色
#define LIGHTCYAN     0xFFFF55    // 亮青色
#define LIGHTRED      0x5555FF    // 亮红色
#define LIGHTMAGENTA  0xFF55FF    // 亮品红
#define YELLOW        0x55FFFF    // 黄色
#define WHITE         0xFFFFFF    // 白色


/**
 * @brief   初始化模拟 显示
 * @param   width: [输入] 显示宽度
 * @param   height: [输入] 显示高度
 * @param   pixcolor: [输入] 像素颜色
 * @param   backcolor: [输入] 背景颜色
 * @param   scale: [输入] 显示缩放比例
 * @param   border: [输入] 是否显示边框
 * @return  void
 * @example SIM_Display_INIT(128, 64, 0xFFFF00, 0x000000, 10, 1);
 **/
void SIM_Display_INIT(int width, int height, uint32_t pixcolor, uint32_t backcolor, int scale, uint8_t border);

/**
 * @brief   开始模拟 显示
 * @return  void
 * @example SIM_Display_START();
 **/
void SIM_Display_START();

/**
 * @brief   停止模拟 显示
 * @return  void
 * @example SIM_OLED_STOP();
 **/
void SIM_Display_STOP();

/**
 * @brief   从缓冲区绘制到单色显示
 * @param   buf: [输入] 缓冲区指针
 * @param   width: [输入] 图像宽度
 * @param   height: [输入] 图像高度
 * @return  void
 * @example SIM_OneColor_DrawFromBuffer(buffer, 128, 64);
 **/
void SIM_OneColor_DrawFromBuffer(uint8_t *buf, uint16_t width, uint16_t height);

/**
 * @brief   从缓冲区绘制到显示
 * @param   buf: [输入] 缓冲区指针
 * @param   width: [输入] 图像宽度
 * @param   height: [输入] 图像高度
 * @return  void
 * @example SIM_Color_DrawFromBuffer(buffer, 480, 320);
 **/
void SIM_Color_DrawFromBuffer(uint32_t *buf, uint16_t width, uint16_t height);

#ifdef __cplusplus
}
#endif
#endif //HW_LIB_SIM_DISPLAY_H