36 lines
759 B
C
36 lines
759 B
C
#include <stdio.h>
|
|
#include "oled.h"
|
|
#include "log.h"
|
|
#include "tool.h"
|
|
#include "t_oled.h"
|
|
|
|
void Cmd(uint8_t *data, size_t l) {
|
|
Buf_Print("Cmd", data, l, 16);
|
|
}
|
|
|
|
void Data(uint8_t *data, size_t l) {
|
|
Buf_Print("Data", data, l, 16);
|
|
}
|
|
|
|
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=(uint8_t) 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);
|
|
} |