lcd: rename from iiclcd to i2clcd, add swig v0.1.3
authorThomas Ingleby <thomas.c.ingleby@intel.com>
Thu, 12 Jun 2014 13:16:39 +0000 (14:16 +0100)
committerThomas Ingleby <thomas.c.ingleby@intel.com>
Thu, 12 Jun 2014 13:16:39 +0000 (14:16 +0100)
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
21 files changed:
src/lcd/CMakeLists.txt
src/lcd/i2clcd.cxx [moved from src/lcd/iiclcd.cxx with 88% similarity]
src/lcd/i2clcd.h [moved from src/lcd/iiclcd.h with 98% similarity]
src/lcd/jhd1313m1.cxx
src/lcd/jhd1313m1.h
src/lcd/jsupm_i2clcd.i [new file with mode: 0644]
src/lcd/jsupm_jhd1313m1.i [deleted file]
src/lcd/jsupm_lcm1602.i [deleted file]
src/lcd/jsupm_ssd1308.i [deleted file]
src/lcd/jsupm_ssd1327.i [deleted file]
src/lcd/lcm1602.cxx
src/lcd/lcm1602.h
src/lcd/pyupm_i2clcd.i [new file with mode: 0644]
src/lcd/pyupm_jhd1313m1.i [deleted file]
src/lcd/pyupm_lcm1602.i [deleted file]
src/lcd/pyupm_ssd1308.i [deleted file]
src/lcd/pyupm_ssd1327.i [deleted file]
src/lcd/ssd1308.cxx
src/lcd/ssd1308.h
src/lcd/ssd1327.cxx
src/lcd/ssd1327.h

index 592c3be..45680ce 100644 (file)
@@ -1,12 +1,5 @@
 set (libname "i2clcd")
-add_library (i2clcd SHARED iiclcd.cxx lcm1602.cxx jhd1313m1.cxx ssd1308.cxx ssd1327.cxx)
-include_directories (${MAA_INCLUDE_DIR})
-target_link_libraries (i2clcd ${MAA_LIBRARIES})
-
-install (TARGETS ${libname} DESTINATION lib/upm COMPONENT ${libname})
-install (FILES iiclcd.h DESTINATION include/upm COMPONENT ${libname})
-
-if (IPK)
-  cpack_add_component (${libname} DISPLAY_NAME ${libname} REQUIRED INSTALL_TYPES all)
-  set(CPACK_COMPONENT_${libname}_DESCRIPTION "libupm lcd")
-endif()
+set (libdescription "upm lcd/oled displays")
+set (module_src i2clcd.cxx lcm1602.cxx jhd1313m1.cxx ssd1308.cxx ssd1327.cxx)
+set (module_h i2clcd.h lcm1602.h jhd1313m1.h ssd1308.h ssd1327.h)
+upm_module_init()
similarity index 88%
rename from src/lcd/iiclcd.cxx
rename to src/lcd/i2clcd.cxx
index a2d39e4..e87d43a 100644 (file)
 #include <iostream>
 #include <unistd.h>
 
-#include "iiclcd.h"
+#include "i2clcd.h"
 
 using namespace upm;
 
