From 3cfea676e2e2a1b8d51f2548c543b2fef2814423 Mon Sep 17 00:00:00 2001 From: Noel Eck Date: Tue, 23 Jan 2018 14:02:48 -0800 Subject: [PATCH] lcd: Renamed 'i2clcd' library to 'lcd' All other upm library directories match their corresponding library name, the i2clcd was an outlier which caused problems for CMake and testing. * Replaced usage of i2clcd with lcd * Renamed source files and examples * Updated examples to use correct class * Updated documentation where necessary (left changelog sections) Signed-off-by: Noel Eck --- README.md | 2 +- docs/apichanges.md | 4 ++-- docs/building.md | 16 ++++++++-------- doxy/samples.mapping.txt | 4 ++-- examples/CMakeLists.txt | 2 +- .../c++/{i2clcd-eboled.cxx => lcd-eboled.cxx} | 0 ...lcd-ssd1306-oled.cxx => lcd-ssd1306-oled.cxx} | 0 ...lcd-ssd1308-oled.cxx => lcd-ssd1308-oled.cxx} | 0 ...lcd-ssd1327-oled.cxx => lcd-ssd1327-oled.cxx} | 0 examples/java/CMakeLists.txt | 4 ++-- ...D_EBOLEDSample.java => LCD_EBOLEDSample.java} | 4 ++-- ...SSD1306Sample.java => LCD_SSD1306Sample.java} | 4 ++-- examples/java/SSD1308_oledSample.java | 2 +- examples/java/SSD1327_oledSample.java | 2 +- examples/javascript/eboled.js | 2 +- examples/javascript/oled_ssd1306.js | 4 ++-- examples/javascript/oled_ssd1308.js | 4 ++-- examples/javascript/oled_ssd1327.js | 4 ++-- examples/python/eboled.py | 2 +- examples/python/oled_ssd1308.py | 4 ++-- examples/python/oled_ssd1327.py | 4 ++-- src/lcd/CMakeLists.txt | 2 +- src/lcd/eboled.hpp | 4 ++-- src/lcd/{javaupm_i2clcd.i => javaupm_lcd.i} | 2 +- src/lcd/{jsupm_i2clcd.i => jsupm_lcd.i} | 2 +- src/lcd/lcd.hpp | 2 +- src/lcd/{pyupm_i2clcd.i => pyupm_lcd.i} | 2 +- src/lcd/ssd1306.hpp | 4 ++-- src/lcd/ssd1308.hpp | 4 ++-- src/lcd/ssd1327.hpp | 4 ++-- 30 files changed, 47 insertions(+), 47 deletions(-) rename examples/c++/{i2clcd-eboled.cxx => lcd-eboled.cxx} (100%) rename examples/c++/{i2clcd-ssd1306-oled.cxx => lcd-ssd1306-oled.cxx} (100%) rename examples/c++/{i2clcd-ssd1308-oled.cxx => lcd-ssd1308-oled.cxx} (100%) rename examples/c++/{i2clcd-ssd1327-oled.cxx => lcd-ssd1327-oled.cxx} (100%) rename examples/java/{I2CLCD_EBOLEDSample.java => LCD_EBOLEDSample.java} (94%) rename examples/java/{I2CLCD_SSD1306Sample.java => LCD_SSD1306Sample.java} (98%) rename src/lcd/{javaupm_i2clcd.i => javaupm_lcd.i} (97%) rename src/lcd/{jsupm_i2clcd.i => jsupm_lcd.i} (94%) rename src/lcd/{pyupm_i2clcd.i => pyupm_lcd.i} (95%) diff --git a/README.md b/README.md index 6c61b1b7..92c6bed0 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,7 @@ unable to compile code that was working fine before a library update, make sure you check the [API changes](docs/apichanges.md) section first. **NOTE** - Several important API changes are currently underway for some of our -widely used libraries including `libupm-grove` and `libupm-i2clcd`! +widely used libraries including `libupm-grove` ### Changelog Version changelog [here](docs/changelog.md). diff --git a/docs/apichanges.md b/docs/apichanges.md index 1e4d1f13..3550ba59 100644 --- a/docs/apichanges.md +++ b/docs/apichanges.md @@ -138,13 +138,13 @@ compatibility between releases: * **lcm1602/jhd1313m1** These drivers had been rewritten in C, with C++ wrappers and placed into their own libraries in the previous version of UPM, however, the original C++ implementation was kept in - the lcd/i2clcd library for compatibility reasons with existing code. + the lcd library for compatibility reasons with existing code. To avoid collisions with the header files, the new *lcm1602* and *jhd1313m1* drivers had their C++ headers renamed to use a **.hxx** suffix. In this version of UPM, the *lcm1602* and *jhd1313m1* drivers have - been removed from the lcd/i2clcd library. In addition, the header + been removed from the lcd library. In addition, the header files for the new implementation have been renamed from their **.hxx** suffix to the normal **.hpp** suffix. diff --git a/docs/building.md b/docs/building.md index f550260c..e26911c8 100644 --- a/docs/building.md +++ b/docs/building.md @@ -106,22 +106,22 @@ make install Often developers are only interested in building one module or even just the python/node module to do some quick testing using scripting. In order to do this you need to use the target name for the python or node module you want to -rebuild. For example the lcd module target name is i2clcd. Therefore the python -module target name will be prefixed by _pyupm_. Just do the following to build -only that module. Modules not using the UPM cmake macros may have different -naming. +rebuild. For example, the lcd module target will have a python2 target prefixed +by _pyupm_ (_pyupm_lcd-python2). Modules not using the UPM cmake macros may +have different naming. To build the python2 lcd module (and all dependencies), +use the following make target: ~~~~~~~~~~~~~ -make _pyupm_i2clcd +make _pyupm_lcd-python2 ~~~~~~~~~~~~~ Sometimes you want to build a small C++ example against an installed library. This is fairly easy if installed system-wide. Just link against the correct -library (in this case libupm-i2clcd) and then add /usr/include/upm to the +library (in this case libupm-lcd) and then add /usr/include/upm to the loader path: ~~~~~~~~~~~~ -g++ test.cxx -lupm-i2clcd -I/usr/include/upm +g++ test.cxx -lupm-lcd -I/usr/include/upm ~~~~~~~~~~~~ You can also use pkg-config to return the information to you, which is @@ -129,7 +129,7 @@ considered the correct way if including UPM in a build system like cmake or autotools on linux. ~~~~~~~~~~~ -pkg-config --cflags --libs upm-i2clcd +pkg-config --cflags --libs upm-lcd ~~~~~~~~~~~ ## Building for Android Things diff --git a/doxy/samples.mapping.txt b/doxy/samples.mapping.txt index a69196d1..2a2eca02 100644 --- a/doxy/samples.mapping.txt +++ b/doxy/samples.mapping.txt @@ -59,8 +59,8 @@ rpr220.cxx RPR220Sample.java rpr220.js rpr220.py rpr220-intr.cxx RPR220_intrSample.java rpr220-intr.js rpr220-intr.py slide.cxx SlideSample.java slide.js slide.py speaker.cxx SpeakerSample.java speaker.js speaker.py -i2clcd-ssd1308-oled.cxx SSD1308_oledSample.java ssd1308-oled.js ssd1308-oled.py -i2clcd-ssd1327-oled.cxx SSD1327_oledSample.java ssd1327-oled.js ssd1327-oled.py +lcd-ssd1308-oled.cxx SSD1308_oledSample.java ssd1308-oled.js ssd1308-oled.py +lcd-ssd1327-oled.cxx SSD1327_oledSample.java ssd1327-oled.js ssd1327-oled.py st7735.cxx ST7735Sample.java st7735.js st7735.py stepmotor.cxx StepMotorSample.java stepmotor.js stepmotor.py tm1637.cxx TM1637Sample.java tm1637.js tm1637.py diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 9ab216b8..c179f4de 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -41,7 +41,7 @@ # a110x.c Requires libupmc-a110x # lcm1602-i2c.c Requires libupmc-lcm1602 # bmp280-bme280.c Requires libupmc-bmp280 -# i2clcd-eboled.cxx Requires libupm-i2clcd +# lcd-eboled.cxx Requires libupm-lcd # # function (add_example example_src) diff --git a/examples/c++/i2clcd-eboled.cxx b/examples/c++/lcd-eboled.cxx similarity index 100% rename from examples/c++/i2clcd-eboled.cxx rename to examples/c++/lcd-eboled.cxx diff --git a/examples/c++/i2clcd-ssd1306-oled.cxx b/examples/c++/lcd-ssd1306-oled.cxx similarity index 100% rename from examples/c++/i2clcd-ssd1306-oled.cxx rename to examples/c++/lcd-ssd1306-oled.cxx diff --git a/examples/c++/i2clcd-ssd1308-oled.cxx b/examples/c++/lcd-ssd1308-oled.cxx similarity index 100% rename from examples/c++/i2clcd-ssd1308-oled.cxx rename to examples/c++/lcd-ssd1308-oled.cxx diff --git a/examples/c++/i2clcd-ssd1327-oled.cxx b/examples/c++/lcd-ssd1327-oled.cxx similarity index 100% rename from examples/c++/i2clcd-ssd1327-oled.cxx rename to examples/c++/lcd-ssd1327-oled.cxx diff --git a/examples/java/CMakeLists.txt b/examples/java/CMakeLists.txt index ba91490c..30b08295 100644 --- a/examples/java/CMakeLists.txt +++ b/examples/java/CMakeLists.txt @@ -198,8 +198,8 @@ add_example_with_path(Jhd1313m1_lcdSample jhd1313m1 jhd1313m1) add_example_with_path(Jhd1313m1Sample jhd1313m1 jhd1313m1) add_example_with_path(Lcm1602_i2cSample lcm1602 lcm1602) add_example_with_path(Lcm1602_parallelSample lcm1602 lcm1602) -add_example_with_path(SSD1308_oledSample lcd i2clcd) -add_example_with_path(SSD1327_oledSample lcd i2clcd) +add_example_with_path(SSD1308_oledSample lcd lcd) +add_example_with_path(SSD1327_oledSample lcd lcd) add_example_multiple_jars(BME280_Example bmp280 "bmp280;interfaces") if(SWIG_VERSION VERSION_GREATER 3.0.8) diff --git a/examples/java/I2CLCD_EBOLEDSample.java b/examples/java/LCD_EBOLEDSample.java similarity index 94% rename from examples/java/I2CLCD_EBOLEDSample.java rename to examples/java/LCD_EBOLEDSample.java index 81f1df7c..e7eef910 100644 --- a/examples/java/I2CLCD_EBOLEDSample.java +++ b/examples/java/LCD_EBOLEDSample.java @@ -22,13 +22,13 @@ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -public class I2CLCD_EBOLEDSample { +public class LCD_EBOLEDSample { public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate an Edison Block OLED using default values - upm_i2clcd.EBOLED lcd = new upm_i2clcd.EBOLED(); + upm_lcd.EBOLED lcd = new upm_lcd.EBOLED(); lcd.clear(); lcd.setCursor(10, 15); diff --git a/examples/java/I2CLCD_SSD1306Sample.java b/examples/java/LCD_SSD1306Sample.java similarity index 98% rename from examples/java/I2CLCD_SSD1306Sample.java rename to examples/java/LCD_SSD1306Sample.java index fffde879..cc330661 100644 --- a/examples/java/I2CLCD_SSD1306Sample.java +++ b/examples/java/LCD_SSD1306Sample.java @@ -22,7 +22,7 @@ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -public class I2CLCD_SSD1306Sample { +public class LCD_SSD1306Sample { static private final int[] intel_logo = new int[]{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -85,7 +85,7 @@ public class I2CLCD_SSD1306Sample { public static void main(String[] args) throws InterruptedException { // ! [Interesting] - upm_i2clcd.SSD1306 lcd = new upm_i2clcd.SSD1306(0x0, 0x3D); + upm_lcd.SSD1306 lcd = new upm_lcd.SSD1306(0x0, 0x3D); byte[] image = new byte[intel_logo.length]; for (int i = 0; i < intel_logo.length; i++) diff --git a/examples/java/SSD1308_oledSample.java b/examples/java/SSD1308_oledSample.java index c7a5bd30..4a5b2d51 100644 --- a/examples/java/SSD1308_oledSample.java +++ b/examples/java/SSD1308_oledSample.java @@ -76,7 +76,7 @@ public class SSD1308_oledSample { public static void main(String[] args) throws InterruptedException { // ! [Interesting] - upm_i2clcd.SSD1308 lcd = new upm_i2clcd.SSD1308(0); + upm_lcd.SSD1308 lcd = new upm_lcd.SSD1308(0); byte[] image = new byte[IntelLogo.length]; for (int i = 0; i < IntelLogo.length; i++) diff --git a/examples/java/SSD1327_oledSample.java b/examples/java/SSD1327_oledSample.java index defeea62..ed5128a8 100644 --- a/examples/java/SSD1327_oledSample.java +++ b/examples/java/SSD1327_oledSample.java @@ -111,7 +111,7 @@ public class SSD1327_oledSample { public static void main(String[] args) throws InterruptedException { // ! [Interesting] - upm_i2clcd.SSD1327 lcd = new upm_i2clcd.SSD1327(0); + upm_lcd.SSD1327 lcd = new upm_lcd.SSD1327(0); // If you don't set the display to be white, the seeed logo will appear // jagged diff --git a/examples/javascript/eboled.js b/examples/javascript/eboled.js index 79803551..9cd1279d 100644 --- a/examples/javascript/eboled.js +++ b/examples/javascript/eboled.js @@ -25,7 +25,7 @@ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -var lcdObj = require('jsupm_i2clcd'); +var lcdObj = require('jsupm_lcd'); var oled = new lcdObj.EBOLED(); var sample = 0; diff --git a/examples/javascript/oled_ssd1306.js b/examples/javascript/oled_ssd1306.js index 95cc9d8f..301167cf 100644 --- a/examples/javascript/oled_ssd1306.js +++ b/examples/javascript/oled_ssd1306.js @@ -88,8 +88,8 @@ function exit() process.exit(0); } -// Load i2clcd module -var lcdObj = require('jsupm_i2clcd'); +// Load lcd module +var lcdObj = require('jsupm_lcd'); var lcd = new lcdObj.SSD1306(0, 0x3C); var next = 0; diff --git a/examples/javascript/oled_ssd1308.js b/examples/javascript/oled_ssd1308.js index e0145b2f..03e19db1 100644 --- a/examples/javascript/oled_ssd1308.js +++ b/examples/javascript/oled_ssd1308.js @@ -22,8 +22,8 @@ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -//Load i2clcd module -var LCD = require('jsupm_i2clcd'); +//Load lcd module +var LCD = require('jsupm_lcd'); var myLcd = new LCD.SSD1308 (0, 0x3C); diff --git a/examples/javascript/oled_ssd1327.js b/examples/javascript/oled_ssd1327.js index 5775ab32..9569f0f5 100644 --- a/examples/javascript/oled_ssd1327.js +++ b/examples/javascript/oled_ssd1327.js @@ -22,8 +22,8 @@ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -//Load i2clcd module -var LCD = require('jsupm_i2clcd'); +//Load lcd module +var LCD = require('jsupm_lcd'); var myLcd = new LCD.SSD1327 (0, 0x3C); diff --git a/examples/python/eboled.py b/examples/python/eboled.py index 0dc427f3..cdbe39a4 100755 --- a/examples/python/eboled.py +++ b/examples/python/eboled.py @@ -24,7 +24,7 @@ from __future__ import print_function import time, sys -from upm import pyupm_i2clcd as lcdObj +from upm import pyupm_lcd as lcdObj def main(): # setup with default values diff --git a/examples/python/oled_ssd1308.py b/examples/python/oled_ssd1308.py index 15e39f0f..76c14f60 100755 --- a/examples/python/oled_ssd1308.py +++ b/examples/python/oled_ssd1308.py @@ -21,10 +21,10 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# Load i2clcd display module +# Load lcd display module from __future__ import print_function import time, signal, sys -from upm import pyupm_i2clcd as upmLCD +from upm import pyupm_lcd as upmLCD def main(): myLCD = upmLCD.SSD1308(0, 0x3C); diff --git a/examples/python/oled_ssd1327.py b/examples/python/oled_ssd1327.py index f0dc293e..cffa1673 100755 --- a/examples/python/oled_ssd1327.py +++ b/examples/python/oled_ssd1327.py @@ -21,10 +21,10 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# Load i2clcd display module +# Load lcd display module from __future__ import print_function import time, signal, sys -from upm import pyupm_i2clcd as upmLCD +from upm import pyupm_lcd as upmLCD def main(): myLCD = upmLCD.SSD1327(0, 0x3C); diff --git a/src/lcd/CMakeLists.txt b/src/lcd/CMakeLists.txt index d0ad2875..efe4cdb5 100644 --- a/src/lcd/CMakeLists.txt +++ b/src/lcd/CMakeLists.txt @@ -1,4 +1,4 @@ -set (libname "i2clcd") +set (libname "lcd") set (libdescription "OLED Display Library") set (module_src lcd.cxx ssd1308.cxx eboled.cxx ssd1327.cxx ssd1306.cxx) set (module_hpp lcd.hpp ssd1308.hpp eboled.hpp ssd1327.hpp ssd.hpp ssd1306.hpp) diff --git a/src/lcd/eboled.hpp b/src/lcd/eboled.hpp index d676633b..688c13de 100644 --- a/src/lcd/eboled.hpp +++ b/src/lcd/eboled.hpp @@ -54,7 +54,7 @@ namespace upm const int BUFFER_SIZE = 192; /** - * @library i2clcd + * @library lcd * @sensor eboled * @comname SparkFun Block for Intel Edison - OLED * @altname ssd1306 @@ -79,7 +79,7 @@ namespace upm * * CC BY-NC-SA-3.0. * - * @snippet i2clcd-eboled.cxx Interesting + * @snippet lcd-eboled.cxx Interesting */ class EBOLED : public LCD { diff --git a/src/lcd/javaupm_i2clcd.i b/src/lcd/javaupm_lcd.i similarity index 97% rename from src/lcd/javaupm_i2clcd.i rename to src/lcd/javaupm_lcd.i index 3afd276f..b9d31c91 100644 --- a/src/lcd/javaupm_i2clcd.i +++ b/src/lcd/javaupm_lcd.i @@ -1,4 +1,4 @@ -%module javaupm_i2clcd +%module javaupm_lcd %include "../upm.i" %include "stdint.i" %include "typemaps.i" diff --git a/src/lcd/jsupm_i2clcd.i b/src/lcd/jsupm_lcd.i similarity index 94% rename from src/lcd/jsupm_i2clcd.i rename to src/lcd/jsupm_lcd.i index c084b21c..36f3ccad 100644 --- a/src/lcd/jsupm_i2clcd.i +++ b/src/lcd/jsupm_lcd.i @@ -1,4 +1,4 @@ -%module jsupm_i2clcd +%module jsupm_lcd %include "../upm.i" %include "../carrays_uint8_t.i" diff --git a/src/lcd/lcd.hpp b/src/lcd/lcd.hpp index a4f48e84..46ea78e4 100644 --- a/src/lcd/lcd.hpp +++ b/src/lcd/lcd.hpp @@ -31,7 +31,7 @@ namespace upm { /** * @brief I2C LCD Display library - * @defgroup i2clcd libupm-i2clcd + * @defgroup lcd libupm-lcd * @ingroup dfrobot sainsmart seeed sparkfun adafruit i2c gpio display gsk */ class LCD diff --git a/src/lcd/pyupm_i2clcd.i b/src/lcd/pyupm_lcd.i similarity index 95% rename from src/lcd/pyupm_i2clcd.i rename to src/lcd/pyupm_lcd.i index 512a884c..cfb348f4 100644 --- a/src/lcd/pyupm_i2clcd.i +++ b/src/lcd/pyupm_lcd.i @@ -1,6 +1,6 @@ // Include doxygen-generated documentation %include "pyupm_doxy2swig.i" -%module pyupm_i2clcd +%module pyupm_lcd %include "../upm.i" %include "../carrays_uint8_t.i" diff --git a/src/lcd/ssd1306.hpp b/src/lcd/ssd1306.hpp index 71583e33..aff10719 100644 --- a/src/lcd/ssd1306.hpp +++ b/src/lcd/ssd1306.hpp @@ -85,7 +85,7 @@ const uint8_t SSD1306_LCDWIDTH = 128; const uint8_t SSD1306_LCDHEIGHT = 64; /** - * @library i2clcd + * @library lcd * @sensor ssd1306 * @comname OLED Display * @altname Adafruit SSD1306 OLED Display 0.96" @@ -103,7 +103,7 @@ const uint8_t SSD1306_LCDHEIGHT = 64; * SSD1306 device from eBay. * * @image html ssd1306.jpeg - * @snippet i2clcd-ssd1306-oled.cxx Interesting + * @snippet lcd-ssd1306-oled.cxx Interesting */ class SSD1306 : public LCD { diff --git a/src/lcd/ssd1308.hpp b/src/lcd/ssd1308.hpp index 59a31638..b60b5051 100644 --- a/src/lcd/ssd1308.hpp +++ b/src/lcd/ssd1308.hpp @@ -34,7 +34,7 @@ namespace upm const uint8_t DISPLAY_CMD_SET_NORMAL_1308 = 0xA6; /** - * @library i2clcd + * @library lcd * @sensor ssd1308 * @comname OLED Display * @altname Grove OLED Display 0.96" @@ -51,7 +51,7 @@ const uint8_t DISPLAY_CMD_SET_NORMAL_1308 = 0xA6; * Display module, which is an OLED monochrome display. * * @image html ssd1308.jpeg - * @snippet i2clcd-ssd1308-oled.cxx Interesting + * @snippet lcd-ssd1308-oled.cxx Interesting */ class SSD1308 : public LCD { diff --git a/src/lcd/ssd1327.hpp b/src/lcd/ssd1327.hpp index b254fde4..5f18be69 100644 --- a/src/lcd/ssd1327.hpp +++ b/src/lcd/ssd1327.hpp @@ -34,7 +34,7 @@ namespace upm const uint8_t DISPLAY_CMD_SET_NORMAL = 0xA4; /** - * @library i2clcd + * @library lcd * @sensor ssd1327 * @comname OLED Display * @altname Grove OLED Display 1.12" @@ -50,7 +50,7 @@ const uint8_t DISPLAY_CMD_SET_NORMAL = 0xA4; * which is an OLED monochrome display. * * @image html ssd1327.jpeg - * @snippet i2clcd-ssd1327-oled.cxx Interesting + * @snippet lcd-ssd1327-oled.cxx Interesting */ class SSD1327 : public LCD {