#ifndef ssd1306_H #define ssd1306_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); extern const DeviceProp ssd1306_Prop; unsigned long ssd1306_DrawBlock(Pos_t x, Pos_t y, Pos_t cx, Pos_t cy, const unsigned char* data); unsigned long ssd1306_IsOn(void); unsigned long ssd1306_TurnOff(void); unsigned long ssd1306_TurnOn(void); unsigned char ssd1306_SetContrast(unsigned char contrast); unsigned char ssd1306_GetContrast(); unsigned char* ssd1306_GetBuffer(); unsigned long ssd1306_DrawPoint(Pos_t x, Pos_t y, Color_t color); void ssd1306_block_write(void); void ssd1306_DrawChar(char ascii, unsigned char row, unsigned char xPos); void ssd1306_DrawString(const char *dataPtr, unsigned char row, unsigned char xPos); void ssd1306_test(); #endif