Javascript wrappers for HTS221 Sensor library

Dependencies:   HTS221

Dependents:   ST_SENSOR_JS

Embed: (wiki syntax)

« Back to documentation index

HTS221_JS-js.cpp File Reference

HTS221_JS-js.cpp File Reference

Implementation of an HTS221 Humidity and Temperature sensor for use with Javascript. More...

Go to the source code of this file.

Functions

void
NAME_FOR_CLASS_NATIVE_DESTRUCTOR() 
HTS221_JS (void *void_ptr)
 HTS221_JS::destructor Called if/when the HTS221_JS is GC'ed.
 DECLARE_CLASS_FUNCTION (HTS221_JS, init_spi)
 HTS221_JS::init_spi (native JavaScript method)
 DECLARE_CLASS_FUNCTION (HTS221_JS, init_i2c)
 HTS221_JS::init_i2c (native JavaScript method)
 DECLARE_CLASS_FUNCTION (HTS221_JS, get_temperature)
 HTS221_JS::get_temperature (native JavaScript method)
 DECLARE_CLASS_FUNCTION (HTS221_JS, get_temperature_string)
 HTS221_JS::get_temperature_string (native JavaScript method)
 DECLARE_CLASS_FUNCTION (HTS221_JS, get_humidity)
 HTS221_JS::get_humidity (native JavaScript method)
 DECLARE_CLASS_FUNCTION (HTS221_JS, get_humidity_string)
 HTS221_JS::get_humidity_string (native JavaScript method)
 DECLARE_CLASS_FUNCTION (HTS221_JS, led_on)
 HTS221_JS::led_on (native JavaScript method)
 DECLARE_CLASS_CONSTRUCTOR (HTS221_JS)
 HTS221_JS (native JavaScript constructor)

Variables

static const
jerry_object_native_info_t 
native_obj_type_info
 Type infomation of the native HTS221_JS pointer Set HTS221_JS::destructor as the free callback.

Detailed Description

Implementation of an HTS221 Humidity and Temperature sensor for use with Javascript.

Author:
ST
Version:
V1.0.0
Date:
9 October 2017
Attention:

© COPYRIGHT(c) 2017 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file HTS221_JS-js.cpp.


Function Documentation

DECLARE_CLASS_CONSTRUCTOR ( HTS221_JS   )

HTS221_JS (native JavaScript constructor)

Constructor for Javascript wrapper

Returns:
JavaScript object representing HTS221_JS.

Definition at line 356 of file HTS221_JS-js.cpp.

DECLARE_CLASS_FUNCTION ( HTS221_JS  ,
led_on   
)

HTS221_JS::led_on (native JavaScript method)

Sets the LED to 1, for testing purposes

Parameters:
DigitalOutpin to blink

Definition at line 312 of file HTS221_JS-js.cpp.

DECLARE_CLASS_FUNCTION ( HTS221_JS  ,
init_spi   
)

HTS221_JS::init_spi (native JavaScript method)

Initializes the sensor using SPI interface

Parameters:
SPIinterface
CSpin
DRDYpin

Definition at line 75 of file HTS221_JS-js.cpp.

DECLARE_CLASS_FUNCTION ( HTS221_JS  ,
get_humidity_string   
)

HTS221_JS::get_humidity_string (native JavaScript method)

Get the humidity reading in string form

Returns:
humidity in string

Definition at line 276 of file HTS221_JS-js.cpp.

DECLARE_CLASS_FUNCTION ( HTS221_JS  ,
get_humidity   
)

HTS221_JS::get_humidity (native JavaScript method)

Get the humidity reading

Returns:
Humidity

Definition at line 246 of file HTS221_JS-js.cpp.

DECLARE_CLASS_FUNCTION ( HTS221_JS  ,
get_temperature_string   
)

HTS221_JS::get_temperature_string (native JavaScript method)

Gets the temperature reading in string form

Returns:
Temperature in string

Definition at line 209 of file HTS221_JS-js.cpp.

DECLARE_CLASS_FUNCTION ( HTS221_JS  ,
get_temperature   
)

HTS221_JS::get_temperature (native JavaScript method)

Gets the temperature reading

Returns:
Temperature

Definition at line 179 of file HTS221_JS-js.cpp.

DECLARE_CLASS_FUNCTION ( HTS221_JS  ,
init_i2c   
)

HTS221_JS::init_i2c (native JavaScript method)

Initializes the sensor using I2C interface

Parameters:
I2Cinterface
Address
DRDYpin

Definition at line 128 of file HTS221_JS-js.cpp.

void NAME_FOR_CLASS_NATIVE_DESTRUCTOR() HTS221_JS ( void *  void_ptr )

HTS221_JS::destructor Called if/when the HTS221_JS is GC'ed.

Definition at line 56 of file HTS221_JS-js.cpp.


Variable Documentation

const jerry_object_native_info_t native_obj_type_info [static]
Initial value:
 {
    .free_cb = NAME_FOR_CLASS_NATIVE_DESTRUCTOR(HTS221_JS)
}

Type infomation of the native HTS221_JS pointer Set HTS221_JS::destructor as the free callback.

Definition at line 64 of file HTS221_JS-js.cpp.