Coder Social home page Coder Social logo

stm32-lcd_pcd8544's Introduction

STM32-LCD_PCD8544

Configure your MCU using STM32CubeMX.

SPI baud rate has to be 4 MBits/s. Adjust it using the Prescaler depending on you MCU base frequency.

figure1

Add 3 GPIO_Outputs for CE, DC, and RST pins of the LCD. It is convenient to locate them close to each other.

figure2

Suitable for (tested on) the very popular cheap Chinese boards STM32F103C8T6 "Blue Pill", STM32FxCxT6 Board v5.02, and STM32F407VET6 - STM32 F4VE V2.0.

Example of usage:


#include "lcd_pcd8544.h"

...

  // LCD
  extern LCD_PCD8544_screen_t gLcdScreen;

  // LCD - assign SPI interface and pins
  gLcdScreen.mPinout.mSpiHandle = &hspi3;
  gLcdScreen.mPinout.mLcdSpiRstPort = LCD_RST_GPIO_Port;
  gLcdScreen.mPinout.mLcdSpiRstPin = LCD_RST_Pin;
  gLcdScreen.mPinout.mLcdSpiCePort = LCD_CE_GPIO_Port;
  gLcdScreen.mPinout.mLcdSpiCePin = LCD_CE_Pin;
  gLcdScreen.mPinout.mLcdSpiDcPort = LCD_DC_GPIO_Port;
  gLcdScreen.mPinout.mLcdSpiDcPin = LCD_DC_Pin;
  gLcdScreen.mPinout.mLcdSpiDinPort = LCD_SPI_DIN_GPIO_Port;
  gLcdScreen.mPinout.mLcdSpiDinPin = LCD_SPI_DIN_Pin;
  gLcdScreen.mPinout.mLcdSpiClkPort = LCD_SPI_CLK_GPIO_Port;
  gLcdScreen.mPinout.mLcdSpiClkPin = LCD_SPI_CLK_Pin;
  gLcdScreen.mPinout.mLcdErrorLedPort = LCD_ERROR_LED_GPIO_Port;
  gLcdScreen.mPinout.mLcdErrorLedPin = LCD_ERROR_LED_Pin;

  // LCD - initialize
  LCD_PCD8544_init(&gLcdScreen);

  // LCD - welcome screen
  LCD_PCD8544_write_line(&gLcdScreen, 0, "Privet!");
  HAL_Delay(1000);
  
...

stm32-lcd_pcd8544's People

Contributors

evovch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mcg82

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.