mirror of
https://github.com/jtgans/g13gui.git
synced 2025-06-20 08:23:50 -04:00
47 lines
910 B
C++
47 lines
910 B
C++
#ifndef LCD_H
|
|
#define LCD_H
|
|
|
|
#include <memory.h>
|
|
|
|
#include "g13.h"
|
|
|
|
namespace G13 {
|
|
|
|
class G13_Device;
|
|
|
|
class G13_LCD {
|
|
public:
|
|
G13_LCD(G13_Device &keypad);
|
|
|
|
G13_Device &_keypad;
|
|
unsigned char image_buf[G13_LCD_BUF_SIZE + 8];
|
|
unsigned cursor_row;
|
|
unsigned cursor_col;
|
|
int text_mode;
|
|
|
|
void image(unsigned char *data, int size);
|
|
void image_send() {
|
|
image(image_buf, G13_LCD_BUF_SIZE);
|
|
}
|
|
|
|
void image_test(int x, int y);
|
|
void image_clear() {
|
|
memset(image_buf, 0, G13_LCD_BUF_SIZE);
|
|
}
|
|
|
|
unsigned image_byte_offset(unsigned row, unsigned col) {
|
|
return col + (row / 8) * G13_LCD_BYTES_PER_ROW * 8;
|
|
}
|
|
|
|
void image_setpixel(unsigned row, unsigned col);
|
|
void image_clearpixel(unsigned row, unsigned col);
|
|
|
|
void write_char(char c, int row = -1, int col = -1);
|
|
void write_string(const char *str);
|
|
void write_pos(int row, int col);
|
|
};
|
|
|
|
} // namespace G13
|
|
|
|
#endif // LCD_H
|