2021-02-07 19:19:08 +00:00
|
|
|
/********************************************************************
|
|
|
|
** Copyright (c) 2018-2020 Guan Wenliang
|
|
|
|
** This file is part of the Berry default interpreter.
|
|
|
|
** skiars@qq.com, https://github.com/Skiars/berry
|
|
|
|
** See Copyright Notice in the LICENSE file or at
|
|
|
|
** https://github.com/Skiars/berry/blob/master/LICENSE
|
|
|
|
********************************************************************/
|
|
|
|
#include "berry.h"
|
|
|
|
|
|
|
|
/* this file contains the declaration of the module table. */
|
|
|
|
|
|
|
|
/* default modules declare */
|
|
|
|
be_extern_native_module(string);
|
|
|
|
be_extern_native_module(json);
|
|
|
|
be_extern_native_module(math);
|
|
|
|
be_extern_native_module(time);
|
|
|
|
be_extern_native_module(os);
|
2021-05-26 14:53:53 +01:00
|
|
|
be_extern_native_module(global);
|
2021-02-07 19:19:08 +00:00
|
|
|
be_extern_native_module(sys);
|
|
|
|
be_extern_native_module(debug);
|
|
|
|
be_extern_native_module(gc);
|
2021-03-27 18:02:22 +00:00
|
|
|
be_extern_native_module(solidify);
|
2021-07-22 21:36:18 +01:00
|
|
|
be_extern_native_module(introspect);
|
2021-08-23 12:29:15 +01:00
|
|
|
be_extern_native_module(strict);
|
2021-02-07 19:19:08 +00:00
|
|
|
|
2021-12-12 17:56:11 +00:00
|
|
|
/* Berry extensions */
|
|
|
|
#include "be_mapping.h"
|
|
|
|
be_extern_native_module(cb);
|
|
|
|
|
2021-02-13 11:01:45 +00:00
|
|
|
/* Tasmota specific */
|
2021-10-20 18:04:18 +01:00
|
|
|
be_extern_native_module(python_compat);
|
2021-11-25 21:57:37 +00:00
|
|
|
be_extern_native_module(re);
|
2022-02-15 20:58:05 +00:00
|
|
|
be_extern_native_module(mqtt);
|
2021-10-03 10:54:29 +01:00
|
|
|
be_extern_native_module(persist);
|
2021-11-13 19:45:27 +00:00
|
|
|
be_extern_native_module(autoconf);
|
2021-11-15 22:06:04 +00:00
|
|
|
be_extern_native_module(tapp);
|
2021-04-04 18:36:25 +01:00
|
|
|
be_extern_native_module(light);
|
2021-04-03 17:06:40 +01:00
|
|
|
be_extern_native_module(gpio);
|
2021-11-13 19:45:27 +00:00
|
|
|
be_extern_native_module(display);
|
2021-03-13 21:42:24 +00:00
|
|
|
be_extern_native_module(energy);
|
2021-05-28 21:37:06 +01:00
|
|
|
be_extern_native_module(webserver);
|
2021-06-03 12:23:25 +01:00
|
|
|
be_extern_native_module(flash);
|
2021-07-18 21:39:59 +01:00
|
|
|
be_extern_native_module(path);
|
2021-11-04 07:17:42 +00:00
|
|
|
be_extern_native_module(unishox);
|
2022-02-13 21:59:43 +00:00
|
|
|
be_extern_native_module(hue_ntv);
|
|
|
|
be_extern_native_module(hue_bridge);
|
2022-01-30 22:05:32 +00:00
|
|
|
be_extern_native_module(uuid);
|
2021-11-19 21:09:35 +00:00
|
|
|
be_extern_native_module(animate);
|
2021-04-19 07:40:11 +01:00
|
|
|
#ifdef USE_LVGL
|
2021-10-15 18:34:37 +01:00
|
|
|
be_extern_native_module(lv);
|
2022-01-02 15:16:10 +00:00
|
|
|
be_extern_native_module(lv_extra);
|
2021-12-27 17:12:38 +00:00
|
|
|
be_extern_native_module(lv_tasmota);
|
2021-04-19 07:40:11 +01:00
|
|
|
#endif // USE_LVGL
|
2021-02-13 11:01:45 +00:00
|
|
|
|
2022-01-17 19:47:32 +00:00
|
|
|
#if defined(USE_MI_ESP32) && !defined(USE_BLE_ESP32)
|
2022-01-17 18:51:27 +00:00
|
|
|
extern void be_load_MI32_class(bvm *vm);
|
|
|
|
extern void be_load_BLE_class(bvm *vm);
|
|
|
|
#endif //USE_MI_ESP32
|
|
|
|
|
2021-02-07 19:19:08 +00:00
|
|
|
/* user-defined modules declare start */
|
|
|
|
|
|
|
|
/* user-defined modules declare end */
|
|
|
|
|
|
|
|
/* module list declaration */
|
|
|
|
BERRY_LOCAL const bntvmodule* const be_module_table[] = {
|
|
|
|
/* default modules register */
|
|
|
|
#if BE_USE_STRING_MODULE
|
|
|
|
&be_native_module(string),
|
|
|
|
#endif
|
|
|
|
#if BE_USE_JSON_MODULE
|
|
|
|
&be_native_module(json),
|
|
|
|
#endif
|
|
|
|
#if BE_USE_MATH_MODULE
|
|
|
|
&be_native_module(math),
|
|
|
|
#endif
|
|
|
|
#if BE_USE_TIME_MODULE
|
|
|
|
&be_native_module(time),
|
|
|
|
#endif
|
|
|
|
#if BE_USE_OS_MODULE
|
|
|
|
&be_native_module(os),
|
|
|
|
#endif
|
2021-05-26 14:53:53 +01:00
|
|
|
#if BE_USE_GLOBAL_MODULE
|
|
|
|
&be_native_module(global),
|
|
|
|
#endif
|
2021-02-07 19:19:08 +00:00
|
|
|
#if BE_USE_SYS_MODULE
|
|
|
|
&be_native_module(sys),
|
|
|
|
#endif
|
|
|
|
#if BE_USE_DEBUG_MODULE
|
|
|
|
&be_native_module(debug),
|
|
|
|
#endif
|
|
|
|
#if BE_USE_GC_MODULE
|
|
|
|
&be_native_module(gc),
|
2021-03-27 18:02:22 +00:00
|
|
|
#endif
|
|
|
|
#if BE_USE_SOLIDIFY_MODULE
|
|
|
|
&be_native_module(solidify),
|
2021-07-22 21:36:18 +01:00
|
|
|
#endif
|
|
|
|
#if BE_USE_INTROSPECT_MODULE
|
|
|
|
&be_native_module(introspect),
|
2021-08-16 19:46:09 +01:00
|
|
|
#endif
|
|
|
|
#if BE_USE_STRICT_MODULE
|
|
|
|
&be_native_module(strict),
|
2021-02-07 19:19:08 +00:00
|
|
|
#endif
|
2021-12-12 17:56:11 +00:00
|
|
|
|
|
|
|
/* Berry extensions */
|
|
|
|
&be_native_module(cb),
|
|
|
|
|
2021-02-07 19:19:08 +00:00
|
|
|
/* user-defined modules register start */
|
2021-04-24 11:11:06 +01:00
|
|
|
|
2021-10-20 18:04:18 +01:00
|
|
|
&be_native_module(python_compat),
|
2021-11-25 21:57:37 +00:00
|
|
|
&be_native_module(re),
|
2021-07-18 21:39:59 +01:00
|
|
|
&be_native_module(path),
|
2022-02-15 20:58:05 +00:00
|
|
|
&be_native_module(mqtt),
|
2021-10-03 10:54:29 +01:00
|
|
|
&be_native_module(persist),
|
2021-11-13 19:45:27 +00:00
|
|
|
#ifdef USE_AUTOCONF
|
|
|
|
&be_native_module(autoconf),
|
|
|
|
#endif // USE_AUTOCONF
|
2021-11-15 22:06:04 +00:00
|
|
|
&be_native_module(tapp),
|
2021-04-03 17:06:40 +01:00
|
|
|
&be_native_module(gpio),
|
2021-11-13 19:45:27 +00:00
|
|
|
#ifdef USE_DISPLAY
|
|
|
|
&be_native_module(display),
|
|
|
|
#endif // USE_DISPLAY
|
2021-04-24 11:11:06 +01:00
|
|
|
#ifdef USE_LIGHT
|
2021-04-04 18:36:25 +01:00
|
|
|
&be_native_module(light),
|
2021-04-24 11:11:06 +01:00
|
|
|
#endif
|
2022-02-13 21:59:43 +00:00
|
|
|
#if defined(USE_EMULATION) && defined(USE_EMULATION_HUE)
|
|
|
|
&be_native_module(hue_ntv),
|
|
|
|
&be_native_module(hue_bridge),
|
|
|
|
#endif
|
2021-04-19 07:40:11 +01:00
|
|
|
|
2022-01-30 22:05:32 +00:00
|
|
|
&be_native_module(uuid),
|
2021-11-04 07:17:42 +00:00
|
|
|
#ifdef USE_UNISHOX_COMPRESSION
|
|
|
|
&be_native_module(unishox),
|
|
|
|
#endif // USE_UNISHOX_COMPRESSION
|
2021-11-19 21:09:35 +00:00
|
|
|
&be_native_module(animate),
|
2021-11-04 07:17:42 +00:00
|
|
|
|
2021-04-19 07:40:11 +01:00
|
|
|
#ifdef USE_LVGL
|
2021-10-15 18:34:37 +01:00
|
|
|
&be_native_module(lv),
|
2022-01-02 15:16:10 +00:00
|
|
|
&be_native_module(lv_extra),
|
2021-12-27 17:12:38 +00:00
|
|
|
&be_native_module(lv_tasmota),
|
2021-04-19 07:40:11 +01:00
|
|
|
#endif // USE_LVGL
|
2021-04-24 11:11:06 +01:00
|
|
|
#ifdef USE_ENERGY_SENSOR
|
2021-03-13 21:42:24 +00:00
|
|
|
&be_native_module(energy),
|
2021-04-24 11:11:06 +01:00
|
|
|
#endif // USE_ENERGY_SENSOR
|
2021-05-28 21:37:06 +01:00
|
|
|
#ifdef USE_WEBSERVER
|
|
|
|
&be_native_module(webserver),
|
|
|
|
#endif // USE_WEBSERVER
|
2021-06-03 12:23:25 +01:00
|
|
|
&be_native_module(flash),
|
2021-04-24 11:11:06 +01:00
|
|
|
|
2021-02-13 11:01:45 +00:00
|
|
|
|
2021-02-07 19:19:08 +00:00
|
|
|
/* user-defined modules register end */
|
|
|
|
NULL /* do not remove */
|
|
|
|
};
|
2021-03-27 18:02:22 +00:00
|
|
|
|
2021-04-03 18:53:52 +01:00
|
|
|
#ifdef ESP32
|
2021-03-27 18:02:22 +00:00
|
|
|
extern void be_load_tasmota_ntvlib(bvm *vm);
|
2022-02-12 17:54:39 +00:00
|
|
|
extern void be_load_tasmota_log_reader_class(bvm *vm);
|
2022-02-02 21:03:58 +00:00
|
|
|
extern void be_load_light_state_class(bvm *vm);
|
2021-03-27 18:02:22 +00:00
|
|
|
extern void be_load_wirelib(bvm *vm);
|
2021-08-23 19:32:32 +01:00
|
|
|
extern void be_load_onewirelib(bvm *vm);
|
2021-09-14 21:07:20 +01:00
|
|
|
extern void be_load_serial_lib(bvm *vm);
|
2021-07-29 07:37:52 +01:00
|
|
|
extern void be_load_Driver_class(bvm *vm);
|
2022-02-15 21:30:44 +00:00
|
|
|
extern void be_load_Trigger_class(bvm *vm);
|
2021-12-09 18:37:00 +00:00
|
|
|
extern void be_load_I2C_Driver_class(bvm *vm);
|
2021-09-14 07:44:54 +01:00
|
|
|
extern void be_load_AXP192_class(bvm *vm);
|
2021-06-04 22:41:48 +01:00
|
|
|
extern void be_load_md5_lib(bvm *vm);
|
2021-09-02 20:58:08 +01:00
|
|
|
extern void be_load_webclient_lib(bvm *vm);
|
2021-12-11 15:36:29 +00:00
|
|
|
extern void be_load_tcpclient_lib(bvm *vm);
|
2021-12-23 17:35:10 +00:00
|
|
|
extern void be_load_udp_lib(bvm *vm);
|
2021-08-30 20:01:06 +01:00
|
|
|
extern void be_load_crypto_lib(bvm *vm);
|
2022-02-21 21:22:30 +00:00
|
|
|
extern void be_load_ccronexpr_class(bvm *vm);
|
2021-11-18 19:30:16 +00:00
|
|
|
extern void be_load_Leds_ntv_class(bvm *vm);
|
|
|
|
extern void be_load_Leds_class(bvm *vm);
|
|
|
|
extern void be_load_Leds_animator_class(bvm *vm);
|
2021-03-27 18:02:22 +00:00
|
|
|
|
2021-09-22 12:54:20 +01:00
|
|
|
extern void be_load_ctypes_lib(bvm *vm);
|
2021-09-24 17:05:16 +01:00
|
|
|
extern void be_load_ctypes_energy_definitions_lib(bvm *vm);
|
2021-09-22 12:54:20 +01:00
|
|
|
|
2021-07-20 20:05:10 +01:00
|
|
|
#ifdef USE_I2S_AUDIO_BERRY
|
|
|
|
extern void be_load_driver_audio_lib(bvm *vm);
|
2022-01-05 08:50:38 +00:00
|
|
|
extern void be_load_driver_audio_opus_decoder(bvm *vm);
|
2021-07-20 20:05:10 +01:00
|
|
|
#endif
|
|
|
|
|
2021-04-19 07:40:11 +01:00
|
|
|
#ifdef USE_LVGL
|
2021-12-18 10:47:03 +00:00
|
|
|
#include "lv_berry.h"
|
2021-07-22 19:21:18 +01:00
|
|
|
// custom widgets
|
|
|
|
extern void be_load_lv_signal_bars_class(bvm *vm);
|
2021-07-25 18:23:58 +01:00
|
|
|
extern void be_load_lv_wifi_bars_class(bvm *vm);
|
2021-09-08 18:40:18 +01:00
|
|
|
extern void be_load_lv_wifi_bars_icon_class(bvm *vm);
|
|
|
|
extern void be_load_lv_signal_arcs_class(bvm *vm);
|
|
|
|
extern void be_load_lv_wifi_arcs_class(bvm *vm);
|
|
|
|
extern void be_load_lv_wifi_arcs_icon_class(bvm *vm);
|
2021-09-09 19:32:19 +01:00
|
|
|
extern void be_load_lv_clock_icon_class(bvm *vm);
|
2021-04-19 07:40:11 +01:00
|
|
|
#endif// USE_LVGL
|
|
|
|
|
2021-03-27 18:02:22 +00:00
|
|
|
/* this code loads the native class definitions */
|
|
|
|
BERRY_API void be_load_custom_libs(bvm *vm)
|
|
|
|
{
|
|
|
|
(void)vm; /* prevent a compiler warning */
|
|
|
|
|
|
|
|
/* add here custom libs */
|
|
|
|
#if !BE_USE_PRECOMPILED_OBJECT
|
|
|
|
/* be_load_xxxlib(vm); */
|
|
|
|
#endif
|
2022-02-15 21:30:44 +00:00
|
|
|
be_load_Trigger_class(vm);
|
2021-03-27 18:02:22 +00:00
|
|
|
be_load_tasmota_ntvlib(vm);
|
2022-02-12 17:54:39 +00:00
|
|
|
be_load_tasmota_log_reader_class(vm);
|
2021-07-29 07:37:52 +01:00
|
|
|
be_load_Driver_class(vm);
|
2021-06-04 22:41:48 +01:00
|
|
|
be_load_md5_lib(vm);
|
2021-09-14 21:07:20 +01:00
|
|
|
be_load_serial_lib(vm);
|
2021-09-22 12:54:20 +01:00
|
|
|
be_load_ctypes_lib(vm);
|
2022-02-21 21:22:30 +00:00
|
|
|
be_load_ccronexpr_class(vm);
|
2022-02-02 21:03:58 +00:00
|
|
|
#ifdef USE_LIGHT
|
|
|
|
be_load_light_state_class(vm);
|
|
|
|
#endif
|
2021-07-29 18:58:23 +01:00
|
|
|
#ifdef USE_ALEXA_AVS
|
2021-08-30 20:01:06 +01:00
|
|
|
be_load_crypto_lib(vm);
|
2021-07-29 18:58:23 +01:00
|
|
|
#endif
|
2021-04-24 11:11:06 +01:00
|
|
|
#ifdef USE_I2C
|
2021-03-27 18:02:22 +00:00
|
|
|
be_load_wirelib(vm);
|
2021-12-09 18:37:00 +00:00
|
|
|
be_load_I2C_Driver_class(vm);
|
2021-09-14 07:44:54 +01:00
|
|
|
be_load_AXP192_class(vm);
|
2021-04-24 11:11:06 +01:00
|
|
|
#endif // USE_I2C
|
2021-09-24 17:05:16 +01:00
|
|
|
#ifdef USE_ENERGY_SENSOR
|
|
|
|
be_load_ctypes_energy_definitions_lib(vm);
|
|
|
|
#endif // USE_ENERGY_SENSOR
|
2021-09-02 20:58:08 +01:00
|
|
|
#ifdef USE_WEBCLIENT
|
|
|
|
be_load_webclient_lib(vm);
|
2021-12-11 15:36:29 +00:00
|
|
|
be_load_tcpclient_lib(vm);
|
2021-12-23 17:35:10 +00:00
|
|
|
be_load_udp_lib(vm);
|
2021-09-02 20:58:08 +01:00
|
|
|
#endif // USE_WEBCLIENT
|
2021-08-23 19:32:32 +01:00
|
|
|
#if defined(USE_ONEWIRE) || defined(USE_DS18x20)
|
|
|
|
be_load_onewirelib(vm);
|
|
|
|
#endif
|
2021-11-18 19:30:16 +00:00
|
|
|
#ifdef USE_WS2812
|
|
|
|
be_load_Leds_ntv_class(vm);
|
|
|
|
be_load_Leds_class(vm);
|
|
|
|
be_load_Leds_animator_class(vm);
|
|
|
|
#endif // USE_WS2812
|
2021-07-20 20:05:10 +01:00
|
|
|
#ifdef USE_I2S_AUDIO_BERRY
|
|
|
|
be_load_driver_audio_lib(vm);
|
2022-01-05 08:50:38 +00:00
|
|
|
be_load_driver_audio_opus_decoder(vm);
|
2021-07-20 20:05:10 +01:00
|
|
|
#endif
|
2021-04-19 07:40:11 +01:00
|
|
|
#ifdef USE_LVGL
|
|
|
|
// LVGL
|
2021-12-18 10:47:03 +00:00
|
|
|
be_load_lvgl_classes(vm);
|
2021-07-22 19:21:18 +01:00
|
|
|
// custom widgets
|
|
|
|
be_load_lv_signal_bars_class(vm);
|
2021-07-25 18:23:58 +01:00
|
|
|
be_load_lv_wifi_bars_class(vm);
|
2021-09-08 18:40:18 +01:00
|
|
|
be_load_lv_wifi_bars_icon_class(vm);
|
|
|
|
be_load_lv_signal_arcs_class(vm);
|
|
|
|
be_load_lv_wifi_arcs_class(vm);
|
|
|
|
be_load_lv_wifi_arcs_icon_class(vm);
|
2021-09-09 19:32:19 +01:00
|
|
|
be_load_lv_clock_icon_class(vm);
|
2021-04-19 07:40:11 +01:00
|
|
|
#endif // USE_LVGL
|
2022-01-17 19:47:32 +00:00
|
|
|
#if defined(USE_MI_ESP32) && !defined(USE_BLE_ESP32)
|
2022-01-17 18:51:27 +00:00
|
|
|
be_load_MI32_class(vm);
|
|
|
|
be_load_BLE_class(vm);
|
|
|
|
#endif //USE_MI_ESP32
|
2021-03-27 18:02:22 +00:00
|
|
|
}
|
2021-04-03 18:53:52 +01:00
|
|
|
#endif
|