Giter Site home page Giter Site logo

pcf8574t_lcd_driver's Introduction

PCF8574T I2c LCD Library.

How To Use

  1. Defines I2C write function and delay function.
  2. Call PCF8574T_Init by specifying the above function as an argument.
  3. Put string

Reference

PCF8574T_Init

initialize LCD.

void PCF8574T_Init(uint8_t i2c_addr, Delay_Func delay_func, I2C_Write_Func i2c_func);
param description
i2c_addr PCF8574T address. normally 0x27
delay_func delay function ptr
i2c_func i2c write function ptr
// I2c Write Function
typedef void (*I2C_Write_Func)(uint8_t addr, uint8_t *send_data, uint8_t send_data_len);
// Delay Function
typedef void (*Delay_Func)(uint16_t delay_time_ms);

PCF8574T_displayString

put string to display.
The string must be ended by \0 (null).

void PCF8574T_displayString(char *string, uint8_t line);
param description
string string to display
line line number (1 or 2)

PCF8574T_sendCommand8bit

send custom command.

void PCF8574T_sendCommand8bit(uint8_t command, bool is_control_data);
param description
command command to send
is_control_data true:command is control data. / false: comman is diaplay data

Example (stm32 HAL)

#include "PCF8574T_LCD_Driver.h"

void stm_i2c_write(uint8_t addr, uint8_t *send_data, uint8_t send_data_len)
{
    HAL_I2C_Master_Transmit(&hi2c1, addr<<1, send_data, send_data_len, 1000);
}
void stm_delay(uint16_t delay_ms)
{
    HAL_Delay(delay_ms);
}

int main(void)
{
    PCF8574T_Init(0x27, stm_delay, stm_i2c_write);
    char outString[] = "sample string";
    PCF8574T_displayString(outString, 1);
}

pcf8574t_lcd_driver's People

Contributors

toripoyo avatar

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.