james kang / SPI_JS

Dependencies:   MQTT_JS

Embed: (wiki syntax)

« Back to documentation index

SPI-js.cpp File Reference

SPI-js.cpp File Reference

Implementation of SPI for Javascript. More...

Go to the source code of this file.

Functions

void
NAME_FOR_CLASS_NATIVE_DESTRUCTOR() 
SPI (void *void_ptr)
 SPI::destructor.
 DECLARE_CLASS_CONSTRUCTOR (SPI)
 SPI (native JavaScript constructor)

Variables

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

Detailed Description

Implementation of SPI for Javascript.

Author:
ST
Version:
V1.0.0
Date:
25 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 SPI-js.cpp.


Function Documentation

DECLARE_CLASS_CONSTRUCTOR ( SPI   )

SPI (native JavaScript constructor)

Parameters:
sdambed pin for SPI data
sclmbed pin for SPI clock
Returns:
a JavaScript object representing the SPI bus.

Definition at line 76 of file SPI-js.cpp.

void NAME_FOR_CLASS_NATIVE_DESTRUCTOR() SPI ( void *  void_ptr )

SPI::destructor.

Called if/when the SPI object is GC'ed.

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


Variable Documentation

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

Type infomation of the native SPI pointer.

Set SPI::destructor as the free callback.

Definition at line 65 of file SPI-js.cpp.