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()
#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;
}
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 };
}
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 };
}
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 };
#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;
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;
#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 ();
--- /dev/null
+%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"
+%}
+++ /dev/null
-%module jsupm_jhd1313m1
-
-%{
- #include "jhd1313m1.h"
-%}
-
-%include "jhd1313m1.h"
+++ /dev/null
-%module jsupm_lcm1602
-
-%{
- #include "lcm1602.h"
-%}
-
-%include "lcm1602.h"
+++ /dev/null
-%module jsupm_ssd1308
-
-%{
- #include "ssd1308.h"
-%}
-
-%include "ssd1308.h"
+++ /dev/null
-%module jsupm_ssd1327
-
-%{
- #include "ssd1327.h"
-%}
-
-%include "ssd1327.h"
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);
#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.
--- /dev/null
+%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"
+%}
+++ /dev/null
-%module pyupm_jhd1313m1
-
-%feature("autodoc", "3");
-
-%include "jhd1313m1.h"
-%{
- #include "jhd1313m1.h"
-%}
+++ /dev/null
-%module pyupm_lcm1602
-
-%feature("autodoc", "3");
-
-#ifdef DOXYGEN
-%include "lcm1602_doc.i"
-#endif
-
-%include "lcm1602.h"
-%{
- #include "lcm1602.h"
-%}
+++ /dev/null
-%module pyupm_ssd1308
-
-%feature("autodoc", "3");
-
-%include "ssd1308.h"
-%{
- #include "ssd1308.h"
-%}
+++ /dev/null
-%module pyupm_ssd1327
-
-%feature("autodoc", "3");
-
-%include "ssd1327.h"
-%{
- #include "ssd1327.h"
-%}
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);
#pragma once
#include <string>
-#include "iiclcd.h"
+#include "i2clcd.h"
namespace upm {
PAGE = 2
} displayAddressingMode;
-class SSD1308 : public IICLcd {
+class SSD1308 : public I2CLcd {
public:
/** SSD1308 Constructor.
* Calls MAA initialisation functions.
#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
#pragma once
#include <string>
-#include "iiclcd.h"
+#include "i2clcd.h"
namespace upm {
/*
PAGE = 2
} displayAddressingMode;
-class SSD1327 : public IICLcd {
+class SSD1327 : public I2CLcd {
public:
/** SSD1308 Constructor.
* Calls MAA initialisation functions.