1
0
Fork 0
mirror of https://github.com/RobotechLille/cdf2018-principal synced 2024-09-29 00:33:04 +02:00
cdf2018-principal/chef/src/lcd.h

36 lines
686 B
C
Raw Normal View History

2018-04-29 21:57:29 +02:00
#ifndef __LCD_H_
#define __LCD_H_
#include "stdint.h"
2018-04-30 16:15:47 +02:00
#include "i2c.h"
2018-04-29 21:57:29 +02:00
#define LCD_ADDR 0x27
#define LCD_MODE_CHR 1
#define LCD_MODE_CMD 0
#define LCD_LINE_1 0x80 // 1st line
#define LCD_LINE_2 0xC0 // 2nd line
#define LCD_BACKLIGHT_ON 0x08
#define LCD_BACKLIGHT_OFF 0x08
#define LCD_BACKLIGHT LCD_BACKLIGHT_ON
#define LCD_MASK_ENABLE 0x04 // Enable bit
// Public
void initLCD();
void clearLCD();
void gotoLCD(uint8_t line);
void charLCD(char c);
void printLCD(char* s);
2018-04-30 16:15:47 +02:00
// Not necessary, but should be used when different threads use the display
void lockLCD();
void unlockLCD();
2018-04-29 21:57:29 +02:00
// Private
void sendLCD(uint8_t bits, uint8_t mode);
void toggleEnableLCD(uint8_t bits);
#endif