-
Notifications
You must be signed in to change notification settings - Fork 0
/
lcd1602a.h
58 lines (43 loc) · 1.41 KB
/
lcd1602a.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
********************************************************************************
* @file lcd1602a.h
* @date Sep 17, 2024
* @brief LCD1602A-I2C driver
********************************************************************************
*/
#ifndef LCD1602A_I2C_DRIVER_H_
#define LCD1602A_I2C_DRIVER_H_
/************************************
* INCLUDES
************************************/
#include "stm32f4xx_hal.h"
/************************************
* MACROS AND DEFINES
************************************/
// DevAddress Target device address: The device 7 bits address value
#define LCD_DEVICE_ADDRESS (0x27) << 1
/************************************
* TYPEDEFS
************************************/
/*
* LCD STRUCT
*/
typedef struct {
/* I2C handle */
I2C_HandleTypeDef *i2cHandle;
} LCD1602A;
/************************************
* GLOBAL FUNCTION PROTOTYPES
************************************/
void LCD_Init(LCD1602A *lcd, I2C_HandleTypeDef *i2cHandle);
void LCD_ClearDisplay();
void LCD_WriteString(LCD1602A *lcd, char *string);
void LCD_SetBacklight(LCD1602A *lcd, uint8_t backlightState);
void LCD_SetCursor(LCD1602A *lcd, uint8_t row, uint8_t col);
void LCD_BlinkOn(LCD1602A *lcd);
void LCD_BlinkOff(LCD1602A *lcd);
void LCD_CursorOn(LCD1602A *lcd);
void LCD_CursorOff(LCD1602A *lcd);
void LCD_DisplayOn(LCD1602A *lcd);
void LCD_DisplayOff(LCD1602A *lcd);
#endif /* LCD1602A_I2C_DRIVER_H_ */