diff --git a/ssd1306.h b/ssd1306.h --- a/ssd1306.h +++ b/ssd1306.h @@ -1,6 +1,40 @@ #ifndef ssd1306_H #define ssd1306_H -#include "DrawText.h" + +typedef unsigned long Pos_t; +typedef unsigned long Size_t; +typedef unsigned long Color_t; + +typedef unsigned long (*pfnDrawBlock_t)( + Pos_t x, + Pos_t y, + Pos_t cx, + Pos_t cy, + const unsigned char* data); +typedef unsigned long (*pfnDrawPoint_t)(Pos_t x, Pos_t y, Color_t color); + + +typedef unsigned long(*pfnFontDrawChar)(pfnDrawBlock_t DrawBlock,Pos_t x, Pos_t y, unsigned int ch); + + + + +typedef struct _DeviceProp +{ + pfnDrawBlock_t pfnDrawBlok; + pfnDrawPoint_t pfnDrawPoint; + Size_t xPixel; + Size_t yPixel; +}DeviceProp; + +typedef struct _Device +{ + const DeviceProp* pDevProp; + pfnFontDrawChar pfnFont; + Pos_t curX; + Pos_t curY; +}Device; + void ssd1306_Init(void); void StartPageTransfer(void);