4 * Created on: 21-06-2013
11 #include "libs/Kernel.h"
25 #define LCDPAGES (LCDHEIGHT+7)/8
26 #define FB_SIZE LCDWIDTH*LCDPAGES
30 #define spi_channel_checksum CHECKSUM("spi_channel")
31 #define spi_cs_pin_checksum CHECKSUM("spi_cs_pin")
32 #define spi_frequency_checksum CHECKSUM("spi_frequency")
33 #define encoder_a_pin_checksum CHECKSUM("encoder_a_pin")
34 #define encoder_b_pin_checksum CHECKSUM("encoder_b_pin")
35 #define click_button_pin_checksum CHECKSUM("click_button_pin")
36 #define up_button_pin_checksum CHECKSUM("up_button_pin")
37 #define down_button_pin_checksum CHECKSUM("down_button_pin")
38 #define contrast_checksum CHECKSUM("contrast")
39 #define reverse_checksum CHECKSUM("reverse")
40 #define rst_pin_checksum CHECKSUM("rst_pin")
41 #define a0_pin_checksum CHECKSUM("a0_pin")
45 class ST7565
: public LcdBase
{
52 void setCursor(uint8_t col
, uint8_t row
);
54 void write_char(char value
);
55 void write(const char* line
, int len
);
57 void on_refresh(bool now
=false);
58 //encoder which dosent exist :/
59 uint8_t readButtons();
60 int readEncoderDelta();
61 int getEncoderResolution() { return 2; }
62 uint16_t get_screen_lines() { return 8; }
63 bool hasGraphics() { return true; }
65 //added ST7565 commands
66 void send_commands(const unsigned char* buf
, size_t size
);
67 void send_data(const unsigned char* buf
, size_t size
);
68 // set column and page number
69 void set_xy(int x
, int y
);
70 //send pic to whole screen
71 void send_pic(const unsigned char* data
);
73 int drawChar(int x
, int y
, unsigned char c
, int color
);
74 // blit a glyph of w pixels wide and h pixels high to x, y. offset pixel position in glyph by x_offset, y_offset.
75 // span is the width in bytes of the src bitmap
76 // The glyph bytes will be 8 bits of X pixels, msbit->lsbit from top left to bottom right
77 void bltGlyph(int x
, int y
, int w
, int h
, const uint8_t *glyph
, int span
= 0, int x_offset
=0, int y_offset
=0);
78 void renderGlyph(int x
, int y
, const uint8_t *g
, int pixelWidth
, int pixelHeight
);
79 void pixel(int x
, int y
, int colour
);
83 unsigned char *framebuffer
;
94 // text cursor position
100 #endif /* ST7565_H_ */