Compare commits

..

102 Commits

Author SHA1 Message Date
3d453811fb upm: update to version 0.3.1
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-11 12:35:00 -07:00
67b0b9b219 joystick12: fixed typo in library display name
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-11 11:02:28 -07:00
502b928aff adis16448: fixed typo in library display name
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-11 11:01:05 -07:00
a9cb0718fe hm11: example: make sure buffer is 0 terminated
defect 4374

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-11 10:56:28 -07:00
a1dac4228a tm1637: example: avoid buffer overflow and possible NULL derefs
defects 398, 399

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-11 10:55:55 -07:00
6e2587576d stepmotor: various functions should return a value
defects 386, 387

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-11 10:55:22 -07:00
f8179328cf ssd1327: various functions should return values
defects 377, 378, 379, 380

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-11 10:54:50 -07:00
dae5c67c02 ssd1327-oled: main should return a value
defect 376

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-11 10:54:18 -07:00
eb2ff59fe5 ssd1308: writeChar(), setAddressingMode() should return a value
defect #373, 374

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-11 10:53:45 -07:00
b36eb487eb ssd1308: example main() should return 0
defect #371

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-11 10:53:14 -07:00
bc61e9f86b servo: return a value in setAngle()
defect #356

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-11 10:52:42 -07:00
61175740f6 pulsensor: do_sample needs to return a value (NULL)
defect #346

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-11 10:52:09 -07:00
a41f59984f otp538u: searching otp538u_vt_table could overflow array bounds
defect #341

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-11 10:51:35 -07:00
0bab36a95a mpu9150: getData() does not return a value
defect #242

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-11 10:51:00 -07:00
ff88313462 lcm1602: example main() should return 0
defect #200

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-11 10:50:25 -07:00
3f5c357971 jhd1313m1: example main() should return 0
defect #194

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-11 10:49:50 -07:00
d2e11d6f11 itg3200: calibrate() doesn't return anything
defect #191

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-11 10:49:17 -07:00
3e82dd8d0a lcd: return a proper value in write()
defect #156

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-11 10:48:43 -07:00
4f5030ecf7 htu21d: declare resetSensor() as void
defect #148

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-11 10:47:54 -07:00
784e8a3eb8 hmtrp: example: make sure string read is 0 terminated
defect #146

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-11 10:46:49 -07:00
7fbe71102a adafruitss: initialize duration
defect #25

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-11 10:45:40 -07:00
6f34162ac5 pca9685: enableRestart() does not return anything, so make it void
fixes defect #21

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-11 10:44:05 -07:00
46ab65a344 images: Added few more images and updated corresponding header files
Signed-off-by: sisinty sasmita patra <sisinty.s.patra@intel.com>
2015-06-10 20:55:42 -07:00
d8cf4c82a5 docs: changed landing page links for c/c++ documentation to sensors page
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-09 11:42:18 -07:00
ab14f4f82e images: added few sparkfun images and updated respective license info
Signed-off-by: sisinty sasmita patra <sisinty.s.patra@intel.com>
2015-06-05 11:10:45 -07:00
56cbeb6183 flex: added Sparkfun image and updated license info
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-04 16:51:07 -07:00
6efe6916ba docs: modified index pages for documentation to link to samples repo
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-04 15:16:25 -07:00
ea544e8391 yuidoc: formated main.css style file and added missing semicolons
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-04 12:59:57 -07:00
0c46dd28be yuidoc: updated generators and templates to fix IE sidebar issue
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-04 10:31:38 -07:00
d493c015fd sphinx: inserted links to other language APIs
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-03 15:57:16 -07:00
1e3797ec48 yuidoc: added custom index file for node documentation and fixed image links
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-03 15:36:56 -07:00
6effb25bd6 cmake: changed to generic way to copy png files for documentation links
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-03 12:11:16 -07:00
796f188cb3 upm: updated year in license file
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-03 12:02:36 -07:00
e0bc9573d4 docs: updated links to documentation pages from readme.md and for porting example
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-03 11:58:13 -07:00
5733918a2f m24lr64e: Initial Implementation
This module was developed and tested on the Grove NFC Tag.  It is an
8KB EEPROM accessable (with various protection capabilites) via I2C
and NFC capable devices.

The code was based on the Seeed Studio example code with some help
from the datasheet.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-03 09:58:55 -07:00
6740932c47 sphinx: small changes to index and added link to node documentation
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-03 09:32:05 -07:00
9fb0ca3466 cmake: fixed indentation and V8 version string
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-02 13:55:59 -07:00
d6ce082274 uart: result of mraa_uart_get_dev_path is a const
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-02 09:52:24 -07:00
3587162611 bmpx8x: Fix typo BPM -> BMP
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-02 09:51:20 -07:00
2f1bad1c29 upm: update to version 0.3.0
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-01 17:19:38 -07:00
443888825f cmake: added pydoc dependency on swig generated targets
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-01 17:19:23 -07:00
3872259687 cmake: removed NODE_PATH from call to post build script too
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-01 17:19:06 -07:00
14f80e779e docs: updated library descriptions and sensor names for consistency
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-01 17:18:27 -07:00
8965d56c93 cmake: dont set NODE_PATH in cmake
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-01 15:47:12 -07:00
8614cb322a docs: removed C++ references from documentation to make API language agnostic
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-06-01 15:46:18 -07:00
4390c30be8 cmake: added option to turn on/off building of example binaries
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-29 17:15:59 -07:00
fcf2b9c6aa grovescam: Initial implementation
This module was developed on the Grove Serial Camera.  It connects to
the UART and runs at 115200 baud.  It was developed based on the Seeed
Studio Arduino sketch, as there appears to be no protocol
documentation available.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-29 16:23:13 -07:00
89c9239798 sphinx: updated index.rst file
added content from readme.md into index.rst file.

