21 #ifndef COSA_HD44780_HH 22 #define COSA_HD44780_HH 52 virtual bool setup() = 0;
59 virtual void write4b(uint8_t data) = 0;
66 virtual void write8b(uint8_t data);
74 virtual void write8n(
const void* buf,
size_t size);
82 virtual void set_mode(uint8_t flag) = 0;
108 HD44780(
IO* io, uint8_t width = 16, uint8_t height = 2) :
125 virtual bool begin();
162 __attribute__((always_inline))
171 __attribute__((always_inline))
199 __attribute__((always_inline))
208 __attribute__((always_inline))
217 __attribute__((always_inline))
226 __attribute__((always_inline))
237 virtual void set_cursor(uint8_t x, uint8_t y);
243 __attribute__((always_inline))
252 __attribute__((always_inline))
261 __attribute__((always_inline))
270 __attribute__((always_inline))
310 virtual int write(
const void* buf,
size_t size);
312 #if !defined(BOARD_ATTINYX5) 385 virtual bool setup();
392 virtual void write4b(uint8_t data);
399 virtual void write8b(uint8_t data);
407 virtual void set_mode(uint8_t flag);
418 static const uint16_t SHORT_EXEC_TIME = 32;
492 #if !defined(BOARD_ATTINY) 507 virtual bool setup();
514 virtual void write4b(uint8_t data);
521 virtual void write8b(uint8_t data);
529 virtual void set_mode(uint8_t flag);
540 static const uint16_t SHORT_EXEC_TIME = 20;
625 #if !defined(BOARD_ATTINY) 636 virtual bool setup();
643 virtual void write4b(uint8_t data);
650 virtual void write8b(uint8_t data);
658 virtual void set_mode(uint8_t flag);
669 #if !defined(BOARD_ATTINY) 670 static const uint16_t SHORT_EXEC_TIME = 24;
672 static const uint16_t SHORT_EXEC_TIME = 8;
773 #if !defined(BOARD_ATTINY) 790 virtual bool setup();
797 virtual void write4b(uint8_t data);
804 virtual void write8b(uint8_t data);
812 virtual void set_mode(uint8_t flag);
823 static const uint16_t SHORT_EXEC_TIME = 16;
860 } __attribute__((packed));
869 } __attribute__((packed));
878 } __attribute__((packed));
888 } __attribute__((packed));
902 } __attribute__((packed));
920 __attribute__((always_inline))
930 void set(uint8_t& cmd, uint8_t mask)
931 __attribute__((always_inline))
941 void clear(uint8_t& cmd, uint8_t mask)
942 __attribute__((always_inline))
951 __attribute__((always_inline))
960 __attribute__((always_inline))
uint8_t m_rs
Command/Data select.
OutputPin m_d1
Data pin; d1.
virtual void display_clear()
without changing DDRAM contents.
uint8_t as_uint8
Unsigned byte access.
void text_flow_right_to_left()
OutputPin m_bt
Back-light control (0/on, 1/off).
uint8_t m_x
Cursor position x.
void text_scroll_right_adjust()
virtual void set_cursor(uint8_t x, uint8_t y)
void set_instruction_mode()
virtual void backlight_on()
void clear(uint8_t &cmd, uint8_t mask)
Set display, cursor and blinking controls.
Sets the number of display lines, 1 or.
void set_custom_char(uint8_t id, const uint8_t *bitmap)
virtual int write(const void *buf, size_t size)
static const uint16_t LONG_EXEC_TIME
virtual int putchar(char c)
virtual void display_off()
Decrement (left) on write.
Increment (right) on write.
virtual void write8n(const void *buf, size_t size)
OutputPin m_d2
Data pin; d2.
Sets cursor move direction and display shift.
OutputPin m_d0
Data pin; d0.
void cursor_underline_on()
Port4b(Board::DigitalPin d0=Board::D4, Board::DigitalPin d1=Board::D5, Board::DigitalPin d2=Board::D6, Board::DigitalPin d3=Board::D7, Board::DigitalPin rs=Board::D8, Board::DigitalPin en=Board::D9, Board::DigitalPin bt=Board::D10)
OutputPin m_en
Starts data read/write.
HD44780(IO *io, uint8_t width=16, uint8_t height=2)
static const uint16_t INIT1_TIME
static const uint8_t offset0[]
IO * m_io
IO port handler.
void display_scroll_right()
virtual void write8b(uint8_t data)
OutputPin m_sda
Serial data output.
COM SEG direction select.
uint8_t m_mode
Entry mode.
static const uint16_t POWER_ON_TIME
Sets the interface data length, 4-bit or.
uint8_t as_uint8
Unsigned byte access.
const uint8_t * m_offset
Row offset table.
Set cursor and shifts display.
virtual void display_on()
void text_scroll_left_adjust()
OutputPin m_rs
Register select (0/instruction, 1/data).
static const uint8_t offset1[]
Clears entrire display and return home.
virtual int write(const void *buf, size_t size)
static const uint16_t INIT0_TIME
OutputPin m_scl
Serial clock.
Shift the entire display not cursor.
OutputPin m_sda
Serial data output.
Sets basic instruction set.
virtual void set_mode(uint8_t flag)=0
Sets interface data length, line and font.
port_t m_port
Port setting.
virtual void write4b(uint8_t data)=0
uint8_t m_func
Function set.
OutputPin m_en
Starts data read/write.
void text_flow_left_to_right()
OutputPin m_d3
Data pin; d3.
virtual void backlight_off()
Moves cursor and shifts display.
OutputPin m_en
Starts data read/write.
static const uint8_t BITMAP_MAX
virtual void set_backlight(uint8_t flag)=0
void cursor_underline_off()
The character indicated by cursor blinks.
Sets the character font, 5X8 dots or.
OutputPin m_scl
Serial clock.
void display_scroll_left()
OutputPin m_bt
Backlight control.
void set_custom_char_P(uint8_t id, const uint8_t *bitmap)
Sets DDRAM 0 in address counter.
port_t m_port
Port setting.