Using an external code parsing library we discovered that there are
non-printable characters in some source files which break the parser.
This commit removes these characters and rewrites a type definition
which was also breaking the parser.
Signed-off-by: Mircea Bardac <mircea.bardac@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Signed-off-by: Stefan Andritoiu <stefan.andritoiu@intel.com>
Signed-off-by: Andrei Vasiliu <andrei.vasiliu@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This driver supports the Sparkfun 64x48 pixel OLED Edison block:
https://www.sparkfun.com/products/13035
It is based on an ssd1306, but with some modifications (custom COM pin
mapping and a custom column offset). It uses SPI to communicate, and
since it is an Edison Block, you don't really have any options for
different bus and pin assignments.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
We add a new bool isExpander to the the I2C constructor. This allows
us (in the case we are not dealing with an expander) to just
initialize the i2c context only and bail in the constructor. The
default is true to preserve backward compatibility.
Additionally, add two new virtual protected methods, data() and
command() for sending data or commands to the controller. The default
implementation in lcm1602 will work for 4bit GPIO and expander use.
In the case of jhd1313m1, they will need to be redefined in that class
as the sematics for sending data and commands are different.
All of the underlying functionality will use command() or data() as
appropriate.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This driver was developed with a Sainsmart LCD Keypad Shield.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
In addition, move the command/data sending methods into the protected
block so that derived classes can use them if need be.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit removes the I2C context from the LCD base class and moves
it into each of the drivers.
In addition, the createChar() virtual function was removed from the
base class, as it directly used the now non-existant i2c context, and
it would not work on anything other than hd44780 based controllers and
displays anyway. Also, it is likely the capability itself, as well as
the data required to implement it, is going to be different from
device to device.
createChar() has been added to the Lcm1602 driver which can support it.
While doing this work, the LCD base class m_name is now set appropriately
in the driver constructors.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
We keep the same upm module library name (i2clcd), and the header
documentation still specifies @library i2clcd.
These will need to be changed when the actual library is renamed.
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This keeps the constants in the correct scope and avoid potential
naming conflicts with other files.
Signed-off-by: Wouter van Verre <wouter.van.verre@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Rewrite the i2c module to be based around the MRAA C++ API,
since this makes resource management easier inside of the UPM
C++ classes.
i2clcd.{h,cxx}: remove the close() function. This now automatically gets
called when the object goes out of scope, inside the destructor.
examples/i2clcd: fix C++/Python/Javascript examples that explicitly called the close function.
The I2c context now gets called by the destructor of the sensor class. This
happens when the object goes out of scope or when it gets deleted, if the
object was created using the new keyword, as is the case here.
Signed-off-by: Wouter van Verre <wouter.van.verre@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
The writeChar function in the ssd13xx classes had an unused argument.
Signed-off-by: Wouter van Verre <wouter.van.verre@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Remove calls to I2C helper functions (i2Cmd, i2cData, i2cReg) and call
the raw MRAA function directly instead and remove the helper functions from the
I2CLcd class
Signed-off-by: Wouter van Verre <wouter.van.verre@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
The new values for the durations match the recommended values from the
datasheet more closely
Signed-off-by: Wouter van Verre <wouter.van.verre@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Added new, private, header file which contains macros used to check the
return value of mraa function calls
Signed-off-by: Wouter van Verre <wouter.van.verre@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Reformatted to prepare for improving the error handling. This reformatting
was done using clang-format.
Signed-off-by: Wouter van Verre <wouter.van.verre@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>