1
0
Fork 0
mirror of https://github.com/RobotechLille/cdf2018-principal synced 2024-05-21 14:16:22 +02:00
cdf2018-principal/chef/src/lcd.h
2018-04-30 16:15:47 +02:00

36 lines
686 B
C

#ifndef __LCD_H_
#define __LCD_H_
#include "stdint.h"
#include "i2c.h"
#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);
// Not necessary, but should be used when different threads use the display
void lockLCD();
void unlockLCD();
// Private
void sendLCD(uint8_t bits, uint8_t mode);
void toggleEnableLCD(uint8_t bits);
#endif