1 /* Copyright JS Foundation and other contributors, http://js.foundation 2 * 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef _JERRYSCRIPT_MBED_DRIVERS_LIB_DRIVERS_H 16 #define _JERRYSCRIPT_MBED_DRIVERS_LIB_DRIVERS_H 17 18 #include "jerryscript-ext/handler.h" 19 #include "jerryscript-mbed-drivers/InterruptIn-js.h" 20 #include "jerryscript-mbed-drivers/DigitalOut-js.h" 21 #include "jerryscript-mbed-drivers/setInterval-js.h" 22 #include "jerryscript-mbed-drivers/setTimeout-js.h" 23 #include "jerryscript-mbed-drivers/I2C-js.h" 24 #include "jerryscript-mbed-drivers/AnalogIn-js.h" 25 #include "jerryscript-mbed-drivers/PwmOut-js.h" 26 DECLARE_JS_WRAPPER_REGISTRATION(base)27DECLARE_JS_WRAPPER_REGISTRATION (base) { 28 REGISTER_GLOBAL_FUNCTION_WITH_HANDLER(assert, jerryx_handler_assert); 29 REGISTER_GLOBAL_FUNCTION_WITH_HANDLER(gc, jerryx_handler_gc); 30 REGISTER_GLOBAL_FUNCTION_WITH_HANDLER(print, jerryx_handler_print); 31 REGISTER_GLOBAL_FUNCTION(setInterval); 32 REGISTER_GLOBAL_FUNCTION(setTimeout); 33 REGISTER_GLOBAL_FUNCTION(clearInterval); 34 REGISTER_GLOBAL_FUNCTION(clearTimeout); 35 REGISTER_CLASS_CONSTRUCTOR(DigitalOut); 36 REGISTER_CLASS_CONSTRUCTOR(I2C); 37 REGISTER_CLASS_CONSTRUCTOR(InterruptIn); 38 REGISTER_CLASS_CONSTRUCTOR(AnalogIn); 39 REGISTER_CLASS_CONSTRUCTOR(PwmOut); 40 } 41 42 #endif // _JERRYSCRIPT_MBED_DRIVERS_LIB_DRIVERS_H 43