-
Notifications
You must be signed in to change notification settings - Fork 0
/
lcdLib.h
39 lines (31 loc) · 944 Bytes
/
lcdLib.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
/*
* lcdLib.h
*
* Created on: Apr 15, 2013
* Author: Luiz
*/
#ifndef SIMON_SAYS_LCDLIB_H_
#define SIMON_SAYS_LCDLIB_H_
#include <msp430g2553.h>
#include <string.h>
// Delay Functions
#define _delayMs(x) __delay_cycles((long) x* 1000)
#define _delayUs(x) __delay_cycles((long) x)
// Pins
#define EN BIT4
#define RS BIT5
#define DATA 0x0F
// Commands
#define CLEAR 0x01
// Line Buffers
extern char lcdBuffer[32];
// Functions
void lcdTriggerEN(); // Trigger Enable
void lcdWriteData(unsigned char data); // Send Data (Characters)
void lcdWriteCmd(unsigned char cmd); // Send Commands
void lcdGo(unsigned char x, unsigned char y); // Go to location on screen
void lcdInit(); // Initialize LCD
void lcdSetText(char * text, int x, int y); // Write to line buffer
void lcdUpdate(); // Sends Line 1 and 2 to LCD
char* iToS(int val); // Convert integer to string
#endif /* SIMON_SAYS_LCDLIB_H_ */