Signed-off-by: Sisinty Sasmita Patra <sisinty.s.patra@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-28 12:23:44 -07:00
062a7cb826 grovecollision: fixed sensor category
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-28 11:32:19 -07:00
d614719d1d cmake: added guard for version checks on Sphinx and Yuidoc
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-28 10:57:09 -07:00
cbe7b64a97 cmake: added pydoc and jsdoc targets to default build when swig is on
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-28 10:19:49 -07:00
f893613e99 cmake: updated to support building with nodejs 0.12 and swig 3.0.5
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-28 09:20:57 -07:00
5bc5379640 cmake: minor cleanup and changes for pydoc target
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-28 09:20:39 -07:00
f537a5cd4c cmake: make sphinx use a python-staging folder instead of site-packages
This means that you no longer need to install UPM in oder to be able to use
`make pydoc`. The target pydoc now depends on target doc which with SWIG will
cause python modules to be built, making parralel builds work as expected. We
wipe the python-staging directory on each make pydoc as it's a custom_target
and will rerun at every time anyways, copy is cheap and in case a module gets
deleted it avoids the doc still getting built

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-05-28 09:19:44 -07:00
54c2c8db76 jsdoc: change errors to warning when unknown tags are encountered in xml
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-28 09:19:33 -07:00
33b508110e jsdoc: generate modules for sensor groups; customize yuidoc templates for displaying sensor groups by categories & connection types
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-26 17:24:28 -07:00
ed52f0e5cb jsdoc: generator scripts treated as config files to force cmake reconfig on change
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-26 16:59:41 -07:00
3772c807b4 jsdoc: added target for node.js documentation and minor fixes to modules
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-26 16:59:36 -07:00
d6f756a174 cmake: added jsdoc target for generating node.js documentation
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-26 16:59:32 -07:00
60c9e76bcc cmake: added findNode cmake module for doc build
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-26 16:59:27 -07:00
65a19d1779 jsdoc: scripts for generating node.js documentation
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-26 16:59:23 -07:00
1079cb7cdd cmake: small updates to sphinx build target
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-26 16:59:17 -07:00
bfbbb04065 sphinx: custom index file added
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-26 16:59:13 -07:00
7d6a755908 sphinx: config.py.in file for python autogen docs
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-26 16:59:09 -07:00
6727843477 cmake: inserted python doc build in top cmakelists
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-26 16:59:05 -07:00
aa8b2c5774 cmake: findYuidoc script for node.js documentation generator
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-26 16:59:02 -07:00
35394cee19 cmake: added findSphinx script for python documentation generator
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-26 16:59:00 -07:00
b633ecf97f th02: fix non-working driver
There were a few issues with this driver, corrected in this update.

1) i2c transactions were not working - I replaced the i2c
implementation with the MRAA i2c class implementation.

2) status check was inverted - fixed.

3) fixed up #defines in header file to avoid naming collisions (ADDR,
etc).

4) Added capability to supply bus and i2c address to ctor, setting
defaults of 0, and TH02_ADDR respectively.

NOTE: For proper operation on Edison using the arduino breakout
board, the voltage needs to be set to 3.3V rather than 5v.  On G2, 5v
works fine.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-26 16:39:13 -07:00
d36499eac8 doxygen: moved group/library graphs to bottom of the page
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-26 16:27:04 -07:00
45c279f2eb images: cleaned up and adjusted new sensor images
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-26 16:13:14 -07:00
a742459248 images: added more images and modified respective header files
Signed-off-by: Sisinty Sasmita Patra <sisinty.s.patra@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-26 16:12:33 -07:00
1a31085cce images: Added new images and updated respective header file
signed-off-by: Sisinty Sasmita Patra <sisinty.s.patra@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-26 16:07:57 -07:00
517f6c1e88 ad8232: Initial Implementation
This driver implements support for the Sparkfun Single Lead Heart Rate
Monitor, based on the AD8232 chip.

It simply outputs ADC data that needs to be sent somewhere for
plotting.  The Sparkfun page has some suggestions.

Alternatively, if you have an oscilliscope that supports a 'Roll'
mode, you can get an EKG-like display by measuring the OUT pin.

https://www.sparkfun.com/products/12650

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-21 13:52:11 -07:00
c8d0aee873 h3lis331dl: Initial implementation
The driver implements support for the Grove 3-Axis Digital
Accelerometer(±400g), using the h3lis331dl chip.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-19 11:48:46 -07:00
5547d99609 ht9170: Initial implementation
The driver implements support for the DTMF Shield based on the ht9170.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-19 11:31:15 -07:00
3d63b80c97 st7735: fix the JS implementation of ST7735 class not having its parent class's methods: e.g. GFX::fillScreen(uint16_t color)
Signed-off-by: Takahiro Poly Horikawa <horikawa.takahiro@gmail.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-19 10:19:27 -07:00
597b2a6f70 docs: renamed list to known limitations
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-14 10:01:15 -07:00
59d10e81ab docs: added make install to the build instructions
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-08 16:06:40 -07:00
d776edbab2 hm11: Initial implementation
This module implements support for the Grove BLE (Bluetooth Low
Energy) device.  It is implemented as a UART device accepting an "AT"
command set.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-07 15:00:01 -07:00
4ca399845f maxsonarez: Initial implementation
The module supports the LV-MaxSonar EZ1, EZ2, EZ3 and EZ4 ultrasonic
range finders.  It was developed and tested on the EZ3 variant.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-07 14:48:44 -07:00
4759d70541 si114x: Initial implementation
This module implements support for the Adafruit UV sensor:
https://www.adafruit.com/products/1777

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-06 17:46:00 -07:00
34b28928de sx6119: Initial implementation
This was tested with the Grove FM Receiver.  Unfortunately, there is
no documentation on how to control the device using the D1 and D2 pins
that Seeed provides.  There is a switch on the device that can control
all of the elements, power, volume, and seek +/-.

The supplied example can turn the device on, and do a seek, but not
much else.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-06 17:30:08 -07:00
94da23a1fd docs: resized very large images and changed to all lowercase
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-06 15:50:03 -07:00
abfe85ab7d upm: added list of known sensor issues
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-06 15:20:02 -07:00
7271d4f5c4 readme: added Eclipse IDE info
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-05-05 17:49:06 -07:00
c7ed54d037 gas: moved node and py examples to parent folder for autodoc
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-29 17:30:53 -07:00
b1d999e70b apds9002: updated header and doxygen tags
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-29 17:30:14 -07:00
124a9eb41d i2clcd: Add ssd.h to the CMakeLists.txt file.
Signed-off-by: Wouter van Verre <wouter.van.verre@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-23 17:35:35 -07:00
479a9553f6 i2clcd: replace #define with const data inside the namespace.
This keeps the constants in the correct scope and avoid potential
naming conflicts with other files.

