![]() |
Zap'Em Blast'Em Robots
robots that play laser tag!
|
Header file for I2C 20x4 LCD control functions. More...
#include "stm32f4xx_hal.h"
Go to the source code of this file.
Macros | |
#define | LCD_I2C_ADDR (0x27 << 1) |
Adjust to match your LCD I2C address (typically 0x27 or 0x3F) |
Functions | |
void | lcd_init (void) |
Initializes the LCD in 4-bit I2C mode. | |
void | lcd_clear (void) |
Clears the LCD display. | |
void | lcd_set_cursor (uint8_t row, uint8_t col) |
Sets the LCD cursor to a specific row and column. | |
void | lcd_print (char *str) |
Prints a null-terminated string to the LCD. | |
void | lcd_send_command (uint8_t cmd) |
Sends a command byte to the LCD. | |
void | lcd_send_data (uint8_t data) |
Sends a data byte (character) to the LCD. | |
void | lcd_force_backlight_on (void) |
Forces the LCD backlight to remain on. |
Variables | |
I2C_HandleTypeDef | hi2c1 |
External handle to use your I2C peripheral. |
Header file for I2C 20x4 LCD control functions.
Created on: May 22, 2025
void lcd_force_backlight_on | ( | void | ) |
Forces the LCD backlight to remain on.
Forces the LCD backlight to remain on.
void lcd_init | ( | void | ) |
Initializes the LCD in 4-bit I2C mode.
Initializes the LCD in 4-bit I2C mode.
void lcd_print | ( | char * | str | ) |
Prints a null-terminated string to the LCD.
str | Pointer to the string to print |
Prints a null-terminated string to the LCD.
str | Null-terminated character string |
void lcd_send_command | ( | uint8_t | cmd | ) |
Sends a command byte to the LCD.
cmd | Command to send |
cmd | Command byte |
void lcd_send_data | ( | uint8_t | data | ) |
Sends a data byte (character) to the LCD.
data | Character to display |
data | Data byte |
void lcd_set_cursor | ( | uint8_t | row, |
uint8_t | col ) |
Sets the LCD cursor to a specific row and column.
row | Row index (0–3) |
col | Column index (0–19) |
Sets the LCD cursor to a specific row and column.
row | Row index (0–3) |
col | Column index (0–19) |