upm  1.3.0
Sensor/Actuator repository for libmraa (v1.7.0)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
lcdks.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  * The MIT License
15  *
16  * Permission is hereby granted, free of charge, to any person obtaining
17  * a copy of this software and associated documentation files (the
18  * "Software"), to deal in the Software without restriction, including
19  * without limitation the rights to use, copy, modify, merge, publish,
20  * distribute, sublicense, and/or sell copies of the Software, and to
21  * permit persons to whom the Software is furnished to do so, subject to
22  * the following conditions:
23  *
24  * The above copyright notice and this permission notice shall be
25  * included in all copies or substantial portions of the Software.
26  *
27  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
28  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
29  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
30  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
31  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
32  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
33  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34  */
35 
36 #pragma once
37 
38 #include <string>
39 #include <vector>
40 #include "lcdks.h"
41 
42 namespace upm
43 {
73  class LCDKS
74  {
75  public:
95  LCDKS(int rs=8, int enable=9,
96  int d0=4, int d1=5, int d2=6, int d3=7,
97  int keypad=0, int backlight=-1);
101  ~LCDKS();
102 
110  upm_result_t write(std::string msg);
111 
119  upm_result_t setCursor(int row, int column);
120 
126  upm_result_t clear();
127 
133  upm_result_t home();
134 
142  upm_result_t createChar(uint8_t charSlot,
143  std::vector<uint8_t> charData);
144 
150  upm_result_t displayOn();
151 
157  upm_result_t displayOff();
158 
164  upm_result_t cursorOn();
165 
171  upm_result_t cursorOff();
172 
178  upm_result_t cursorBlinkOn();
179 
185  upm_result_t cursorBlinkOff();
186 
192  upm_result_t backlightOn();
193 
199  upm_result_t backlightOff();
200 
206  upm_result_t scrollDisplayLeft();
207 
213  upm_result_t scrollDisplayRight();
214 
220  upm_result_t entryLeftToRight();
221 
227  upm_result_t entryRightToLeft();
228 
234  upm_result_t autoscrollOn();
235 
241  upm_result_t autoscrollOff();
242 
250  float getKeyValue();
251 
261  {
262  return getKeyValue();
263  }
264 
265 
266  protected:
267  lcdks_context m_lcdks;
268 
269  private:
270  /* Disable implicit copy and assignment operators */
271  LCDKS(const LCDKS&) = delete;
272  LCDKS &operator=(const LCDKS&) = delete;
273 
274  };
275 }
upm_result_t cursorOff()
Definition: lcdks.cxx:102
upm_result_t clear()
Definition: lcdks.cxx:70
upm_result_t write(std::string msg)
Definition: lcdks.cxx:60
upm_result_t cursorOn()
Definition: lcdks.cxx:97
upm_result_t backlightOn()
Definition: lcdks.cxx:117
~LCDKS()
Definition: lcdks.cxx:55
upm_result_t entryLeftToRight()
Definition: lcdks.cxx:137
upm_result_t autoscrollOn()
Definition: lcdks.cxx:147
float getRawKeyValue()
Definition: lcdks.hpp:260
float getKeyValue()
Definition: lcdks.cxx:157
Definition: lcdks.h:59
upm_result_t createChar(uint8_t charSlot, std::vector< uint8_t > charData)
Definition: lcdks.cxx:80
API for the generic LCD Keypad Shield.
Definition: lcdks.hpp:73
upm_result_t cursorBlinkOff()
Definition: lcdks.cxx:112
upm_result_t scrollDisplayLeft()
Definition: lcdks.cxx:127
upm_result_t entryRightToLeft()
Definition: lcdks.cxx:142
C API for the LCDKS (LCD Keypad Shield) display family.
upm_result_t setCursor(int row, int column)
Definition: lcdks.cxx:65
upm_result_t scrollDisplayRight()
Definition: lcdks.cxx:132
upm_result_t cursorBlinkOn()
Definition: lcdks.cxx:107
upm_result_t autoscrollOff()
Definition: lcdks.cxx:152
upm_result_t backlightOff()
Definition: lcdks.cxx:122
upm_result_t displayOn()
Definition: lcdks.cxx:87
upm_result_t displayOff()
Definition: lcdks.cxx:92
upm_result_t home()
Definition: lcdks.cxx:75
LCDKS(int rs=8, int enable=9, int d0=4, int d1=5, int d2=6, int d3=7, int keypad=0, int backlight=-1)
Definition: lcdks.cxx:44