Signed-off-by: Wouter van Verre <wouter.van.verre@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-23 17:35:01 -07:00
31c4f470fe i2clcd: use the mraa C++ API instead of the C API
Rewrite the i2c module to be based around the MRAA C++ API,
since this makes resource management easier inside of the UPM
C++ classes.

i2clcd.{h,cxx}: remove the close() function. This now automatically gets
called when the object goes out of scope, inside the destructor.

examples/i2clcd: fix C++/Python/Javascript examples that explicitly called the close function.
The I2c context now gets called by the destructor of the sensor class. This
happens when the object goes out of scope or when it gets deleted, if the
object was created using the new keyword, as is the case here.

Signed-off-by: Wouter van Verre <wouter.van.verre@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-23 17:34:27 -07:00
53b58225a4 i2clcd: remove unused function argument from the writeChar function
The writeChar function in the ssd13xx classes had an unused argument.

Signed-off-by: Wouter van Verre <wouter.van.verre@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-23 17:33:48 -07:00
ae0d99369b i2clcd: remove the helper functions i2Cmd, i2cData & i2cReg
Remove calls to I2C helper functions (i2Cmd, i2cData, i2cReg) and call
the raw MRAA function directly instead and remove the helper functions from the
I2CLcd class

Signed-off-by: Wouter van Verre <wouter.van.verre@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-23 17:33:13 -07:00
bcdaccf68d jhd11313m1.cxx: modify the duration of the usleep calls in the constructor
The new values for the durations match the recommended values from the
datasheet more closely

Signed-off-by: Wouter van Verre <wouter.van.verre@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-23 17:32:39 -07:00
a6aa972c1c jhd1313m1.cxx: Add comment explaining why write starts with a usleep call
Signed-off-by: Wouter van Verre <wouter.van.verre@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-23 17:32:05 -07:00
67bd592ed9 i2clcd: improve error handling in the I2CLcd and Jhd1313m1 classes
Signed-off-by: Wouter van Verre <wouter.van.verre@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-23 17:31:32 -07:00
dea82728af i2clcd_private.h: Added a private header file to hold macros
Added new, private, header file which contains macros used to check the
return value of mraa function calls

Signed-off-by: Wouter van Verre <wouter.van.verre@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-23 17:30:59 -07:00
98f4bcde31 jhd1313m1.cxx: remove repeated function calls
Signed-off-by: Wouter van Verre <wouter.van.verre@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-23 17:30:26 -07:00
bb59d5db7a i2clcd: Reformat the lcd source code
Reformatted to prepare for improving the error handling. This reformatting
was done using clang-format.

Signed-off-by: Wouter van Verre <wouter.van.verre@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-23 17:29:51 -07:00
3abd3a5ee9 .clang-format: Add a .clang-format file to UPM
This file is based on the MRAA .clang-format file

Signed-off-by: Wouter van Verre <wouter.van.verre@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-23 17:29:14 -07:00
9bb485367a adafruitms1438/CMakeLists.txt: fix building with BUILDSWIG=OFF
Missing if statement for building without SWIG (but not explicitely disabling
SWIGNODE & SWIGPYTHON)

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-04-23 17:23:20 -07:00
769b31e0ec cmake: forced mraa pkg check every time a config is generated
This fixes an issue with the wrong libmraa version being reported by cmake on
configuration after a mraa update, even though the build will use the newer
binary.

Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-23 14:07:45 -07:00
52540a678a upm: added version changelog
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2015-04-22 12:56:17 -07:00
346 changed files with 11883 additions and 1214 deletions

122
.clang-format Normal file
View File

@ -0,0 +1,122 @@
Language: Cpp
# Access modifiers in the middle
AccessModifierOffset: -2
# Align escaped newlines as far left as possible
AlignEscapedNewlinesLeft: true
# Align all trailing comments
AlignTrailingComments: true
# Don't allow parameters to be placed on the next line, even though BinPackParameters is false
AllowAllParametersOfDeclarationOnNextLine: false
# Do not allow short functions/if statements/loops on a single line
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
# Don't force breaks before multiline strings
AlwaysBreakBeforeMultilineStrings: false
# Don't force breaks before template declarations
AlwaysBreakTemplateDeclarations: false
# Force breaks after definition return type
AlwaysBreakAfterDefinitionReturnType: true
# Arguments and parameters are either on one line or on one line each
BinPackArguments: false
BinPackParameters: false
# Do not break before binary operators
BreakBeforeBinaryOperators: None
# Use the linux brace breaking style: Attach braces to context except for braces on functions,
# namespaces and class definitions
BreakBeforeBraces: Linux
# Do not place ternary operators after line breaks
BreakBeforeTernaryOperators: false
# In the constructor initializers do not align the comma with the colon
BreakConstructorInitializersBeforeComma: false
# Force columns to be less than 100 characters
ColumnLimit: 100
# Constructor initializer all in one line or all on their own line
ConstructorInitializerAllOnOneLineOrOnePerLine: true
# Indent constructor initializers
ConstructorInitializerIndentWidth: 8
# Do not indent continuations
ContinuationIndentWidth: 0
# Do not use braced lists in c++11 style
Cpp11BracedListStyle: false
# Do not derive pointer alignment
DerivePointerAlignment: false
# Case labes are indented
IndentCaseLabels: true
# Do not indent function declarations
IndentFunctionDeclarationAfterType: false
# Indentation is 4 characters
IndentWidth: 4
# Do not keep empty lines at start of blocks
KeepEmptyLinesAtTheStartOfBlocks: false
# Keep at most 2 consecutive empty lines
MaxEmptyLinesToKeep: 2
# Do not indent namespaces
NamespaceIndentation: None
# Spaces for ObjC properties and protocol lists
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
# Penalties
PenaltyBreakBeforeFirstCallParameter: 100
PenaltyBreakComment: 10
PenaltyBreakFirstLessLess: 0
PenaltyBreakString: 100
PenaltyExcessCharacter: 20
PenaltyReturnTypeOnItsOwnLine: 20
# Force pointers to typename (i.e. char* a instead of char *a)
PointerAlignment: Left
# Spaces after C-style casts and before assignments
SpaceAfterCStyleCast: true
SpaceBeforeAssignmentOperators: true
# Only space before parentheses if they are control statements
SpaceBeforeParens: ControlStatements
# Single space before trailing comments
SpacesBeforeTrailingComments: 1
# No spaces in parentheses, angles, or square brackets
SpaceInEmptyParentheses: false
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
# Use c++11 as the language standard
Standard: Cpp11
# Tabs are 4 characters wide
TabWidth: 4
# Don't use tabs for indentation :-(
UseTab: Never

