#embedded #display #lcd #embedded-hal-driver #pcd8544

no-std pcd8544

Implementation to communicate and write to PCD8544 using embedded_hal as abstraction layer. WIP

9 releases

0.1.8 Jul 16, 2018
0.1.7 Jul 16, 2018
0.1.4 Jun 8, 2018
0.1.3 Mar 18, 2018
0.1.2 Feb 18, 2018

#12 in #lcd

Download history 1/week @ 2020-01-25 10/week @ 2020-02-08 36/week @ 2020-02-22 27/week @ 2020-03-07 27/week @ 2020-03-14 45/week @ 2020-03-21 10/week @ 2020-03-28 10/week @ 2020-04-04 54/week @ 2020-04-11 2/week @ 2020-04-18 1/week @ 2020-04-25 1/week @ 2020-05-09

73 downloads per month

MIT license

115KB
319 lines

How to use

Below is an example how to create a new PCD8544 instance, initialize and write "Hello World" onto it.

fn main() -> ! {
    let mut cp: cortex_m::Peripherals = cortex_m::Peripherals::take().unwrap();
    let mut peripherals = stm32f103xx::Peripherals::take().unwrap();
    let mut rcc = peripherals.RCC.constrain();
    
    let mut gpioa = peripherals.GPIOA.split(&mut rcc.apb2);
    let mut gpiob = peripherals.GPIOB.split(&mut rcc.apb2);
    
    let mut pcd_gnd   = gpiob.pb12.into_push_pull_output(&mut gpiob.crh);
    let mut pcd_light = gpiob.pb13.into_push_pull_output(&mut gpiob.crh);
    let mut pcd_vcc   = gpiob.pb14.into_push_pull_output(&mut gpiob.crh);
    let mut pcd_clk   = gpiob.pb15.into_push_pull_output(&mut gpiob.crh);
    let mut pcd_din   = gpioa.pa8 .into_push_pull_output(&mut gpioa.crh);
    let mut pcd_dc    = gpioa.pa9 .into_push_pull_output(&mut gpioa.crh);
    let mut pcd_ce    = gpioa.pa10.into_push_pull_output(&mut gpioa.crh);
    let mut pcd_rst   = gpioa.pa11.into_push_pull_output(&mut gpioa.crh);


    pcd_gnd  .set_low();
    pcd_light.set_high();
    pcd_vcc  .set_high();

    let mut display = PCD8544::new(
        &mut pcd_clk,
        &mut pcd_din,
        &mut pcd_dc,
        &mut pcd_ce,
        &mut pcd_rst,
        &mut pcd_light,
    );

    display.reset();
    writeln!(display, "Hello World");
    
    loop {}
}

The code from the example is copy&pasted from a working project, but not tested in this specific combination.

In action

The picture below shows the display to display the temperature from the onewire ds18b20 sensor.

Dependencies