38 lines
853 B
C
38 lines
853 B
C
|
#ifndef __SSD1306_H__
|
||
|
#define __SSD1306_H__
|
||
|
|
||
|
#include <stdarg.h>
|
||
|
|
||
|
#include "driver.h"
|
||
|
|
||
|
#define SSD1306_LCDWIDTH 128
|
||
|
#define SSD1306_LCDHEIGHT 64
|
||
|
|
||
|
#define IOCTL_CMD_CLS 0
|
||
|
#define IOCTL_CMD_REFRESH 1
|
||
|
#define IOCTL_CMD_DRAW_PIXEL 2
|
||
|
#define IOCTL_CMD_DRAW_LINE 3
|
||
|
#define IOCTL_CMD_DRAW_CIRCLE 4
|
||
|
|
||
|
int ssd1306_open(const struct driver *drv);
|
||
|
int ssd1306_close(const struct driver *drv);
|
||
|
int ssd1306_ioctl(const struct driver *drv, unsigned int cmd, unsigned int argc, va_list args);
|
||
|
|
||
|
struct ssd1306 {
|
||
|
const struct driver *output_dev;
|
||
|
char *output_buffer;
|
||
|
char *bitmap;
|
||
|
uint32_t width;
|
||
|
uint32_t heigth;
|
||
|
};
|
||
|
|
||
|
static const struct driver_fp ssd1306_fp = {
|
||
|
.open = ssd1306_open,
|
||
|
.close = ssd1306_close,
|
||
|
.read = NULL,
|
||
|
.write = NULL,
|
||
|
.ioctl = ssd1306_ioctl,
|
||
|
};
|
||
|
|
||
|
#endif
|