ST Expansion SW Team / LSM303AGR_JS

Dependencies:   LSM303AGR

Dependents:   ST_SENSOR_JS

Embed: (wiki syntax)

« Back to documentation index

LSM303AGR_JS-js.cpp File Reference

LSM303AGR_JS-js.cpp File Reference

Implementation of an LSM303AGR Accelerometer and Magnetometer sensor for use with Javascript. More...

Go to the source code of this file.

Functions

void
NAME_FOR_CLASS_NATIVE_DESTRUCTOR() 
LSM303AGR_JS (void *void_ptr)
 LSM303AGR_JS::destructor.
 DECLARE_CLASS_FUNCTION (LSM303AGR_JS, init_acc_spi)
 LSM303AGR_JS::init_acc_spi (native JavaScript method)
 DECLARE_CLASS_FUNCTION (LSM303AGR_JS, init_acc_i2c)
 LSM303AGR_JS::init_acc_i2c (native JavaScript method)
 DECLARE_CLASS_FUNCTION (LSM303AGR_JS, init_mag_spi)
 LSM303AGR_JS::init_mag_spi (native JavaScript method)
 DECLARE_CLASS_FUNCTION (LSM303AGR_JS, init_mag_i2c)
 LSM303AGR_JS::init_mag_i2c (native JavaScript method)
 DECLARE_CLASS_FUNCTION (LSM303AGR_JS, get_accelerometer_axes)
 LSM303AGR_JS::get_accelerometer_axes (native JavaScript method)
 DECLARE_CLASS_FUNCTION (LSM303AGR_JS, get_magnetometer_axes)
 LSM303AGR_JS::get_magnetometer_axes (native JavaScript method)
 DECLARE_CLASS_CONSTRUCTOR (LSM303AGR_JS)
 LSM303AGR_JS (native JavaScript constructor)

Variables

static const
jerry_object_native_info_t 
native_obj_type_info
 Type infomation of the native LSM303AGR_JS pointer.

Detailed Description

Implementation of an LSM303AGR Accelerometer and Magnetometer 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 LSM303AGR_JS-js.cpp.


Function Documentation

DECLARE_CLASS_CONSTRUCTOR ( LSM303AGR_JS   )

LSM303AGR_JS (native JavaScript constructor)

Constructor for Javascript wrapper

Returns:
a JavaScript object representing LSM303AGR_JS.

Definition at line 391 of file LSM303AGR_JS-js.cpp.

DECLARE_CLASS_FUNCTION ( LSM303AGR_JS  ,
get_magnetometer_axes   
)

LSM303AGR_JS::get_magnetometer_axes (native JavaScript method)

Get Magnerometer reading

Returns:
Magnetometer axes

Definition at line 355 of file LSM303AGR_JS-js.cpp.

DECLARE_CLASS_FUNCTION ( LSM303AGR_JS  ,
init_acc_spi   
)

LSM303AGR_JS::init_acc_spi (native JavaScript method)

Initializes the sensor using SPI interface

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

Definition at line 87 of file LSM303AGR_JS-js.cpp.

DECLARE_CLASS_FUNCTION ( LSM303AGR_JS  ,
get_accelerometer_axes   
)

LSM303AGR_JS::get_accelerometer_axes (native JavaScript method)

Get Magnerometer reading

Returns:
accelerometer axes

Definition at line 318 of file LSM303AGR_JS-js.cpp.

DECLARE_CLASS_FUNCTION ( LSM303AGR_JS  ,
init_acc_i2c   
)

LSM303AGR_JS::init_acc_i2c (native JavaScript method)

Initializes the sensor using I2C interface

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

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

DECLARE_CLASS_FUNCTION ( LSM303AGR_JS  ,
init_mag_spi   
)

LSM303AGR_JS::init_mag_spi (native JavaScript method)

Initializes the sensor using SPI interface

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

Definition at line 207 of file LSM303AGR_JS-js.cpp.

DECLARE_CLASS_FUNCTION ( LSM303AGR_JS  ,
init_mag_i2c   
)

LSM303AGR_JS::init_mag_i2c (native JavaScript method)

Initializes the sensor using I2C interface

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

Definition at line 263 of file LSM303AGR_JS-js.cpp.

void NAME_FOR_CLASS_NATIVE_DESTRUCTOR() LSM303AGR_JS ( void *  void_ptr )

LSM303AGR_JS::destructor.

Called if/when the LSM303AGR_JS is GC'ed.

Definition at line 63 of file LSM303AGR_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(LSM303AGR_JS)
}

Type infomation of the native LSM303AGR_JS pointer.

Set LSM303AGR_JS::destructor as the free callback.

Definition at line 73 of file LSM303AGR_JS-js.cpp.