View File

@ -12,8 +12,10 @@ endif ()
find_package (Threads REQUIRED)
find_package (PkgConfig REQUIRED)
# force the libmraa version to be the required version
pkg_check_modules (MRAA REQUIRED mraa>=0.6.0)
# force a libmraa search and minimum required version every time a config is generated
unset(MRAA_FOUND CACHE)
pkg_check_modules (MRAA REQUIRED mraa>=0.6.2)
message (INFO " found libmraa version: ${MRAA_VERSION}")
# Appends the cmake/modules path to MAKE_MODULE_PATH variable.
@ -28,7 +30,7 @@ include (GetGitRevisionDescription)
git_describe (VERSION "--tags")
if ("x_${VERSION}" STREQUAL "x_GIT-NOTFOUND")
message (WARNING " - Install git to compile a production libmraa!")
set (VERSION "v0.2.0-dirty")
set (VERSION "v0.3.1-dirty")
endif ()
message (INFO " - UPM Version ${VERSION}")
@ -56,18 +58,66 @@ option (BUILDDOC "Build all doc." OFF)
option (BUILDSWIG "Build swig modules." ON)
option (BUILDSWIGPYTHON "Build swig python modules." ON)
option (BUILDSWIGNODE "Build swig node modules." ON)
option (BUILDEXAMPLES "Build C++ example binaries" OFF)
if (BUILDDOC)
# add a target to generate API documentation with Doxygen
find_package (Doxygen)
if (DOXYGEN_FOUND)
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/doxy/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
file(GLOB PNG_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/docs docs/*.png)
foreach(PNG_FILE ${PNG_FILES})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/${PNG_FILE} ${CMAKE_CURRENT_BINARY_DIR}/html/docs/${PNG_FILE} COPYONLY)
endforeach()
add_custom_target (doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
endif (DOXYGEN_FOUND)
# check if Sphinx is installed and add target to generate API documentation
find_package (Sphinx)
if(SPHINX_FOUND AND BUILDSWIG AND BUILDSWIGPYTHON)
# python required for Sphinx build
find_package (PythonLibs)
string (REPLACE "." ";" PYTHON_VERSION_LIST ${PYTHONLIBS_VERSION_STRING})
list (GET PYTHON_VERSION_LIST 0 PYTHON_VERSION_MAJOR)
list (GET PYTHON_VERSION_LIST 1 PYTHON_VERSION_MINOR)
set (SITE_PACKAGES ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages)
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/doxy/conf.py.in ${CMAKE_CURRENT_BINARY_DIR}/pydoc/conf.py @ONLY)
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/doxy/index.rst ${CMAKE_CURRENT_BINARY_DIR}/pydoc/index.rst COPYONLY)
add_custom_target (pydoc ALL
COMMAND rm -r -f ${CMAKE_BINARY_DIR}/pyupm && mkdir -p ${CMAKE_BINARY_DIR}/pyupm
COMMAND find ${CMAKE_BINARY_DIR}/src -name "_pyupm_*.so" -exec cp {} ${CMAKE_BINARY_DIR}/pyupm \;
COMMAND find ${CMAKE_BINARY_DIR}/src -name "pyupm_*.py" -exec cp {} ${CMAKE_BINARY_DIR}/pyupm \;
COMMAND ${SPHINX_API_EXECUTABLE} -f -o pydoc ${CMAKE_BINARY_DIR}/pyupm
# todo: use a separate cmake FILE module for string replacement instead
COMMAND ${SPHINX_EXECUTABLE} -b html pydoc html/python
COMMAND sed -i.bak s|\">pyupm_|\">|g html/python/index.html html/python/modules.html
COMMAND sed -i.bak s|[[:space:]][mM]odule</a>|</a>|g html/python/index.html html/python/modules.html
DEPENDS doc
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Sphinx" VERBATIM
)
endif ()
# check if Yuidoc is installed and add target for API documentation
find_package(Yuidoc)
if(YUIDOC_FOUND AND BUILDSWIGNODE)
# node required for Yuidoc documentation
find_package(Node)
file(GLOB_RECURSE JSDOC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/doxy/node doxy/node/*)
foreach(JSDOC_FILE ${JSDOC_FILES})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doxy/node/${JSDOC_FILE} ${CMAKE_CURRENT_BINARY_DIR}/${JSDOC_FILE} COPYONLY)
endforeach()
add_custom_target(jsdoc ALL
COMMAND ${NODE_EXECUTABLE} docgen -m upm -i xml -t ${CMAKE_CURRENT_SOURCE_DIR}/src -g ../../
COMMAND ${YUIDOC_EXECUTABLE} -C --no-sort --helpers generators/yuidoc/helper.js --themedir generators/yuidoc/tmpl -o html/node jsdoc/yuidoc/upm
COMMAND ${NODE_EXECUTABLE} tolower -i html/node
DEPENDS doc
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Yuidoc" VERBATIM
)
endif()
endif()
if (IPK)
@ -98,4 +148,7 @@ if (IPK)
endif()
add_subdirectory (src)
add_subdirectory (examples/c++)
if(BUILDEXAMPLES)
add_subdirectory (examples/c++)
endif()

View File

@ -1,4 +1,4 @@
Copyright © 2014 Intel Corporation
Copyright © 2014-2015 Intel Corporation
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

View File

@ -23,12 +23,21 @@ may also create more complex structures in order to interface with them.
Browse through the list of all [examples](https://github.com/intel-iot-devkit/upm/tree/master/examples).
Multi-sensor samples for the starter and specialized kits can be found in the
[iot-devkit-samples](https://github.com/intel-iot-devkit/iot-devkit-samples) repository.
### Supported Sensors
Supported [sensor list](http://iotdk.intel.com/docs/master/upm/modules.html) from API documentation.
You can also refer to the [Intel® IoT Developer Zone](https://software.intel.com/iot/sensors).
### IDE Integration
If you would like to create Eclipse IDE projects using the UPM C++ samples,
please follow the instructions posted [here](https://software.intel.com/en-us/node/551014).
This will show you how to import the code and configure your project.
### Building UPM
See @ref building [here](docs/building.md).
@ -51,7 +60,17 @@ Make sure you add yourself as an author on every new code file submitted.
If you are providing a fix with significant changes, feel free to add yourself
as a contributor. Signing-off your commits is mandatory.
C/C++ API Documentation
API Documentation
==============
The C/C++ documentation is available [here](http://iotdk.intel.com/docs/master/upm/).
@htmlonly
<a href="http://iotdk.intel.com/docs/master/upm/modules.html"><img src="docs/c++.png"/></a>
<a href="http://iotdk.intel.com/docs/master/upm/python"><img src="docs/python.png"/></a>
<a href="http://iotdk.intel.com/docs/master/upm/node"><img src="docs/node.png"/></a>
@endhtmlonly
Version @ref changelog [here](docs/changelog.md).
List of @ref knownlimitations [here](docs/knownlimitations.md).

View File

@ -0,0 +1,61 @@
find_program (NODE_EXECUTABLE NAMES node
HINTS
$ENV{NODE_DIR}
PATH_SUFFIXES bin
DOC "Node.js interpreter"
)
include (FindPackageHandleStandardArgs)
find_path (NODE_ROOT_DIR "node/node.h" "src/node.h"
PATHS /usr/include/nodejs /usr/local/include/nodejs)
set (NODE_INCLUDE_DIRS
${NODE_ROOT_DIR}/src
${NODE_ROOT_DIR}/node
${NODE_ROOT_DIR}/deps/v8/include
${NODE_ROOT_DIR}/deps/uv/include
)
find_package_handle_standard_args (Node DEFAULT_MSG
NODE_EXECUTABLE
NODE_INCLUDE_DIRS
)
if (NODE_EXECUTABLE)
execute_process(COMMAND ${NODE_EXECUTABLE} --version
OUTPUT_VARIABLE _VERSION
RESULT_VARIABLE _NODE_VERSION_RESULT)
execute_process(COMMAND ${NODE_EXECUTABLE} -e "console.log(process.versions.v8)"
OUTPUT_VARIABLE _V8_VERSION
RESULT_VARIABLE _V8_RESULT)
if (NOT _NODE_VERSION_RESULT AND NOT _V8_RESULT)
string (REPLACE "v" "" NODE_VERSION_STRING "${_VERSION}")
string (REPLACE "." ";" _VERSION_LIST "${NODE_VERSION_STRING}")
list (GET _VERSION_LIST 0 NODE_VERSION_MAJOR)
list (GET _VERSION_LIST 1 NODE_VERSION_MINOR)
list (GET _VERSION_LIST 2 NODE_VERSION_PATCH)
set (V8_VERSION_STRING ${_V8_VERSION})
string (REPLACE "." ";" _V8_VERSION_LIST "${_V8_VERSION}")
string (REPLACE "." "" V8_DEFINE_STRING "${_V8_VERSION}")
string (STRIP ${V8_DEFINE_STRING} V8_DEFINE_STRING)
list (GET _V8_VERSION_LIST 0 V8_VERSION_MAJOR)
list (GET _V8_VERSION_LIST 1 V8_VERSION_MINOR)
list (GET _V8_VERSION_LIST 2 V8_VERSION_PATCH)
# we end up with a nasty newline so strip everything that isn't a number
string (REGEX MATCH "^[0-9]*" V8_VERSION_PATCH ${V8_VERSION_PATCH})
else ()
set (NODE_VERSION_STRING "0.10.30")
set (NODE_VERSION_MAJOR "0")
set (NODE_VERSION_MINOR "10")
set (NODE_VERSION_PATCH "30")
set (V8_VERSION_MAJOR "3")
set (V8_VERSION_MINOR "28")
set (V8_VERSION_PATCH "72")
set (V8_VERSION_STRING "3.28.72")
message ("defaulted to node 0.10.30")
endif ()
message ("INFO - Node version is " ${NODE_VERSION_STRING} "INFO - Node using v8 " ${V8_VERSION_STRING})
endif ()
mark_as_advanced (NODE_EXECUTABLE)

View File

@ -0,0 +1,31 @@
find_program (SPHINX_EXECUTABLE NAMES sphinx-build
HINTS $ENV{SPHINX_DIR}
PATH_SUFFIXES bin
DOC "Sphinx documentation html generator"
)
find_program (SPHINX_API_EXECUTABLE NAMES sphinx-apidoc
HINTS $ENV{SPHINX_DIR}
PATH_SUFFIXES bin
DOC "Sphinx documentation rst generator"
)
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (Sphinx DEFAULT_MSG
SPHINX_EXECUTABLE
SPHINX_API_EXECUTABLE
)
# Get Sphinx version
if (SPHINX_EXECUTABLE)
execute_process(COMMAND ${SPHINX_EXECUTABLE} --version
OUTPUT_VARIABLE SPHINX_VERSION)
if(SPHINX_VERSION)
string(REGEX MATCH "([0-9]\\.[0-9]\\.[0-9])" SPHINX_VERSION_STR ${SPHINX_VERSION})
message ("INFO - Sphinx version is " ${SPHINX_VERSION_STR})
endif()
endif ()
mark_as_advanced (SPHINX_EXECUTABLE)
mark_as_advanced (SPHINX_API_EXECUTABLE)

View File

@ -0,0 +1,23 @@
find_program (YUIDOC_EXECUTABLE NAMES yuidoc
HINTS $ENV{YUIDOC_DIR}
PATHS usr usr/local
PATH_SUFFIXES bin
DOC "Yuidoc documentation generator"
)
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (Yuidoc DEFAULT_MSG
YUIDOC_EXECUTABLE
)
# Get Yuidoc version
if (YUIDOC_EXECUTABLE)
execute_process(COMMAND ${YUIDOC_EXECUTABLE} --version
ERROR_VARIABLE YUIDOC_VERSION)
if(YUIDOC_VERSION)
message ("INFO - Yuidoc version is " ${YUIDOC_VERSION})
endif()
endif ()
mark_as_advanced (YUIDOC_EXECUTABLE)

View File

@ -21,8 +21,12 @@ mkdir build
cd build
cmake ..
make
make install
~~~~~~~~~~~~~
The last command will create the include/ and lib/ directories with a copy of
the headers and library objects respectively in your build location.
Our cmake configure has a number of options, *cmake-gui* or *ccmake* can show
you all the options. The interesting ones are detailed below:

BIN
docs/c++.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

93
docs/changelog.md Normal file
View File

@ -0,0 +1,93 @@
Changelog {#changelog}
===============
Here's a list summarizing some of the key undergoing changes to our library
from earlier versions:
### v0.3.1
* Updated index pages for API documentation and cross-linked them
* More images were added for Grove, Adafruit and Sparkfun sensors along with
licensing information
* Addressed several issues reported by static code analysis tools
* Added support for Grove NFC Tag sensor
* Fixed several typos in library and sensor names
### v0.3.0
* New CMake targets to build python and node documentation with Sphinx and
Yuidoc
* Edited sensor names, library descriptions and doxygen tags for consistency
* Added support for several new sensors
* Fixed the TH02 sensor driver and made major improvements to i2clcd driver
* Updated and added new images for a lot of the existing sensors
* Added this changelog
### v0.2.0
* Passed 100 supported sensor drivers
* Updated header files with new doxygen tags for improved API documentation
generation
* Added python examples for sensors
* Fixed the buzzer and servo drivers for the Intel Edison
* Renamed bmp and gp2y sensor classes to be more generic
* Completely revamped implementation for tm1637
### v0.1.9
* Passed 50 supported sensor drivers
* Starter Kit and Additional Roadshow and Hackaton sensors added
* Several examples and documentation updates submitted
* Wrote new proper SWIG typemaps for arrays
* Fixed the i2clcd write function, improved several other sensors
### v0.1.8
* Added MQ series gas sensors and a few others
* Generated Doxygen layout file to improve API look and feel
* Several sensor documentation updates
### v0.1.7
* Fixed SWIG node build issues
* Added lpd8806 digital led strip
### v0.1.6
* Fixed SWIG python builds
* Extended i2clcd devices with new functions
* Made SWIG interface improvements and added extra types
* Added nrf8001 BLE support
* Few other sensor additions and fixes
### v0.1.5
* New drivers for microphone and mpu9150
* Added generic driver for stepper motors
* Updated all code to use MRAA and version dependency
### v0.1.4
* Added new bmp/gy pressure sensor and updated servo
* Started UPM documentation and related pages
* Updated MRAA dependencies
### v0.1.3
* Updated SWIG support for some sensors
* New sensor support for mma7455 accelerometer
### v0.1.2
* Several new sensors added
* Documentation fixes
* IPK generation
### v0.1.1
* Updated MRAA dependency
### v0.1.0
* Initial release with some basic grove sensors and hmc5883
* Doxygen and SWIG support implemented

BIN
docs/images/a110x.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
docs/images/ad8232.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

BIN
docs/images/adafruitms1438.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

BIN
docs/images/adafruitss.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

BIN
docs/images/adc121c021.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
docs/images/apds9002.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
docs/images/at42qt1070.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

BIN
docs/images/biss0001.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
docs/images/buzzer.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

BIN
docs/images/cjq4435.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

BIN
docs/images/ds1307.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
docs/images/ecs1030.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

BIN
docs/images/enc03r.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 166 KiB

After

Width:  |  Height:  |  Size: 166 KiB

BIN
docs/images/flex.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
docs/images/gp2y0a.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
docs/images/grovebutton.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

BIN
docs/images/grovecollision.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
docs/images/groveehr.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

BIN
docs/images/groveeldriver.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

BIN
docs/images/groveemg.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

BIN
docs/images/grovegsr.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
docs/images/groveled.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

BIN
docs/images/grovelight.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
docs/images/grovelinefinder.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

BIN
docs/images/groveloudness.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

BIN
docs/images/grovemd.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

BIN
docs/images/grovemoisture.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
docs/images/groveo2.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

BIN
docs/images/groverelay.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 MiB

After

Width:  |  Height:  |  Size: 64 KiB

BIN
docs/images/grovescam.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

BIN
docs/images/grovespeaker.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

BIN
docs/images/grovetemp.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
docs/images/grovevdiv.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

BIN
docs/images/grovewater.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
docs/images/grovewfs.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

BIN
docs/images/guvas12d.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

BIN
docs/images/h3lis331dl.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
docs/images/hm11.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 41 KiB

BIN
docs/images/hmtrp.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
docs/images/ina132.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
docs/images/isd1820.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
docs/images/joystick12.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
docs/images/l298.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

BIN
docs/images/lcm1602.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

BIN
docs/images/ldt0028.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

BIN
docs/images/lpd8806.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
docs/images/m24lr64e.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
docs/images/max31855.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

BIN
docs/images/maxsonarez.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
docs/images/mhz16.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
docs/images/mlx90614.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

BIN
docs/images/mma7455.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

BIN
docs/images/mma7660.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 142 KiB

BIN
docs/images/nunchuck.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
docs/images/otp538u.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 432 KiB

After

Width:  |  Height:  |  Size: 233 KiB

View File

Before

Width:  |  Height:  |  Size: 165 KiB

After

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 KiB

After

Width:  |  Height:  |  Size: 131 KiB

View File

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

BIN
docs/images/si114x.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB

BIN
docs/images/sm130.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

BIN
docs/images/st7735.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

BIN
docs/images/stepmotor.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
docs/images/sx6119.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
docs/images/ta12200.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
docs/images/tcs3414cs.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
docs/images/th02.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

BIN
docs/images/ttp223.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
docs/images/ublox6.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
docs/images/uln200xa.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
docs/images/waterlevel.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
docs/images/wt5001.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
docs/images/yg1006.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

BIN
docs/images/zfm20.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

51
docs/knownlimitations.md Normal file
View File

@ -0,0 +1,51 @@
Known Limitations {#knownlimitations}
===============
Some sensors do not work seamlessly with a specific board. This means that they
are either incompatible or work only under specific settings. This is a list of
such sensors and known workarounds if they exist.
#### Grove Sensors
* **Grove I2C Touch Sensor** v1.3 is incompatible with the Intel Edison using
the Arduino board, but will work with the Mini-breakout if supplied with at
least 4V. Revision v1.2 works well on all Intel boards.
* **Grove Nunchuck** only works with the Intel Galileo boards and is unusable
on the Intel Edison boards.
* **Grove 3-Axis Digital Gyroscope** (ITG-3200) is not compatible with the
Intel Edison Arduino board but will work with the Mini-breakout.
* **Grove 3-Axis Digital Accelerometer** (ADXL345) only works with the Intel
Edison Arduino board when powered from the 3.3V line.
* **Grove 96x96 OLED Display** will not work on the Intel Edison with Arduino
breakout.
* **Grove 128x64 OLED Display** will not work on the Intel Edison with Arduino
breakout.
* **Grove Barometer** (BMP085) has an unstable connection on the Intel Edison
using the Arduino breakout and does not run properly.
* **Grove 6-Axis Accelerometer & Compass** (LSM303) fails to write to the
configuration register properly and returns invalid data.
* **Grove I2C ADC Converter** does not show up on the I2C bus on the Intel
Edison with the Arduino board.
* **Grove I2C Motor Driver** is not compatible with the Intel Galileo due to
the inability to change the I2C bus speed to 100 KHz.
* **Grove CO2 Sensor** will return zeroed data and is unusable on the Intel
Galileo.
* **Grove BLE** (HM-11) does not return data on the Intel Galileo board.
#### Adafruit Sensors
* **Adafruit Motor Shield** (1438) is not detected on the I2C bus when
connected to the Intel Edison with an Arduino breakout.
#### Other Sensors
* **MPU9150** might return inaccurate data.
#### General
Some I2C sensors add too much capacitance to the SDA line of the Intel Edison
Arduino breakout board, thus the signal sticks to a logic 1. When this happens,
other sensors connected to the I2C bus are unusable. While there is no generic
solution for this limitation, in most cases the sensor works on the Intel
Edison Mini-breakout. When this board is not an option, the sensor can be
sometimes replaced with the same model from a different vendor.

View File

@ -80,7 +80,7 @@ useful to us and converting it to a double.
Our final example, very easy to use API!
@snippet examples/max31855.cxx Interesting
@snippet examples/c++/max31855.cxx Interesting
### Building

BIN
docs/node.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
docs/python.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -142,7 +142,6 @@
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
<memberdecl>
<nestedgroups visible="yes" title="Libraries"/>
<dirs visible="yes" title=""/>
@ -182,6 +181,7 @@
<properties title=""/>
<friends title=""/>
</memberdef>
<groupgraph visible="$GROUP_GRAPHS"/>
<authorsection visible="yes"/>
</group>

352
doxy/conf.py.in Normal file
View File

@ -0,0 +1,352 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# . documentation build configuration file, created by
# sphinx-quickstart on Thu May 1 18:34:23 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys
import os
import shlex
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, "@CMAKE_CURRENT_BINARY_DIR@/pyupm/")
sys.path.insert(0, "@MRAA_LIBDIR@@LIB_SUFFIX@")
# -- General configuration ------------------------------------------------
# Custom flags and filters if needed
# autodoc_default_flags = ['members', 'private-members', 'special-members', 'undoc-members', 'show-inheritance']
# def autodoc_skip_member(app, what, name, obj, skip, options):
# exclusions = ('__weakref__', # special-members
# '__doc__', '__module__', '__dict__', # undoc-members
# 'swig_import_helper'
# )
# exclude = name in exclusions
# return skip or exclude
# def setup(app):
# app.connect('autodoc-skip-member', autodoc_skip_member)
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'upm'
copyright = '2015, Intel Corporation'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '@upm_VERSION_STRING@'
# The full version, including alpha/beta/rc tags.
release = '@VERSION@'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build', '**/.git', '**/CMakeFiles/**', '**/CMakeLists.txt']
# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
#html_theme = '@SPHINX_THEME@'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = ['@SPHINX_THEME_DIR@']
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
#html_extra_path = []
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'upmdoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'sphinx.tex', '. Documentation',
'Author', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'sphinx', '. Documentation',
['Author'], 1)
]
# If true, show URL addresses after external links.
#man_show_urls = False
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'sphinx', '. Documentation',
'Author', 'sphinx', 'One line description of project.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
#texinfo_appendices = []
# If false, no module index is generated.
#texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False
# -- Options for Epub output ----------------------------------------------
# Bibliographic Dublin Core info.
epub_title = '.'
epub_author = 'UPM'
epub_publisher = 'UPM'
epub_copyright = '2015, Intel Corporation'
# The basename for the epub file. It defaults to the project name.
#epub_basename = '.'
# The HTML theme for the epub output. Since the default themes are not optimized
# for small screen space, using the same theme for HTML and epub output is
# usually not wise. This defaults to 'epub', a theme designed to save visual
# space.
#epub_theme = 'epub'
# The language of the text. It defaults to the language option
# or en if the language is not set.
#epub_language = ''
# The scheme of the identifier. Typical schemes are ISBN or URL.
#epub_scheme = ''
# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#epub_identifier = ''
# A unique identification for the text.
#epub_uid = ''
# A tuple containing the cover image and cover page html template filenames.
#epub_cover = ()
# A sequence of (type, uri, title) tuples for the guide element of content.opf.
#epub_guide = ()
# HTML files that should be inserted before the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_pre_files = []
# HTML files shat should be inserted after the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_post_files = []
# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']
# The depth of the table of contents in toc.ncx.
#epub_tocdepth = 3
# Allow duplicate toc entries.
#epub_tocdup = True
# Choose between 'default' and 'includehidden'.
#epub_tocscope = 'default'
# Fix unsupported image types using the PIL.
#epub_fix_images = False
# Scale large images.
#epub_max_image_width = 0
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#epub_show_urls = 'inline'
# If false, no index is generated.
#epub_use_index = True

