lcd
Library that implements low-level protocol to the Hitachi HD44780-compatible LCD device.
Provides high-level API to the Hitachi HD44780-compatible LCD device. Uses 4-bit mode by default (only uses 4 data pins) plus two control pins (R/S and EN). R/W pin is not used and should be wired for "write" (low-level, 0).
The implementation is completely stateless. Client is free to reuse the same Display
object
or to create one every time access to LCD is required.
Display
also implements core::fmt::Write
trait, so it could be used as a target of write!
macro.
This library does not depend on std
crate and could be used in bare metal embedded development.
Examples
use Write; // for write!
use *;
// implement HAL...
// implement `Hardware` trait to give access to LCD pins
// implement `Delay` trait to allow library to sleep for the given amount of time
// create HAL and LCD instances
let hw = HW ;
let mut lcd = new;
// initialization
lcd.init;
lcd.display;
lcd.entry_mode;
// print something
write!.unwrap;
See lcd-example-bluepill
for the working example
for the Blue Pill development board.
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.