我们在 main.c 文件开头添加 GuiLite 接口代码,接口代码如下:- //画点函数接口
- void gfx_draw_pixel(int x, int y, unsigned int rgb)
- {
- OLED_DrawPoint(x,y,rgb);
- }
- //画面函数(未使用)
- void gfx_draw_fill(int x, int y,int w, int q, unsigned int rgb)
- {
- }
- //创建一个函数指针结构体
- struct EXTERNAL_GFX_OP
- {
- void (*draw_pixel)(int x, int y, unsigned int rgb);
- void (*fill_rect)(int x0, int y0, int x1, int y1, unsigned int rgb);
- } my_gfx_op;
- extern void startHelloCircle(void* phy_fb, int width, int height, int color_bytes, struct EXTERNAL_GFX_OP* gfx_op);
-
- //设定延时函数接口
- void delay_ms(int milli_seconds)
- {
- HAL_Delay(milli_seconds);
- }
|