diff options
author | Agathe Porte <microjoe@microjoe.org> | 2020-02-23 10:30:59 +0100 |
---|---|---|
committer | Agathe Porte <microjoe@microjoe.org> | 2020-02-23 11:37:50 +0100 |
commit | c07aa9f0c068200d80f6635c221dd7480e53766a (patch) | |
tree | 8b454142169036e1b4be38289e46e9b76bdfd9dd /src/lib.rs | |
parent | bc0e5a406a0179fdbc7a5e298d108e966bcb3ed0 (diff) | |
download | charlcd-c07aa9f0c068200d80f6635c221dd7480e53766a.tar.gz charlcd-c07aa9f0c068200d80f6635c221dd7480e53766a.zip |
custom chars support
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -1,4 +1,5 @@ mod codes; +pub mod custom_char; mod of_node; use std::fs::{File, OpenOptions}; @@ -288,6 +289,17 @@ where write_simple_code!(self, SpecialCode::LargeFont) } + /// Custom character create + pub fn custom_char(&mut self, code: u8, value: [u8; 8]) -> std::io::Result<()> { + let mut res = 0u64; + let mut i = 0; + for b in value.iter().rev() { + res |= (*b as u64) << i; + i += 8; + } + write_simple_code!(self, SpecialCode::Generator(code, res)) + } + pub fn gotoxy(&mut self, x: u32, y: u32) -> std::io::Result<()> { write_simple_code!(self, SpecialCode::GotoXY(Some(x), Some(y))) } |