pub trait Ext: Basic {
// Provided methods
fn toggle_display(&mut self) { ... }
fn write_char_to_cur(&mut self, char: char) { ... }
fn write_str_to_cur(&mut self, str: &str) { ... }
fn write_byte_to_pos(&mut self, byte: u8, pos: (u8, u8)) { ... }
fn write_char_to_pos(&mut self, char: char, pos: (u8, u8)) { ... }
fn write_str_to_pos(&mut self, str: &str, pos: (u8, u8)) { ... }
fn write_graph_to_cur(&mut self, index: u8) { ... }
fn write_graph_to_pos(&mut self, index: u8, pos: (u8, u8)) { ... }
fn offset_cursor_pos(&mut self, offset: (i8, i8)) { ... }
}
Expand description
Useful command to control LCD1602
Provided Methods§
Sourcefn toggle_display(&mut self)
fn toggle_display(&mut self)
toggle entire display on and off (it doesn’t toggle backlight)
Sourcefn write_char_to_cur(&mut self, char: char)
fn write_char_to_cur(&mut self, char: char)
write char to current position
In default implementation, character only support
from ASCII 0x20 (white space) to ASCII 0x7D (}
)
Sourcefn write_str_to_cur(&mut self, str: &str)
fn write_str_to_cur(&mut self, str: &str)
write string to current position
Sourcefn write_byte_to_pos(&mut self, byte: u8, pos: (u8, u8))
fn write_byte_to_pos(&mut self, byte: u8, pos: (u8, u8))
write a byte to specific position
Sourcefn write_char_to_pos(&mut self, char: char, pos: (u8, u8))
fn write_char_to_pos(&mut self, char: char, pos: (u8, u8))
write a char to specific position
Sourcefn write_str_to_pos(&mut self, str: &str, pos: (u8, u8))
fn write_str_to_pos(&mut self, str: &str, pos: (u8, u8))
write string to specific position
Sourcefn write_graph_to_cur(&mut self, index: u8)
fn write_graph_to_cur(&mut self, index: u8)
write custom graph to current position
If you write 5x11 Font graph, but only want to access upper part of the graph in 5x8 Font mode,
you will need to shift index
one bit left to get correct graph.
Sourcefn write_graph_to_pos(&mut self, index: u8, pos: (u8, u8))
fn write_graph_to_pos(&mut self, index: u8, pos: (u8, u8))
write custom graph to specific position
If you write 5x11 Font graph, but only want to access upper part of the graph in 5x8 Font mode,
you will need to shift index
one bit left to get correct graph.
Sourcefn offset_cursor_pos(&mut self, offset: (i8, i8))
fn offset_cursor_pos(&mut self, offset: (i8, i8))
change cursor position with relative offset