lcd/lcm1602/jhd1313m1: remove lcm1602 and jhd1313m1 from lcd library

The lcm1602 and jhd1313m1 drivers had been rewritten in C with a C++
wrapper some time ago, however the original lcm and jhd drivers were
still present in the lcd library.  In addition, to avoid header file
conflicts, the new, separated lcm and jhd header files were renamed
with a .hxx prefix.

This patch:

- renames the new lcm1602/ and jhd1313m1/ header files to have the
  usual .hpp prefix.

- removes the lcm1602, jhd1313m1, and sainsmartks drivers from the
  lcd/ (i2clcd) library.

- fixes the examples to use the "new" libraries (lcm1602 and
  jhd1313m1)

- changes the argument type for the createChar() (C++) to use a byte
  vector (std::vector<uint8_t>) rather than a typedef'd char array.
  The lcm1602_create_char() function (C) uses a standard char *.  The
  use of std::vector is well supported by SWIG.

- SWIG interface files changed to use upm_vectortypes.i, and removes
  the carrays helpers, which should no longer be needed for these
  drivers.

- removes the inclusion of the driver C .h header files into the SWIG
  interface files - this should not be needed for these drivers.

- the sainsmartks driver will be placed into it's own new lcdks (LCD
  Keypad Shield) library.  This library should support the
  SainsmartKS, DFRobot LCD Keypad Shield, and similar products from
  other manufacturers in a future commit.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
This commit is contained in:
Jon Trulson
2017-03-15 11:43:50 -06:00
parent d965b92af1
commit ab171573f9
34 changed files with 114 additions and 1358 deletions

View File

@ -336,14 +336,14 @@ add_example (abpdrrt005pg2a5)
# These are special cases where you specify example binary, source file and module(s)
include_directories (${PROJECT_SOURCE_DIR}/src)
add_custom_example (groveled-multi-example-cxx groveled-multi.cxx grove)
add_custom_example (lcm1602-i2c-example-cxx lcm1602-i2c.cxx lcd)
add_custom_example (lcm1602-parallel-example-cxx lcm1602-parallel.cxx lcd)
add_custom_example (jhd1313m1-lcd-example-cxx jhd1313m1-lcd.cxx lcd)
add_custom_example (lcm1602-i2c-example-cxx lcm1602-i2c.cxx lcm1602)
add_custom_example (lcm1602-parallel-example-cxx lcm1602-parallel.cxx lcm1602)
add_custom_example (jhd1313m1-lcd-example-cxx jhd1313m1-lcd.cxx jhd1313m1)
add_custom_example (es08a-example-cxx es08a.cxx servo)
add_custom_example (ssd1306-oled-example-cxx ssd1306-oled.cxx lcd)
add_custom_example (ssd1308-oled-example-cxx ssd1308-oled.cxx lcd)
add_custom_example (ssd1327-oled-example-cxx ssd1327-oled.cxx lcd)
add_custom_example (sainsmartks-example-cxx sainsmartks.cxx lcd)
#add_custom_example (sainsmartks-example-cxx sainsmartks.cxx lcd)
add_custom_example (eboled-example-cxx eboled.cxx lcd)
add_custom_example (mpu60x0-example-cxx mpu60x0.cxx mpu9150)
add_custom_example (ak8975-example-cxx ak8975.cxx mpu9150)

View File

@ -167,10 +167,10 @@ add_example(Ads1115Sample ads1x15)
add_example(SensorTemplateSample sensortemplate)
add_example(P9813Sample p9813)
add_example_with_path(Jhd1313m1_lcdSample lcd i2clcd)
add_example_with_path(Jhd1313m1Sample lcd i2clcd)
add_example_with_path(Lcm1602_i2cSample lcd i2clcd)
add_example_with_path(Lcm1602_parallelSample lcd i2clcd)
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(BME280_Example bmp280 bmp280)

View File

@ -24,19 +24,19 @@
public class Jhd1313m1Sample {
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
upm_i2clcd.Jhd1313m1 lcd = new upm_i2clcd.Jhd1313m1(0);
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
upm_jhd1313m1.Jhd1313m1 lcd = new upm_jhd1313m1.Jhd1313m1(0);
lcd.setCursor(0, 0);
lcd.write("Hello World");
lcd.setCursor(1, 2);
lcd.write("Hello World");
lcd.setCursor(0, 0);
lcd.write("Hello World");
lcd.setCursor(1, 2);
lcd.write("Hello World");
System.out.println("Sleeping for 5 seconds");
Thread.sleep(5000);
lcd.clear();
// ! [Interesting]
}
System.out.println("Sleeping for 5 seconds");
Thread.sleep(5000);
lcd.clear();
// ! [Interesting]
}
}
}

