forked from marcmerlin/NewLiquidCrystal
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLiquidCrystal_SR_LCD3.h
94 lines (75 loc) · 3.04 KB
/
LiquidCrystal_SR_LCD3.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
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
87
88
89
90
91
92
93
// ---------------------------------------------------------------------------
// Created by Francisco Malpartida on 20/08/11.
// Copyright 2011 - Under creative commons license 3.0:
// Attribution-ShareAlike CC BY-SA
//
// This module is by Marc MERLIN <marc_soft<at>merlins.org>
// See .cpp file for hardware details.
// ---------------------------------------------------------------------------
#ifndef _LIQUIDCRYSTAL_SR_LCD3_
#define _LIQUIDCRYSTAL_SR_LCD3_
#include <inttypes.h>
#include <LCD.h>
class LiquidCrystal_SR_LCD3 : public LCD
{
public:
/*!
@method
@abstract LCD SHIFT REGISTER constructors.
@discussion Defines the pin assignment that the LCD will have.
The constructor does not initialize the LCD. Assuming 1 line 8 pixel high
font.
@param srdata[in] pin for shiftregister data line.
@param srclock[in] pin for shiftregister clock line.
@param enable[in] enable pin for the shiftregister (also called strobe).
*/
LiquidCrystal_SR_LCD3 ( uint8_t srdata, uint8_t srclock, uint8_t enable );
// Set nr. of lines, assume 8 pixel high font
LiquidCrystal_SR_LCD3 ( uint8_t srdata, uint8_t srclock, uint8_t enable,
uint8_t lines );
// Set nr. of lines and font
LiquidCrystal_SR_LCD3( uint8_t srdata, uint8_t srclock, uint8_t enable,
uint8_t lines, uint8_t font );
/*!
@function
@abstract LCD initialization.
@discussion Initializes the LCD to a given size (col, row). This methods
initializes the LCD, therefore, it MUST be called prior to using any other
method from this class or parent class.
@param cols[in] the number of columns that the display has
@param rows[in] the number of rows that the display has
@param charsize[in] size of the characters of the LCD: LCD_5x8DOTS or
LCD_5x10DOTS.
*/
virtual void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS);
/*!
@function
@abstract Send a particular value to the LCD.
@discussion Sends a particular value to the LCD for writing to the LCD or
as an LCD command using the shift register.
Users should never call this method.
@param value[in] Value to send to the LCD.
@result mode LOW - write to the LCD CGRAM, HIGH - write a command to
the LCD.
*/
virtual void send(uint8_t value, uint8_t mode);
private:
/*!
@method
@abstract Initializes the LCD pin allocation
@discussion Initializes the LCD pin allocation and configuration.
*/
void init ( uint8_t srdata, uint8_t srclock, uint8_t enable, uint8_t lines,
uint8_t font );
/*!
@method
@abstract For sending data when initializing the display to 4-bit
@discussion Initializes the LCD pin allocation and configuration.
*/
void write4bits ( uint8_t );
void _pushOut ( uint8_t );
uint8_t _srdata_pin; // Serial Data pin
uint8_t _srclock_pin; // Clock Pin
uint8_t _strobe_pin; // Enable Pin
};
#endif