All Projects → JohnDoneth → hd44780-driver

JohnDoneth / hd44780-driver

Licence: MIT License
Implementation of the embedded-hal traits for the HD44780.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to hd44780-driver

vrEmuLcd
Character LCD emulator library (C99 engine, web front-end).
Stars: ✭ 45 (+114.29%)
Mutual labels:  hd44780, lcd-display
atat
no_std crate for parsing AT commands
Stars: ✭ 50 (+138.1%)
Mutual labels:  embedded-hal-driver
S51 UTF 8 FontLibrary
UTF-8 font dot matrix data is saved through external FLASH
Stars: ✭ 30 (+42.86%)
Mutual labels:  lcd-display
r3
R3-OS — Experimental static (μITRON-esque) RTOS for deeply embedded systems, testing the limit of Rust's const eval and generics
Stars: ✭ 87 (+314.29%)
Mutual labels:  embedded-rust
JBC SolderingStation
JBC_SolderingStation
Stars: ✭ 63 (+200%)
Mutual labels:  lcd-display
luma.emulator
Provides a series of pseudo-display devices which allow the luma.core components to be used without running a physical device.
Stars: ✭ 32 (+52.38%)
Mutual labels:  lcd-display
pwm-pca9685-rs
Platform-agnostic Rust driver for the PCA9685 I2C 16-channel, 12-bit PWM/Servo/LED controller
Stars: ✭ 19 (-9.52%)
Mutual labels:  embedded-hal-driver
shared-bus
Crate for sharing buses between multiple devices
Stars: ✭ 67 (+219.05%)
Mutual labels:  embedded-rust
stm32f7xx-hal
A Rust embedded-hal HAL for all MCUs in the STM32 F7 family
Stars: ✭ 71 (+238.1%)
Mutual labels:  embedded-rust
Nokia-LCD5110-HAL
Nokia LCD 5110 library to use with HAL GPIO on STM32 devices
Stars: ✭ 38 (+80.95%)
Mutual labels:  lcd-display
U8glib-HAL
Customized U8glib for use in Marlin 2.0
Stars: ✭ 40 (+90.48%)
Mutual labels:  lcd-display
stm32-rustup
A guide to rust your stm32 microcontroller
Stars: ✭ 25 (+19.05%)
Mutual labels:  embedded-rust
qnapdisplay
Qnap lcd python module, features both writing to the display as wel as reading keypresses from the panel keys. It was developed on a Qnap TS-459 and a TS-453A, it works on some other models as well.
Stars: ✭ 37 (+76.19%)
Mutual labels:  lcd-display
picoLCD
Example code for interfacing with a LCD with a Raspberry Pi Pico
Stars: ✭ 25 (+19.05%)
Mutual labels:  lcd-display
embedded-ccs811-rs
Platform agnostic Rust driver for the CCS811 ultra-low power digital gas sensor for monitoring indoor air quality
Stars: ✭ 12 (-42.86%)
Mutual labels:  embedded-hal-driver
OpenLCD
An open source serial LCD (HD44780) controller based on the ATmega328.
Stars: ✭ 28 (+33.33%)
Mutual labels:  lcd-display
psila
Work in progress Zigbee stack in Rust
Stars: ✭ 20 (-4.76%)
Mutual labels:  embedded-rust
arduino
Arduino experiments
Stars: ✭ 20 (-4.76%)
Mutual labels:  lcd-display
app-template
Quickly set up a `probe-run` + `defmt` + `flip-link` embedded project
Stars: ✭ 171 (+714.29%)
Mutual labels:  embedded-rust
LiquidCrystal I2C
This is an Arduino library for HD44780 LCD display, operated in 4 bit mode over I2C bus with 8-bit I/O expander PCF8574
Stars: ✭ 20 (-4.76%)
Mutual labels:  hd44780

hd44780-driver

crates.io crates.io travis-ci.org Rust API

Implementation of the embedded-hal traits for the HD44780.

Examples

Examples for several different boards can be found here

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>.

// Pseudo-code: check the HAL crate for your specific device for exact code to get pins / delay
// It is recommended to use push/pull output pins, but if your specific LCD device has pull-up resistors
// an open/drain output pin should work too

let mut delay = Delay::new();

let mut lcd = HD44780::new_4bit(
    d4.into_push_pull_output(&mut port), // Register Select pin
    d3.into_push_pull_output(&mut port), // Enable pin

    d9.into_push_pull_output(&mut port),  // d4
    d10.into_push_pull_output(&mut port), // d5
    d11.into_push_pull_output(&mut port), // d6
    d12.into_push_pull_output(&mut port), // d7
    &mut delay,
);

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

// Clear existing characters
lcd.clear(&mut delay); 

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

// Move the cursor to the second line
lcd.set_cursor_pos(40, &mut delay);

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

Async API

The async API is similar to the sync API. The the major differences are that:

  • The async API requires the async feature to use.
  • The async API requires the nightly compiler because of use of unstable features.
  • The async API uses embassy-traits rather than embedded-hal traits.

Embassy provides some implementations of these traits for some MCUs, and provides an executor that can execute futures. However, projects implementing embassy-traits, including this project, can run on any executor with any driver, provided such executor and driver also implement embassy-traits.

use hd44780_driver::non_blocking::HD44780;

let mut delay = embassy::time::Delay::new();
pin_mut!(delay);

let mut display = HD44780::new_4bit(
    rs,
    en,
    d4,
    d5,
    d6,
    d7,
    delay.as_mut(),
)
.await
.unwrap();

display.clear(delay.as_mut()).await;
display.write_str(msg, delay.as_mut()).await;

Features

  • 4-bit & 8-bit modes are supported
  • Support for i2c backpacks
  • Non-blocking API

Todo

  • Busy flag support
  • 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)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].