mirror of
https://github.com/eclipse/upm.git
synced 2025-07-02 01:41:12 +03:00
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:
@ -2,8 +2,7 @@ upm_mixed_module_init (NAME jhd1313m1
|
||||
DESCRIPTION "LCD Display Driver for the JHD1313M1 Controller for HD44780-based Displays"
|
||||
C_HDR jhd1313m1.h
|
||||
C_SRC jhd1313m1.c
|
||||
CPP_HDR jhd1313m1.hxx
|
||||
CPP_HDR jhd1313m1.hpp
|
||||
CPP_SRC jhd1313m1.cxx
|
||||
# FTI_SRC jhd1313m1_fti.c
|
||||
CPP_WRAPS_C
|
||||
REQUIRES mraa lcm1602)
|
||||
|
@ -1,31 +1,11 @@
|
||||
%module javaupm_jhd1313m1
|
||||
%include "../upm.i"
|
||||
%include "stdint.i"
|
||||
%include "../upm_vectortypes.i"
|
||||
%include "typemaps.i"
|
||||
%include "arrays_java.i";
|
||||
|
||||
%apply signed char[] {uint8_t []};
|
||||
%ignore BasicFont;
|
||||
|
||||
%typemap(jni) (uint8_t *data, int bytes) "jbyteArray";
|
||||
%typemap(jtype) (uint8_t *data, int bytes) "byte[]";
|
||||
%typemap(jstype) (uint8_t *data, int bytes) "byte[]";
|
||||
|
||||
%typemap(javain) (uint8_t *data, int bytes) "$javainput";
|
||||
|
||||
%typemap(in) (uint8_t *data, int bytes) {
|
||||
$1 = (uint8_t *) JCALL2(GetByteArrayElements, jenv, $input, NULL);
|
||||
$2 = JCALL1(GetArrayLength, jenv, $input);
|
||||
}
|
||||
|
||||
%typemap(freearg) (uint8_t *data, int bytes) {
|
||||
JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, 0);
|
||||
}
|
||||
|
||||
%include "jhd1313m1.h"
|
||||
%include "jhd1313m1.hxx"
|
||||
%include "jhd1313m1.hpp"
|
||||
%{
|
||||
#include "jhd1313m1.hxx"
|
||||
#include "jhd1313m1.hpp"
|
||||
%}
|
||||
|
||||
%pragma(java) jniclasscode=%{
|
||||
|
@ -216,7 +216,7 @@ upm_result_t jhd1313m1_home(const jhd1313m1_context dev)
|
||||
|
||||
upm_result_t jhd1313m1_create_char(const jhd1313m1_context dev,
|
||||
unsigned int slot,
|
||||
jhd1313m1_custom_char_t data)
|
||||
char *data)
|
||||
{
|
||||
assert(dev != NULL);
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include <stdexcept>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "jhd1313m1.hxx"
|
||||
#include "jhd1313m1.hpp"
|
||||
|
||||
using namespace upm;
|
||||
|
||||
@ -83,9 +83,10 @@ upm_result_t Jhd1313m1::home()
|
||||
}
|
||||
|
||||
upm_result_t Jhd1313m1::createChar(uint8_t charSlot,
|
||||
jhd1313m1_custom_char_t charData)
|
||||
std::vector<uint8_t> charData)
|
||||
{
|
||||
return jhd1313m1_create_char(m_jhd1313m1, charSlot, charData);
|
||||
return jhd1313m1_create_char(m_jhd1313m1, charSlot,
|
||||
(char *)charData.data());
|
||||
}
|
||||
|
||||
upm_result_t Jhd1313m1::displayOn()
|
||||
|
@ -63,11 +63,6 @@ extern "C" {
|
||||
uint8_t entryDisplayMode;
|
||||
} *jhd1313m1_context;
|
||||
|
||||
/**
|
||||
* Custom character.
|
||||
*/
|
||||
typedef char jhd1313m1_custom_char_t[8];
|
||||
|
||||
/**
|
||||
* JHD1313M1 I2C initialization.
|
||||
*
|
||||
@ -147,7 +142,7 @@ extern "C" {
|
||||
*/
|
||||
upm_result_t jhd1313m1_create_char(const jhd1313m1_context dev,
|
||||
unsigned int slot,
|
||||
jhd1313m1_custom_char_t data);
|
||||
char *data);
|
||||
|
||||
/**
|
||||
* Turn the display on.
|
||||
|
@ -34,6 +34,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "jhd1313m1.h"
|
||||
|
||||
namespace upm
|
||||
@ -140,11 +141,11 @@ namespace upm
|
||||
* Create a custom character
|
||||
*
|
||||
* @param charSlot the character slot to write, only 8 are available
|
||||
* @param charData The character data (8 bytes) making up the character
|
||||
* @param charData A vector containing 8 bytes making up the character
|
||||
* @return Result of operation
|
||||
*/
|
||||
upm_result_t createChar(uint8_t charSlot,
|
||||
jhd1313m1_custom_char_t charData);
|
||||
std::vector<uint8_t> charData);
|
||||
|
||||
/**
|
||||
* Turn the display on
|
@ -1,9 +1,8 @@
|
||||
%module jsupm_jhd1313m1
|
||||
%include "../upm.i"
|
||||
%include "../carrays_uint8_t.i"
|
||||
%include "../upm_vectortypes.i"
|
||||
|
||||
%include "jhd1313m1.h"
|
||||
%include "jhd1313m1.hxx"
|
||||
%include "jhd1313m1.hpp"
|
||||
%{
|
||||
#include "jhd1313m1.hxx"
|
||||
#include "jhd1313m1.hpp"
|
||||
%}
|
||||
|
@ -2,12 +2,11 @@
|
||||
%include "pyupm_doxy2swig.i"
|
||||
%module pyupm_jhd1313m1
|
||||
%include "../upm.i"
|
||||
%include "../carrays_uint8_t.i"
|
||||
%include "../upm_vectortypes.i"
|
||||
|
||||
%feature("autodoc", "3");
|
||||
|
||||
%include "jhd1313m1.h"
|
||||
%include "jhd1313m1.hxx"
|
||||
%include "jhd1313m1.hpp"
|
||||
%{
|
||||
#include "jhd1313m1.hxx"
|
||||
#include "jhd1313m1.hpp"
|
||||
%}
|
||||
|
Reference in New Issue
Block a user