View File

@ -24,19 +24,20 @@
public class Jhd1313m1_lcdSample{
public static void main(String[] args) throws InterruptedException {
//! [Interesting]
upm_i2clcd.Jhd1313m1 lcd = new upm_i2clcd.Jhd1313m1(1, 0x3E, 0x62);
lcd.setCursor(0,0);
lcd.write("Hello World");
lcd.setCursor(1,2);
lcd.write("Hello World");
public static void main(String[] args) throws InterruptedException {
//! [Interesting]
upm_jhd1313m1.Jhd1313m1 lcd =
new upm_jhd1313m1.Jhd1313m1(1, 0x3E, 0x62);
lcd.setCursor(0,0);
lcd.write("Hello World");
lcd.setCursor(1,2);
lcd.write("Hello World");
System.out.println("Sleeping for 5 seconds");
Thread.sleep(5000);
lcd.clear();
//! [Interesting]
}
System.out.println("Sleeping for 5 seconds");
Thread.sleep(5000);
lcd.clear();
//! [Interesting]
}
}

View File

@ -25,25 +25,18 @@
//NOT TESTED!!!
public class Lcm1602_i2cSample {
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
upm_i2clcd.Lcm1602 lcd = new upm_i2clcd.Lcm1602(0, 0x27);
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
upm_lcm1602.Lcm1602 lcd = new upm_lcm1602.Lcm1602(0, 0x27);
lcd.setCursor(0, 0);
lcd.write("Hello World");
Thread.sleep(3000);
lcd.setCursor(0, 0);
lcd.write("Hello World");
Thread.sleep(3000);
lcd.setCursor(1, 2);
lcd.write("Hello World");
Thread.sleep(3000);
lcd.setCursor(1, 2);
lcd.write("Hello World");
Thread.sleep(3000);
lcd.setCursor(2, 4);
lcd.write("Hello World");
Thread.sleep(3000);
lcd.setCursor(3, 6);
lcd.write("Hello World");
Thread.sleep(3000);
// ! [Interesting]
}
}
// ! [Interesting]
}
}

View File

@ -25,28 +25,29 @@
//NOT TESTED!!!
public class Lcm1602_parallelSample {
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
// LCD connection:
// LCD RS pin to digital pin 8
// LCD Enable pin to digital pin 13
// LCD D4 pin to digital pin 2
// LCD D5 pin to digital pin 3
// LCD D6 pin to digital pin 4
// LCD D7 pin to digital pin 5
// LCD R/W pin to ground
// 10K trimmer potentiometer:
// ends to +5V and ground
// wiper to LCD VO pin (pin 3)
upm_i2clcd.Lcm1602 lcd = new upm_i2clcd.Lcm1602((short) 8, (short) 13, (short) 2, (short) 3, (short) 4, (short) 5, (short) 20, (short) 2);
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
// LCD connection:
// LCD RS pin to digital pin 8
// LCD Enable pin to digital pin 13
// LCD D4 pin to digital pin 2
// LCD D5 pin to digital pin 3
// LCD D6 pin to digital pin 4
// LCD D7 pin to digital pin 5
// LCD R/W pin to ground
// 10K trimmer potentiometer:
// ends to +5V and ground
// wiper to LCD VO pin (pin 3)
upm_lcm1602.Lcm1602 lcd =
new upm_lcm1602.Lcm1602(8, 13, 2, 3, 4, 5, (short) 16, (short) 2);
lcd.setCursor(0, 0);
lcd.write("Hello World");
lcd.setCursor(1, 2);
lcd.write("Hello World");
lcd.setCursor(0, 0);
lcd.write("Hello World");
lcd.setCursor(1, 2);
lcd.write("Hello World");
System.out.println("Sleeping for 5 seconds");
Thread.sleep(5000);
// ! [Interesting]
}
System.out.println("Sleeping for 5 seconds");
Thread.sleep(5000);
// ! [Interesting]
}
}

View File

@ -23,7 +23,7 @@
*/
// Load lcd module on I2C
var LCD = require('jsupm_i2clcd');
var LCD = require('jsupm_jhd1313m1');
// Initialize Jhd1313m1 at 0x62 (RGB_ADDRESS) and 0x3E (LCD_ADDRESS)
var myLcd = new LCD.Jhd1313m1 (0, 0x3E, 0x62);

View File

@ -21,7 +21,7 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
from upm import pyupm_i2clcd as lcd
from upm import pyupm_jhd1313m1 as lcd
def main():
# Initialize Jhd1313m1 at 0x3E (LCD_ADDRESS) and 0x62 (RGB_ADDRESS)