upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
jhd1313m1.hpp
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 <vector>
38 #include "jhd1313m1.h"
39 
40 namespace upm
41 {
72  class Jhd1313m1
73  {
74  public:
82  Jhd1313m1(int bus, int lcdAddress = 0x3E, int rgbAddress = 0x62);
83 
87  ~Jhd1313m1();
88 
96  upm_result_t write(std::string msg);
97 
104  upm_result_t scroll(bool direction);
105 
115  upm_result_t setColor(uint8_t r, uint8_t g, uint8_t b);
116 
124  upm_result_t setCursor(int row, int column);
125 
131  upm_result_t clear();
132 
138  upm_result_t home();
139 
147  upm_result_t createChar(uint8_t charSlot,
148  std::vector<uint8_t> charData);
149 
155  upm_result_t displayOn();
156 
162  upm_result_t displayOff();
163 
169  upm_result_t cursorOn();
170 
176  upm_result_t cursorOff();
177 
183  upm_result_t cursorBlinkOn();
184 
190  upm_result_t cursorBlinkOff();
191 
197  upm_result_t backlightOn();
198 
204  upm_result_t backlightOff();
205 
211  upm_result_t scrollDisplayLeft();
212 
218  upm_result_t scrollDisplayRight();
219 
225  upm_result_t entryLeftToRight();
226 
232  upm_result_t entryRightToLeft();
233 
239  upm_result_t autoscrollOn();
240 
246  upm_result_t autoscrollOff();
247 
248 
249  protected:
250  jhd1313m1_context m_jhd1313m1;
251  upm_result_t command(uint8_t cmd);
252  upm_result_t data(uint8_t data);
253 
254  private:
255  /* Disable implicit copy and assignment operators */
256  Jhd1313m1(const Jhd1313m1&) = delete;
257  Jhd1313m1 &operator=(const Jhd1313m1&) = delete;
258  };
259 }
C API for the JHD1313M1 family of LCD displays, like the Grove RGB LCD.
upm_result_t cursorBlinkOn()
Definition: jhd1313m1.cxx:112
API for the JHD1313M1 I2C controller for HD44780-based displays with an RGB backlight, such as a Grove RGB I2C LCD display.
Definition: jhd1313m1.hpp:72
upm_result_t scrollDisplayRight()
Definition: jhd1313m1.cxx:137
upm_result_t cursorOff()
Definition: jhd1313m1.cxx:107
upm_result_t createChar(uint8_t charSlot, std::vector< uint8_t > charData)
Definition: jhd1313m1.cxx:85
upm_result_t displayOff()
Definition: jhd1313m1.cxx:97
C++ API wrapper for the bh1749 driver.
Definition: a110x.hpp:29
upm_result_t write(std::string msg)
Definition: jhd1313m1.cxx:55
upm_result_t backlightOff()
Definition: jhd1313m1.cxx:127
upm_result_t backlightOn()
Definition: jhd1313m1.cxx:122
upm_result_t setCursor(int row, int column)
Definition: jhd1313m1.cxx:60
upm_result_t autoscrollOn()
Definition: jhd1313m1.cxx:152
upm_result_t entryRightToLeft()
Definition: jhd1313m1.cxx:147
~Jhd1313m1()
Definition: jhd1313m1.cxx:50
upm_result_t cursorOn()
Definition: jhd1313m1.cxx:102
upm_result_t home()
Definition: jhd1313m1.cxx:80
upm_result_t scroll(bool direction)
Definition: jhd1313m1.cxx:65
Jhd1313m1(int bus, int lcdAddress=0x3E, int rgbAddress=0x62)
Definition: jhd1313m1.cxx:42
upm_result_t setColor(uint8_t r, uint8_t g, uint8_t b)
Definition: jhd1313m1.cxx:70
upm_result_t autoscrollOff()
Definition: jhd1313m1.cxx:157
Definition: jhd1313m1.h:55
upm_result_t cursorBlinkOff()
Definition: jhd1313m1.cxx:117
upm_result_t scrollDisplayLeft()
Definition: jhd1313m1.cxx:132
upm_result_t clear()
Definition: jhd1313m1.cxx:75
upm_result_t entryLeftToRight()
Definition: jhd1313m1.cxx:142
upm_result_t displayOn()
Definition: jhd1313m1.cxx:92