upm  1.1.0
Sensor/Actuator repository for libmraa (v1.5.1)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
lcm1602.hxx
1 /*
2  * Author: Jon Trulson <jtrulson@ics.com>
3  * Copyright (c) 2016 Intel Corporation.
4  *
5  * Based on UPM C++ drivers originally developed by:
6  * Author: Daniel Mosquera
7  * Copyright (c) 2013 Daniel Mosquera
8  *
9  * Author: Thomas Ingleby <thomas.c.ingleby@intel.com>
10  * Copyright (c) 2014 Intel Corporation.
11  *
12  * Contributions: Sergey Kiselev <sergey.kiselev@intel.com>
13  *
14  * Permission is hereby granted, free of charge, to any person obtaining
15  * a copy of this software and associated documentation files (the
16  * "Software"), to deal in the Software without restriction, including
17  * without limitation the rights to use, copy, modify, merge, publish,
18  * distribute, sublicense, and/or sell copies of the Software, and to
19  * permit persons to whom the Software is furnished to do so, subject to
20  * the following conditions:
21  *
22  * The above copyright notice and this permission notice shall be
23  * included in all copies or substantial portions of the Software.
24  *
25  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
29  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
30  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
31  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32  */
33 
34 #pragma once
35 
36 #include <string>
37 #include "lcm1602.h"
38 
39 namespace upm
40 {
72  class Lcm1602
73  {
74  public:
85  Lcm1602(int bus = 0, int address = 0x27, bool isExpander=true,
86  uint8_t numColumns = 16, uint8_t numRows = 2);
87 
102  Lcm1602(int rs, int enable,
103  int d0, int d1, int d2, int d3,
104  uint8_t numColumns = 16, uint8_t numRows = 2);
105 
109  ~Lcm1602();
110 
118  upm_result_t write(std::string msg);
119 
127  upm_result_t setCursor(int row, int column);
128 
134  upm_result_t clear();
135 
141  upm_result_t home();
142 
150  upm_result_t createChar(uint8_t charSlot,
151  lcm1602_custom_char_t charData);
152 
158  upm_result_t displayOn();
159 
165  upm_result_t displayOff();
166 
172  upm_result_t cursorOn();
173 
179  upm_result_t cursorOff();
180 
186  upm_result_t cursorBlinkOn();
187 
193  upm_result_t cursorBlinkOff();
194 
200  upm_result_t backlightOn();
201 
207  upm_result_t backlightOff();
208 
214  upm_result_t scrollDisplayLeft();
215 
221  upm_result_t scrollDisplayRight();
222 
228  upm_result_t entryLeftToRight();
229 
235  upm_result_t entryRightToLeft();
236 
242  upm_result_t autoscrollOn();
243 
249  upm_result_t autoscrollOff();
250 
251 
252  protected:
253  lcm1602_context m_lcm1602;
254  upm_result_t command(uint8_t cmd);
255  upm_result_t data(uint8_t data);
256 
257  private:
258  };
259 }
Definition: lcm1602.h:59
~Lcm1602()
Definition: lcm1602.cxx:167
mraa::Result home()
Definition: lcm1602.cxx:266
mraa::Result scrollDisplayRight()
Definition: lcm1602.cxx:342
mraa::Result autoscrollOff()
Definition: lcm1602.cxx:365
mraa::Result backlightOn()
Definition: lcm1602.cxx:325
mraa::Result cursorOn()
Definition: lcm1602.cxx:301
mraa::Result displayOff()
Definition: lcm1602.cxx:295
mraa::Result cursorBlinkOn()
Definition: lcm1602.cxx:313
mraa::Result scrollDisplayLeft()
Definition: lcm1602.cxx:337
mraa::Result displayOn()
Definition: lcm1602.cxx:289
mraa::Result write(std::string msg)
Definition: lcm1602.cxx:192
mraa::Result createChar(uint8_t charSlot, uint8_t charData[])
Definition: lcm1602.cxx:275
Lcm1602(int bus=0, int address=0x27, bool isExpander=true, uint8_t numColumns=16, uint8_t numRows=2)
Definition: lcm1602.cxx:43
mraa::Result entryLeftToRight()
Definition: lcm1602.cxx:347
mraa::Result backlightOff()
Definition: lcm1602.cxx:331
mraa::Result cursorBlinkOff()
Definition: lcm1602.cxx:319
char lcm1602_custom_char_t[8]
Definition: lcm1602.h:87
mraa::Result entryRightToLeft()
Definition: lcm1602.cxx:353
mraa::Result setCursor(int row, int column)
Definition: lcm1602.cxx:202
mraa::Result autoscrollOn()
Definition: lcm1602.cxx:359
C API for the LCM1602 family of LCD displays.
mraa::Result clear()
Definition: lcm1602.cxx:257
mraa::Result cursorOff()
Definition: lcm1602.cxx:307