-IICLcd::IICLcd (int bus, int lcdAddress) {
+I2CLcd::I2CLcd (int bus, int lcdAddress) {
     m_lcd_control_address = lcdAddress;
     m_bus = bus;
 
@@ -42,18 +42,18 @@ IICLcd::IICLcd (int bus, int lcdAddress) {
 }
 
 maa_result_t
-IICLcd::write (int row, int column, std::string msg) {
+I2CLcd::write (int row, int column, std::string msg) {
     setCursor (row, column);
     write (msg);
 }
 
 maa_result_t
-IICLcd::close() {
+I2CLcd::close() {
     return maa_i2c_stop(m_i2c_lcd_control);
 }
 
 maa_result_t
-IICLcd::i2cReg (maa_i2c_context ctx, int deviceAdress, int addr, uint8_t value) {
+I2CLcd::i2cReg (maa_i2c_context ctx, int deviceAdress, int addr, uint8_t value) {
     maa_result_t error = MAA_SUCCESS;
 
     uint8_t data[2] = { addr, value };
@@ -64,7 +64,7 @@ IICLcd::i2cReg (maa_i2c_context ctx, int deviceAdress, int addr, uint8_t value)
 }
 
 maa_result_t
-IICLcd::i2Cmd (maa_i2c_context ctx, uint8_t value) {
+I2CLcd::i2Cmd (maa_i2c_context ctx, uint8_t value) {
     maa_result_t error = MAA_SUCCESS;
 
     uint8_t data[2] = { LCD_CMD, value };
@@ -75,7 +75,7 @@ IICLcd::i2Cmd (maa_i2c_context ctx, uint8_t value) {
 }
 
 maa_result_t
-IICLcd::i2cData (maa_i2c_context ctx, uint8_t value) {
+I2CLcd::i2cData (maa_i2c_context ctx, uint8_t value) {
     maa_result_t error = MAA_SUCCESS;
 
     uint8_t data[2] = { LCD_DATA, value };
similarity index 98%
rename from src/lcd/iiclcd.h
rename to src/lcd/i2clcd.h
index fa12fd5..de80eda 100644 (file)
@@ -67,9 +67,9 @@ namespace upm {
 #define LCD_RW 0x02 // Read/Write bit
 #define LCD_RS 0x01 // Register select bit
 
-class IICLcd {
+class I2CLcd {
     public:
-        IICLcd (int bus, int lcdAddress);
+        I2CLcd (int bus, int lcdAddress);
         maa_result_t write (int x, int y, std::string msg);
         
         virtual maa_result_t write (std::string msg) = 0;
index 9eed420..cb41911 100644 (file)
@@ -29,7 +29,7 @@
 
 using namespace upm;
 
-Jhd1313m1::Jhd1313m1 (int bus, int lcdAddress, int rgbAddress) : IICLcd(bus, lcdAddress) {
+Jhd1313m1::Jhd1313m1 (int bus, int lcdAddress, int rgbAddress) : I2CLcd(bus, lcdAddress) {
     maa_result_t error = MAA_SUCCESS;
 
     m_rgb_address = rgbAddress;
index 9b60c8f..c8d0b65 100644 (file)
 #pragma once
 
 #include <string>
-#include "iiclcd.h"
+#include "i2clcd.h"
 
 namespace upm {
 
-class Jhd1313m1 : public IICLcd {
+class Jhd1313m1 : public I2CLcd {
     public:
         Jhd1313m1 (int bus, int lcdAddress, int rgbAddress);
         ~Jhd1313m1 ();
diff --git a/src/lcd/jsupm_i2clcd.i b/src/lcd/jsupm_i2clcd.i
new file mode 100644 (file)
index 0000000..f966024
--- /dev/null
@@ -0,0 +1,21 @@
+%module jsupm_i2clcd
+
+%include "i2clcd.h"
+%{
+    #include "i2clcd.h"
+%}
+
+%include "jhd1313m1.h"
+%{
+    #include "jhd1313m1.h"
+%}
+
+%include "lcm1602.h"
+%{
+    #include "lcm1602.h"
+%}
+
+%include "ssd1327.h"
+%{
+    #include "ssd1327.h"
+%}
diff --git a/src/lcd/jsupm_jhd1313m1.i b/src/lcd/jsupm_jhd1313m1.i
deleted file mode 100644 (file)
index ba72ce0..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-%module jsupm_jhd1313m1
-
-%{
-    #include "jhd1313m1.h"
-%}
-
-%include "jhd1313m1.h"
diff --git a/src/lcd/jsupm_lcm1602.i b/src/lcd/jsupm_lcm1602.i
deleted file mode 100644 (file)
index da35f72..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-%module jsupm_lcm1602
-
-%{
-    #include "lcm1602.h"
-%}
-
-%include "lcm1602.h"
diff --git a/src/lcd/jsupm_ssd1308.i b/src/lcd/jsupm_ssd1308.i
deleted file mode 100644 (file)
index d5a4f18..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-%module jsupm_ssd1308
-
-%{
-    #include "ssd1308.h"
-%}
-
-%include "ssd1308.h"
diff --git a/src/lcd/jsupm_ssd1327.i b/src/lcd/jsupm_ssd1327.i
deleted file mode 100644 (file)
index 8c0705d..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-%module jsupm_ssd1327
-
-%{
-    #include "ssd1327.h"
-%}
-
-%include "ssd1327.h"
index fe39668..033a1ff 100644 (file)
@@ -32,7 +32,7 @@
 
 using namespace upm;
 
-Lcm1602::Lcm1602(int bus_in, int addr_in) : IICLcd (bus_in, addr_in) {
+Lcm1602::Lcm1602(int bus_in, int addr_in) : I2CLcd (bus_in, addr_in) {
     maa_result_t error = MAA_SUCCESS;
 
     usleep(50000);
index 100614c..133e07a 100644 (file)
 #pragma once
 
 #include <string>
-#include "iiclcd.h"
+#include "i2clcd.h"
 
 namespace upm {
 
-class Lcm1602 : public IICLcd {
+class Lcm1602 : public I2CLcd {
     public:
         /** LCM1602 Constructor.
          * Calls MAA initialisation functions.
diff --git a/src/lcd/pyupm_i2clcd.i b/src/lcd/pyupm_i2clcd.i
new file mode 100644 (file)
index 0000000..d920680
--- /dev/null
@@ -0,0 +1,23 @@
+%module pyupm_i2clcd
+
+%feature("autodoc", "3");
+
+%include "i2clcd.h"
+%{
+    #include "i2clcd.h"
+%}
+
+%include "jhd1313m1.h"
+%{
+    #include "jhd1313m1.h"
+%}
+
+%include "lcm1602.h"
+%{
+    #include "lcm1602.h"
+%}
+
+%include "ssd1327.h"
+%{
+    #include "ssd1327.h"
+%}
diff --git a/src/lcd/pyupm_jhd1313m1.i b/src/lcd/pyupm_jhd1313m1.i
deleted file mode 100644 (file)
index 97efd78..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-%module pyupm_jhd1313m1
-
-%feature("autodoc", "3");
-
-%include "jhd1313m1.h"
-%{
-    #include "jhd1313m1.h"
-%}
diff --git a/src/lcd/pyupm_lcm1602.i b/src/lcd/pyupm_lcm1602.i
deleted file mode 100644 (file)
index 68d6371..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-%module pyupm_lcm1602
-
-%feature("autodoc", "3");
-
-#ifdef DOXYGEN
-%include "lcm1602_doc.i"
-#endif
-
-%include "lcm1602.h"
-%{
-    #include "lcm1602.h"
-%}
diff --git a/src/lcd/pyupm_ssd1308.i b/src/lcd/pyupm_ssd1308.i
deleted file mode 100644 (file)
index aa0f043..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-%module pyupm_ssd1308
-
-%feature("autodoc", "3");
-
-%include "ssd1308.h"
-%{
-    #include "ssd1308.h"
-%}
diff --git a/src/lcd/pyupm_ssd1327.i b/src/lcd/pyupm_ssd1327.i
deleted file mode 100644 (file)
index d75ed42..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-%module pyupm_ssd1327
-
-%feature("autodoc", "3");
-
-%include "ssd1327.h"
-%{
-    #include "ssd1327.h"
-%}
index 6aef5ae..939449a 100644 (file)
@@ -29,7 +29,7 @@
 
 using namespace upm;
 
-SSD1308::SSD1308 (int bus_in, int addr_in) : IICLcd (bus_in, addr_in) {
+SSD1308::SSD1308 (int bus_in, int addr_in) : I2CLcd (bus_in, addr_in) {
     i2Cmd (m_i2c_lcd_control, DISPLAY_CMD_OFF);  // display off
     printf ("NO_GDB :: DISPLAY_CMD_OFF \n");
     usleep (4500);
index 280198e..531aeaa 100644 (file)
@@ -25,7 +25,7 @@
 #pragma once
 
 #include <string>
-#include "iiclcd.h"
+#include "i2clcd.h"
 
 namespace upm {
 
@@ -145,7 +145,7 @@ typedef enum {
     PAGE          =  2
 } displayAddressingMode;
 
-class SSD1308 : public IICLcd {
+class SSD1308 : public I2CLcd {
     public:
         /** SSD1308 Constructor.
          * Calls MAA initialisation functions.
index 054d9e0..bbfd029 100644 (file)
@@ -32,7 +32,7 @@ using namespace upm;
 #define INIT_SLEEP 50000
 #define CMD_SLEEP  10000
 
-SSD1327::SSD1327 (int bus_in, int addr_in) : IICLcd (bus_in, addr_in) {
+SSD1327::SSD1327 (int bus_in, int addr_in) : I2CLcd (bus_in, addr_in) {
     maa_result_t error  = MAA_SUCCESS;
     usleep (INIT_SLEEP);
     i2Cmd (m_i2c_lcd_control, 0xFD); // Unlock OLED driver IC MCU interface from entering command. i.e: Accept commands
index bb11768..3b7255d 100644 (file)
@@ -25,7 +25,7 @@
 #pragma once
 
 #include <string>
-#include "iiclcd.h"
+#include "i2clcd.h"
 
 namespace upm {
 /*
@@ -145,7 +145,7 @@ typedef enum {
     PAGE          =  2
 } displayAddressingMode;
 
-class SSD1327 : public IICLcd {
+class SSD1327 : public I2CLcd {
     public:
         /** SSD1308 Constructor.
          * Calls MAA initialisation functions.