#include #include "oled.h" #include "log.h" #include "tool.h" #include "t_oled.h" uint8_t Cmd(uint8_t *data, size_t l) { Buf_Print("Cmd", data, l, 16); } uint8_t Data(uint8_t *data, size_t l) { Buf_Print("Data", data, l, 128); } void Refresh_Call(OLED_T *dev) { LOGT("OLED", "CALL"); BufPrint("Buf", dev->buf, T_U8, dev->width * (dev->height / 8), 16); } uint8_t oledbuf[8][128] = {0}; void Test_OLED() { OLED_T oled = { .height=64, .width=128, .state=IDLE, .buf=oledbuf, .cmd=Cmd, .data=Data, .call=Refresh_Call, }; OLED_Init(&oled); OLED_CLS(&oled); OLED_ShowString(&oled, 0, 0, "Hello", 12); OLED_Refresh(&oled); }