81
doxy/index.rst Normal file
View File

@ -0,0 +1,81 @@
.. UPM Python documentation master file, created by Sisinty Sasmita Patra
UPM Team on Thu May 14 15:58:46 2015.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
**Welcome to UPM Python Documentation!**
=========================================
.. include:: ../../README.md
:start-after: ==============
:end-before: ### Example
``Building UPM``
################
For building UPM, please follow this `link <https://github.com/intel-iot-devkit/upm/blob/master/docs/building.md>`_.
``Examples``
############
Multi-sensor samples for the starter and specialized kits can be found in the `iot-devkit-samples <https://github.com/intel-iot-devkit/iot-devkit-samples>`_
repository.
Individual sensor usage examples for python are available `here <https://github.com/intel-iot-devkit/upm/tree/master/examples/python>`_.
``Making your own UPM Module``
##############################
This `link <https://github.com/intel-iot-devkit/upm/blob/master/docs/porting.md>`_ has more information on making a new UPM module.
There is also an example available for max31855 `sensor <https://github.com/intel-iot-devkit/upm/blob/master/docs/max31855.md>`_.
``Naming Conventions and Rules for New UPM Contributions``
##########################################################
Before you begin development, please take a look at our naming `conventions <https://github.com/intel-iot-devkit/upm/blob/master/docs/naming.md>`_.
Also, please read the guidelines for contributions to `UPM <https://github.com/intel-iot-devkit/upm/blob/master/docs/contributions.md>`_.
Don't forget to check the documentation `section <https://github.com/intel-iot-devkit/upm/blob/master/docs/documentation.md>`_.
.. note::
* Make sure you add yourself as an author on every new code file submitted.
* If you are providing a fix with significant changes, feel free to add yourself as a contributor.
* Signing-off your commits is mandatory.
``List of Available Sensors Drivers``
######################################
.. toctree::
:maxdepth: 2
modules
``Other API Documentation``
###########################
.. image:: ../docs/c++.png
:target: http://iotdk.intel.com/docs/master/upm/modules.html
.. image:: ../docs/python.png
:target: http://iotdk.intel.com/docs/master/upm/python
.. image:: ../docs/node.png
:target: http://iotdk.intel.com/docs/master/upm/node
``Version Changelog``
#####################
For our Version Changelog, please see `here <https://github.com/intel-iot-devkit/upm/blob/master/docs/changelog.md>`_.
``Known Limitations``
###################################
For the List of Known Limitations, please see `here <https://github.com/intel-iot-devkit/upm/blob/master/docs/knownlimitations.md>`_.
``Indices and tables``
######################
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

