From 4935a16530bc58c8b09592bfaf5511f7f50cb569 Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Mon, 6 Aug 2018 10:42:17 +0300 Subject: [PATCH] BH1749: Add library blocks to headers, JSON format, and change SWIG JAVA vector type - Add library blocks to header files - Removed unneccessay new lines in JSON file - Change SWIG Java floatVector to uint16Vector Signed-off-by: Assam Boudjelthia Signed-off-by: Mihai Tudor Panu --- examples/java/BH1749_Example.java | 2 +- src/bh1749/bh1749.h | 9 ++++++-- src/bh1749/bh1749.hpp | 5 +++++ src/bh1749/bh1749.i | 2 +- src/bh1749/bh1749.json | 37 ++++++++----------------------- 5 files changed, 23 insertions(+), 32 deletions(-) diff --git a/examples/java/BH1749_Example.java b/examples/java/BH1749_Example.java index 744949bc..e1943caa 100755 --- a/examples/java/BH1749_Example.java +++ b/examples/java/BH1749_Example.java @@ -28,7 +28,7 @@ public class BH1749_Example { int sampleCounter = 10; long waitTime; upm_bh1749.BH1749 bh1749; - upm_bh1749.floatVector result; + upm_bh1749.uint16Vector result; bh1749 = new upm_bh1749.BH1749(); bh1749.SensorInit(upm_bh1749.OPERATING_MODES.INT_JUDGE_1, diff --git a/src/bh1749/bh1749.h b/src/bh1749/bh1749.h index 2d26d52d..97d31f2c 100755 --- a/src/bh1749/bh1749.h +++ b/src/bh1749/bh1749.h @@ -35,11 +35,16 @@ extern "C" #include #include "bh1749_registers.h" +/** + * @brief C API for the bh1749 color sensor driver + * @defgroup bh1749 libupm-bh1749 + * @ingroup ROHM i2c color + */ /** * @library bh1749 * @sensor bh1749 - * @comname Color Sensor - * @type color sensor + * @comname ROHM Color Sensor + * @type color * @man ROHM * @con i2c * diff --git a/src/bh1749/bh1749.hpp b/src/bh1749/bh1749.hpp index 2df57f4e..a7e78ff1 100755 --- a/src/bh1749/bh1749.hpp +++ b/src/bh1749/bh1749.hpp @@ -27,6 +27,11 @@ #include #include "bh1749.h" +/** + * @brief C++ API wrapper for the bh1749 color sensor driver + * @defgroup bh1749 libupm-bh1749 + * @ingroup ROHM i2c color + */ /** * @library bh1749 * @sensor bh1749 diff --git a/src/bh1749/bh1749.i b/src/bh1749/bh1749.i index d14e5a30..8ef01404 100755 --- a/src/bh1749/bh1749.i +++ b/src/bh1749/bh1749.i @@ -8,7 +8,7 @@ JAVA_JNI_LOADLIBRARY(javaupm_bh1749) /* BEGIN Common SWIG syntax ------------------------------------------------- */ %include "std_vector.i" -%template(floatVector) std::vector; +%template(uint16Vector) std::vector; %{ #include "bh1749.hpp" diff --git a/src/bh1749/bh1749.json b/src/bh1749/bh1749.json index 3cb55930..670667f9 100755 --- a/src/bh1749/bh1749.json +++ b/src/bh1749/bh1749.json @@ -5,35 +5,16 @@ "BH1749": { "Name": "ROHM BH1749 Color sensor (16-bit)", "Description": "BH1749NUC is a digital color sensor IC with I2C bus interface. This IC senses Red, Green, Blue (RGB) and Infrared and converts them to digital values. The high sensitivity, wide dynamic range and excellent Ircut characteristics make it possible for this IC to obtain the accurate illuminance and color temperature of ambient light. It is ideal for adjusting LCD backlight of TV, mobile phone and tablet PC.", - "Categories": [ - "color sensor" - ], - "Connections": [ - "i2c" - ], - "Project Type": [ - "prototyping", - "commercial" - ], - "Manufacturers": [ - "ROHM" - ], + "Categories": ["color sensor"], + "Connections": ["i2c"], + "Project Type": ["prototyping", "commercial"], + "Manufacturers": ["ROHM"], "Examples": { - "C++": [ - "bh1749.cxx" - ], - "C": [ - "bh1749.c" - ], - "Java": [ - "BH1749_Example.java" - ], - "Python": [ - "bh1749.py" - ], - "Node.js": [ - "bh1749.js" - ] + "C++": ["bh1749.cxx"], + "C": ["bh1749.c"], + "Java": ["BH1749_Example.java"], + "Python": ["bh1749.py"], + "Node.js": ["bh1749.js"] }, "Specifications": { "Supply Voltage (VDD)": {