开发环境
硬件:M451RG6AE+SSD1306驱动芯片
软件:FreeRTOS8.1.0+ugfx2.5
开发环境:coocox IDEV2 + arm-linux-gcc
实例源码位置
/demos/modules/gdisp/basics
开启相关宏
#define GFX_USE_GDISP 1
#define GFX_USE_GDRIVER 1
#define GDISP_NEED_AUTOFLUSH TRUE(开启自动刷新后,就不要自己手动刷新了)
#define GDISP_NEED_VALIDATION TRUE
#define GDISP_NEED_CLIP TRUE
实例代码
#include "gfx.h"
int main(void) {
coord_t width, height;
coord_t i, j;
// Initialize and clear the display
gfxInit();
// Get the screen size
width = gdispGetWidth();
height = gdispGetHeight();
// Code Here
gdispDrawBox(10, 10, width/2, height/2, Yellow);
gdispFillArea(width/2, height/2, width/2-10, height/2-10, Blue);
gdispDrawLine(5, 30, width-50, height-40, Red);
for(i = 5, j = 0; i < width && j < height; i += 7, j += i/20)
gdispDrawPixel(i, j, White);
while(TRUE)
{
gfxSleepMilliseconds(500);
}
}
其它API
请自行参考gdisp.h文件