59
doxy/node/docgen.js Normal file
View File

@ -0,0 +1,59 @@
/*
* Author: Heidi Pan <heidi.pan@intel.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
// dependencies
var xml2js = require('./xml2js')
, fs = require('fs')
, Promise = require('bluebird')
, opts = require('commander')
, _ = require('lodash')
, mkdirp = require('mkdirp');
// parse command line arguments
_.extend(opts, { addOptions: function(module) { return module.addOptions(opts); } });
opts
.option('-m, --module [module]', 'module name for which to build documentation', 'mraa')
.option('-f, --formats [formats]', 'format for js comments', 'yuidoc,ternjs')
.option('-o, --outdir [directory]', 'top directory to build documentation', __dirname + '/jsdoc')
.addOptions(xml2js)
.parse(process.argv);
// use promise-style programming rather than spaghetti callbacks
Promise.promisifyAll(fs);
Promise.promisifyAll(mkdirp);
// main
xml2js.parse().then(function(specjs) {
var formats = opts.formats.split(',');
Promise.all(_.map(formats, function(format) {
var generateDocs = require(__dirname + '/generators/' + format + '/generator');
var dir = opts.outdir + '/' + format + '/' + specjs.MODULE;
return mkdirp.mkdirpAsync(dir).then(function() {
return fs.writeFileAsync(dir + '/doc.js', generateDocs(specjs));
});
}));
});

View File

@ -0,0 +1,7 @@
{
"templates": {
"default": {
"outputSourceFiles": false
}
}
}

View File

@ -0,0 +1,89 @@
/*
* Author: Heidi Pan <heidi.pan@intel.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
// dependencies
var _ = require('lodash');
// generate JSDoc-style documentation
function generateDocs(specjs) {
var docs = GENERATE_MODULE(specjs.MODULE);
docs = _.reduce(specjs.METHODS, function(memo, methodSpec, methodName) {
return memo += GENERATE_METHOD(methodName, methodSpec);
}, docs);
docs = _.reduce(specjs.ENUMS, function(memo, enumSpec, enumName) {
return memo += GENERATE_ENUM(enumName, enumSpec);
}, docs);
docs = _.reduce(specjs.CLASSES, function(memo, classSpec, parentClass) {
return _.reduce(classSpec.methods, function(memo, methodSpec, methodName) {
return memo += GENERATE_METHOD(methodName, methodSpec, parentClass);
}, memo);
}, docs);
return docs;
}
// comment wrapper around entire spec
function GENERATE_DOC(text) {
return '/**\n' + text + ' */\n';
}
// generate module spec
function GENERATE_MODULE(module) {
return GENERATE_DOC('@module ' + module + '\n');
}
// generate method spec with parent module/class
function GENERATE_METHOD(name, spec, parent) {
name = name.replace(/!+$/, '');
return GENERATE_DOC(spec.description + '\n'
+ '@method ' + name + '\n'
+ '@instance\n'
+ (parent ? ('@memberof ' + parent + '\n') : '')
+ _.reduce(spec.params, function(memo, paramSpec, paramName) {
return '@param {' + paramSpec.type + '} ' + paramName + ' ' + paramSpec.description + '\n';
}, '')
+ ( !_.isEmpty(spec.return) ? ('@return {' + spec.return.type + '} ' + spec.return.description + '\n') : ''));
}
// generate enum spec
function GENERATE_ENUM(name, spec) {
return GENERATE_DOC(spec.description + '\n\n'
+ '@var ' + name + '\n'
+ '@type Enum(' + spec.type + ')\n'
+ '@instance\n');
}
// TODO
// generate link spec
function GENERATE_LINK(text) {
return '{@link ' + text + '}';
}
module.exports = generateDocs;

Some files were not shown because too many files have changed in this diff Show More