MCPcopy Index your code
hub / github.com/JohnDoneth/hd44780-driver

github.com/JohnDoneth/hd44780-driver @v0.3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.3.0 ↗ · + Follow
54 symbols 104 edges 12 files 17 documented · 31% updated 17mo ago★ 5012 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

hd44780-driver

crates.io crates.io crates.io travis-ci.org

Implementation of the embedded-hal traits for the HD44780.

Documentation

Crates.io - https://docs.rs/hd44780-driver

Examples

Currently there are basic examples for Raspberry Pi as well as the Adafruit Metro Express M0 as those are the devices I currently have on hand.

Any platform that implements the embedded-hal traits is supported by this library! See awesome-embedded-rust for a list of supported platforms.

Getting Started

This library aims to keep it simple in that to get started all you will have to do is supply the HD44780::new function a bunch of pins from your platform that implement the OutputPin trait for embedded-hal as well as a struct that implements the delay traits DelayUs<u16> and DelayMs<u8>.

// Code grabbed from the metro_m0 example
let mut lcd = HD44780::new_4bit(
    pins.d4.into_open_drain_output(&mut pins.port), // Register Select pin
    pins.d3.into_open_drain_output(&mut pins.port), // Enable pin

    pins.d9.into_open_drain_output(&mut pins.port),  // d4
    pins.d10.into_open_drain_output(&mut pins.port), // d5
    pins.d11.into_open_drain_output(&mut pins.port), // d6
    pins.d12.into_open_drain_output(&mut pins.port), // d7

    delay,
);

// Unshift display and set cursor to 0
lcd.reset(); 

// Clear existing characters
lcd.clear(); 

// Display the following string
lcd.write_str("Hello, world!");

// Move the cursor to the second line
lcd.set_cursor_pos(40);

// Display the following string on the second line
lcd.write_str("I'm on line 2!");

Features

  • 4-bit & 8-bit modes are supported

Todo

  • Busy flag support (Waiting for support from embedded-hal to read and write from a pin)
  • Non-blocking API
  • A more user-friendly API with additional features
  • Custom characters

Contributing

  • Additional issues as well as pull-requests are welcome.

  • If you have a platform not yet covered in this repository that is supported by embedded-hal, a pull-request of an example would be awesome!

License

This project is licensed under MIT license (LICENSE or https://opensource.org/licenses/MIT)

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 30
Function 12
Enum 6
Class 5
Interface 1

Languages

Rust100%

Modules by API surface

src/lib.rs23 symbols
src/entry_mode.rs8 symbols
src/display_mode.rs6 symbols
src/bus/fourbit.rs5 symbols
src/bus/eightbit.rs4 symbols
examples/metro_m0/examples/scrolling.rs2 symbols
src/bus/mod.rs1 symbols
examples/stm32f30x/src/main.rs1 symbols
examples/stm32f30x/build.rs1 symbols
examples/raspberrypi/src/main.rs1 symbols
examples/metro_m0/examples/basic.rs1 symbols
examples/metro_m0/examples/4bit.rs1 symbols

For agents

$ claude mcp add hd44780-driver \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page