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
jhd1313m1.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 "jhd1313m1.h"
38 
39 namespace upm
40 {
71  class Jhd1313m1
72  {
73  public:
81  Jhd1313m1(int bus, int lcdAddress = 0x3E, int rgbAddress = 0x62);
82 
86  ~Jhd1313m1();
87 
95  upm_result_t write(std::string msg);
96 
103  upm_result_t scroll(bool direction);
104 
114  upm_result_t setColor(uint8_t r, uint8_t g, uint8_t b);
115 
123  upm_result_t setCursor(int row, int column);
124 
130  upm_result_t clear();
131 
137  upm_result_t home();
138 
146  upm_result_t createChar(uint8_t charSlot,
147  jhd1313m1_custom_char_t charData);
148 
154  upm_result_t displayOn();
155 
161  upm_result_t displayOff();
162 
168  upm_result_t cursorOn();
169 
175  upm_result_t cursorOff();
176 
182  upm_result_t cursorBlinkOn();
183 
189  upm_result_t cursorBlinkOff();
190 
196  upm_result_t backlightOn();
197 
203  upm_result_t backlightOff();
204 
210  upm_result_t scrollDisplayLeft();
211 
217  upm_result_t scrollDisplayRight();
218 
224  upm_result_t entryLeftToRight();
225 
231  upm_result_t entryRightToLeft();
232 
238  upm_result_t autoscrollOn();
239 
245  upm_result_t autoscrollOff();
246 
247 
248  protected:
249  jhd1313m1_context m_jhd1313m1;
250  upm_result_t command(uint8_t cmd);
251  upm_result_t data(uint8_t data);
252 
253  private:
254  };
255 }
C API for the JHD1313M1 family of LCD displays, like the Grove RGB LCD.
upm_result_t cursorBlinkOn()
Definition: jhd1313m1.cxx:111
API for the JHD1313M1 I2C controller for HD44780-based displays with an RGB backlight, such as a Grove RGB I2C LCD display.
Definition: jhd1313m1.hxx:71
upm_result_t scrollDisplayRight()
Definition: jhd1313m1.cxx:136
upm_result_t cursorOff()
Definition: jhd1313m1.cxx:106
upm_result_t displayOff()
Definition: jhd1313m1.cxx:96
upm_result_t createChar(uint8_t charSlot, jhd1313m1_custom_char_t charData)
Definition: jhd1313m1.cxx:85
upm_result_t write(std::string msg)
Definition: jhd1313m1.cxx:55
upm_result_t setCursor(int row, int column)
Definition: jhd1313m1.cxx:60
upm_result_t autoscrollOn()
Definition: jhd1313m1.cxx:151
upm_result_t backlightOn()
Definition: jhd1313m1.cxx:121
upm_result_t backlightOff()
Definition: jhd1313m1.cxx:126
upm_result_t entryRightToLeft()
Definition: jhd1313m1.cxx:146
upm_result_t setColor(uint8_t r, uint8_t g, uint8_t b)
Definition: jhd1313m1.cxx:70
~Jhd1313m1()
Definition: jhd1313m1.cxx:50
upm_result_t cursorOn()
Definition: jhd1313m1.cxx:101
upm_result_t scroll(bool direction)
Definition: jhd1313m1.cxx:65
upm_result_t home()
Definition: jhd1313m1.cxx:80
Jhd1313m1(int bus, int lcdAddress=0x3E, int rgbAddress=0x62)
Definition: jhd1313m1.cxx:42
upm_result_t autoscrollOff()
Definition: jhd1313m1.cxx:156
Definition: jhd1313m1.h:55
upm_result_t cursorBlinkOff()
Definition: jhd1313m1.cxx:116
upm_result_t scrollDisplayLeft()
Definition: jhd1313m1.cxx:131
upm_result_t clear()
Definition: jhd1313m1.cxx:75
upm_result_t entryLeftToRight()
Definition: jhd1313m1.cxx:141
upm_result_t displayOn()
Definition: jhd1313m1.cxx:91
char jhd1313m1_custom_char_t[8]
Definition: jhd1313m1.h:69