-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathBeagle_GPIO_HD44780.hh
86 lines (67 loc) · 2.06 KB
/
Beagle_GPIO_HD44780.hh
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/******************************
** Beagle Bone GPIO Library **
** **
** Francois Sugny **
** 01/07/12 **
** **
** v1.0 **
******************************/
//=======================================================
//=======================================================
#ifndef beagle_gpio_hd44780_hh
#define beagle_gpio_hd44780_hh
//=======================================================
//=======================================================
#include "Beagle_GPIO.hh"
//=======================================================
//=======================================================
class Beagle_GPIO_HD44780
{
public:
Beagle_GPIO_HD44780(
Beagle_GPIO * gpio,
unsigned short _pin_E,
unsigned short _pin_RS,
unsigned short _pin_DB4,
unsigned short _pin_DB5,
unsigned short _pin_DB6,
unsigned short _pin_DB7 );
~Beagle_GPIO_HD44780();
// Initialize Screen
void initScreen();
// Clear Screen
void clearScreen();
// Write a string to screen
void write( const char * _string );
// Move to a specific position on screen
void goToPosition( unsigned char _x, unsigned char _y );
// Turn cursor on/off and blink/solid
void setCursor( bool enable, bool blink);
private:
// Pulse pin E
void pulsePinE();
// Write data to the pins
void writeToPins( unsigned char _E,
unsigned char _RS,
unsigned char _DB4,
unsigned char _DB5,
unsigned char _DB6,
unsigned char _DB7 );
// Write a character to screen
void sendChar( char _c );
// Send a command to screen
void sendCommand( char _c );
private:
Beagle_GPIO * m_gpio;
unsigned short m_pin_E;
unsigned short m_pin_RS;
unsigned short m_pin_DB4;
unsigned short m_pin_DB5;
unsigned short m_pin_DB6;
unsigned short m_pin_DB7;
};
//=======================================================
//=======================================================
#endif
//=======================================================
//=======================================================