mirror of
https://github.com/jtgans/g13gui.git
synced 2025-06-20 16:33:54 -04:00
This is the first half of some major rework of the g13d codebase to make things a bit more manageable. This splits out a great deal of stuff from helper.h into separate translation units, and also breaks out a great deal of the g13.h header into separate translation units as well. Doing this saves in compilation time as we make changes to the system, and also helps to clean up a whole bunch of leaking symbols.
43 lines
897 B
C++
43 lines
897 B
C++
#ifndef LCD_H
|
|
#define LCD_H
|
|
|
|
#include "g13.h"
|
|
|
|
#include <memory.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
|