Javascript wrappers for LPS22HB Sensor library

Dependencies:   LPS22HB

Dependents:   ST_SENSOR_JS

Embed: (wiki syntax)

« Back to documentation index

LPS22HB_JS-js.cpp File Reference

LPS22HB_JS-js.cpp File Reference

Implementation of an LPS22HB Pressure and Temperature sensor for use with Javascript. More...

Go to the source code of this file.

Functions

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

Variables

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

Detailed Description

Implementation of an LPS22HB Pressure 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 LPS22HB_JS-js.cpp.


Function Documentation

DECLARE_CLASS_CONSTRUCTOR ( LPS22HB_JS   )

LPS22HB_JS (native JavaScript constructor)

Constructor for Javascript wrapper

Returns:
a JavaScript object representing LPS22HB_JS.

Definition at line 342 of file LPS22HB_JS-js.cpp.

DECLARE_CLASS_FUNCTION ( LPS22HB_JS  ,
get_pressure_string   
)

LPS22HB_JS::get_pressure_string (native JavaScript method)

Gets the pressure reading in string form

Returns:
Pressure

Definition at line 306 of file LPS22HB_JS-js.cpp.

DECLARE_CLASS_FUNCTION ( LPS22HB_JS  ,
init_spi   
)

LPS22HB_JS::init_spi (native JavaScript method)

Initializes the sensor using SPI interface

Parameters:
SPIobject of helper class which handles the SPI peripheral
CSpin
INTpin
SPItype

Definition at line 82 of file LPS22HB_JS-js.cpp.

DECLARE_CLASS_FUNCTION ( LPS22HB_JS  ,
get_pressure   
)

LPS22HB_JS::get_pressure (native JavaScript method)

Gets the pressure reading

Returns:
Pressure

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

DECLARE_CLASS_FUNCTION ( LPS22HB_JS  ,
init_i2c   
)

LPS22HB_JS::init_i2c (native JavaScript method)

Initializes the sensor using I2C interface

Parameters:
DevI2cobject of helper class which handles the DevI2C peripheral
Address
INTpin

Definition at line 144 of file LPS22HB_JS-js.cpp.

DECLARE_CLASS_FUNCTION ( LPS22HB_JS  ,
get_temperature   
)

LPS22HB_JS::get_temperature (native JavaScript method)

Gets the temperature reading

Returns:
Temperature

Definition at line 195 of file LPS22HB_JS-js.cpp.

DECLARE_CLASS_FUNCTION ( LPS22HB_JS  ,
get_temperature_string   
)

LPS22HB_JS::get_temperature_string (native JavaScript method)

Gets temperature reading in string form

Returns:
Temperature in string

Definition at line 237 of file LPS22HB_JS-js.cpp.

void NAME_FOR_CLASS_NATIVE_DESTRUCTOR() LPS22HB_JS ( void *  void_ptr )

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

Definition at line 61 of file LPS22HB_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(LPS22HB_JS)
}

Type infomation of the native LPS22HB_JS pointer Sets LPS22HB_JS::destructor as the free callback.

Definition at line 70 of file LPS22HB_JS-js.cpp.