Browse Source

add:luatos支持little_flash并添加demo

Dozingfiretruck 1 year ago
parent
commit
f81f850af2

+ 5 - 5
components/little_flash/inc/little_flash_define.h

@@ -34,11 +34,11 @@ typedef struct little_flash little_flash_t;
 #ifndef LF_DEBUG
 #define LF_DEBUG(...)  LF_PRINTF(__VA_ARGS__)
 #endif
-#define LF_ASSERT(EXPR)                                                      \
-if (!(EXPR))                                                                   \
-{                                                                              \
-    LF_PRINTF("(%s) has assert failed at %s.", #EXPR, __FUNCTION__);          \
-    while (1);                                                                 \
+#define LF_ASSERT(EXPR)                                                         \
+if (!(EXPR))                                                                    \
+{                                                                               \
+    LF_PRINTF("(%s) has assert failed at %s.", #EXPR, __FUNCTION__);            \
+    while (1);                                                                  \
 }
 #else
 #ifndef LF_DEBUG

+ 95 - 0
components/little_flash/luat_lib_little_flash.c

@@ -0,0 +1,95 @@
+/*
+@module  little_flash
+@summary LITTLE FLASH 软件包
+@version 1.0
+@date    2024.05.11
+@demo little_flash
+@tag LUAT_USE_LITTLE_FLASH
+*/
+
+#include "luat_base.h"
+#include "luat_spi.h"
+#include "luat_mem.h"
+
+#define LUAT_LOG_TAG "little_flash"
+#include "luat_log.h"
+#include "little_flash.h"
+
+static little_flash_t lf_flash = {0};
+
+/*
+初始化 little_flash
+@api  lf.init(spi_device)
+@int  userdata spi_device
+@return userdata 成功返回一个数据结构,否则返回nil
+@usage
+--spi_device
+local spi_device = spi.deviceSetup(0,17,0,0,8,2000000,spi.MSB,1,0)
+log.info("lf.init",lf.init(spi_device))
+*/
+static int luat_little_flash_init(lua_State *L){
+    static luat_spi_device_t* little_flash_spi_device = NULL;
+    if (lua_type(L, 1) == LUA_TUSERDATA){
+        little_flash_spi_device = (luat_spi_device_t*)lua_touserdata(L, 1);
+        lf_flash.spi.user_data = little_flash_spi_device;
+    }
+    little_flash_init();
+    int re = little_flash_device_init(&lf_flash);
+    lua_pushlightuserdata(L, &lf_flash);
+    return 1;
+}
+
+#ifdef LUAT_USE_FS_VFS
+#include "luat_fs.h"
+#include "lfs.h"
+extern lfs_t* flash_lfs_lf(little_flash_t* flash, size_t offset, size_t maxsize);
+
+/*
+挂载 little_flash lfs文件系统
+@api  lf.mount(flash, mount_point, offset, maxsize)
+@userdata flash Flash 设备对象 lf.init()返回的数据结构
+@string mount_point 挂载目录名
+@int    起始偏移量,默认0
+@int    总大小, 默认是整个flash
+@return bool 成功返回true
+@usage
+log.info("lf.mount",lf.mount(little_flash_device,"/little_flash"))
+*/
+static int luat_little_flash_mount(lua_State *L) {
+    const little_flash_t *flash = lua_touserdata(L, 1);
+    const char* mount_point = luaL_checkstring(L, 2);
+    size_t offset = luaL_optinteger(L, 3, 0);
+    size_t maxsize = luaL_optinteger(L, 4, 0);
+    lfs_t* lfs = flash_lfs_lf(flash, offset, maxsize);
+    if (lfs) {
+	    luat_fs_conf_t conf = {
+		    .busname = (char*)lfs,
+		    .type = "lfs2",
+		    .filesystem = "lfs2",
+		    .mount_point = mount_point,
+	    };
+	    int ret = luat_fs_mount(&conf);
+        LLOGD("vfs mount %s ret %d", mount_point, ret);
+        lua_pushboolean(L, 1);
+    }
+    else {
+        lua_pushboolean(L, 0);
+    }
+    return 1;
+}
+#endif
+
+#include "rotable2.h"
+static const rotable_Reg_t reg_little_flash[] =
+{
+    { "init",           ROREG_FUNC(luat_little_flash_init)},
+#ifdef LUAT_USE_FS_VFS
+    { "mount",          ROREG_FUNC(luat_little_flash_mount)},
+#endif
+	{ NULL,             ROREG_INT(0)}
+};
+
+LUAMOD_API int luaopen_little_flash( lua_State *L ) {
+    luat_newlib2(L, reg_little_flash);
+    return 1;
+}

+ 6 - 4
components/little_flash/luat_little_flash_lfs2.c

@@ -6,6 +6,8 @@
 #define LUAT_LOG_TAG "little_flash"
 #include "luat_log.h"
 
+#ifdef LUAT_USE_LITTLE_FLASH
+
 #ifdef LUAT_USE_FS_VFS
 #include "lfs.h"
 #include "little_flash.h"
@@ -17,7 +19,7 @@ static int lf_block_device_read(const struct lfs_config *cfg, lfs_block_t block,
     little_flash_t* flash = (little_flash_t*)cfg->context;
     // int ret = lf_read(flash, lf_offset + block * flash->chip.erase_gran + off, size, buffer);
     int ret = little_flash_read(flash, lf_offset + block * flash->chip_info.erase_size + off, buffer, size);
-    // LUAT_DEBUG_PRINT("lf_block_device_read ret %d", ret);
+    // LLOGD("lf_block_device_read ret %d", ret);
     return ret;
 }
 
@@ -25,7 +27,7 @@ static int lf_block_device_prog(const struct lfs_config *cfg, lfs_block_t block,
     little_flash_t* flash = (little_flash_t*)cfg->context;
     // int ret = lf_write(flash, lf_offset + block * flash->chip.erase_gran + off, size, buffer);
     int ret = little_flash_write(flash, lf_offset + block * flash->chip_info.erase_size + off, buffer, size);
-    // LUAT_DEBUG_PRINT("lf_block_device_prog ret %d", ret);
+    // LLOGD("lf_block_device_prog ret %d", ret);
     return ret;
 }
 
@@ -33,7 +35,7 @@ static int lf_block_device_erase(const struct lfs_config *cfg, lfs_block_t block
     little_flash_t* flash = (little_flash_t*)cfg->context;
     // int ret = lf_erase(flash, lf_offset + block * flash->chip.erase_gran, flash->chip.erase_gran);
     int ret = little_flash_erase(flash, lf_offset + block * flash->chip_info.erase_size, flash->chip_info.erase_size);
-    // LUAT_DEBUG_PRINT("lf_block_device_erase ret %d", ret);
+    // LLOGD("lf_block_device_erase ret %d", ret);
     return ret;
 }
 
@@ -103,4 +105,4 @@ fail :
 
 #endif
 
-
+#endif

+ 3 - 3
components/little_flash/port/little_flash_config.h

@@ -1,15 +1,15 @@
 #ifndef _LITTLE_FLASH_CONFIG_H_
 #define _LITTLE_FLASH_CONFIG_H_
 
-#include "luat_debug.h"
-
+#define LUAT_LOG_TAG "little_flash"
+#include "luat_log.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /* define the printf function for little flash */
-#define LF_PRINTF LUAT_DEBUG_PRINT
+#define LF_PRINTF LLOGI
 
 #define LF_DEBUG_MODE                   /* enable debug mode for little flash */
 

+ 93 - 0
demo/little_flash/main.lua

@@ -0,0 +1,93 @@
+
+-- LuaTools需要PROJECT和VERSION这两个信息
+PROJECT = "little_flash demo"
+VERSION = "1.0.0"
+
+log.info("main", PROJECT, VERSION)
+
+sys = require("sys")
+
+--添加硬狗防止程序卡死
+if wdt then
+    wdt.init(9000)--初始化watchdog设置为9s
+    sys.timerLoopStart(wdt.feed, 3000)--3s喂一次狗
+end
+
+-- spi_id,pin_cs
+local function little_flash_spi_pin()
+    local rtos_bsp = rtos.bsp()
+    if rtos_bsp == "AIR101" then
+        return 0,pin.PB04
+    elseif rtos_bsp == "AIR103" then
+        return 0,pin.PB04
+    elseif rtos_bsp == "AIR105" then
+        return 5,pin.PC14
+    elseif rtos_bsp == "ESP32C3" then
+        return 2,7
+    elseif rtos_bsp == "ESP32S3" then
+        return 2,14
+    elseif rtos_bsp == "EC618" then
+        return 0,8
+    elseif rtos_bsp == "EC718P" then
+        return 0,8
+    else
+        log.info("main", "bsp not support")
+        return
+    end
+end
+
+sys.taskInit(function()
+    -- log.info("等5秒")
+    sys.wait(1000)
+    local spi_id,pin_cs = little_flash_spi_pin() 
+    if not spi_id then
+        while 1 do
+            sys.wait(1000)
+            log.info("main", "bsp not support yet")
+        end
+    end
+
+    log.info("lf", "SPI", spi_id, "CS PIN", pin_cs)
+    spi_flash = spi.deviceSetup(spi_id,pin_cs,0,0,8,20*1000*1000,spi.MSB,1,0)
+    log.info("lf", "spi_flash", spi_flash)
+    little_flash_device = lf.init(spi_flash)
+    if little_flash_device then
+        log.info("lf.init ok")
+    else
+        log.info("lf.init Error")
+        return
+    end
+
+    if lf.mount then
+        local ret = lf.mount(little_flash_device,"/little_flash")
+        log.info("lf.mount", ret)
+        if ret then
+            log.info("little_flash", "挂载成功")
+            log.info("fsstat", fs.fsstat("/little_flash"))
+            
+            -- 挂载成功后,可以像操作文件一样操作
+            local f = io.open("/little_flash/test", "w")
+            f:write(os.date())
+            f:close()
+
+            log.info("little_flash", io.readFile("/little_flash/test"))
+
+            -- 文件追加
+            os.remove("/little_flash/test2")
+            io.writeFile("/little_flash/test2", "LuatOS")
+            local f = io.open("/little_flash/test2", "a+")
+            f:write(" - " .. os.date())
+            f:close()
+
+            log.info("little_flash", io.readFile("/little_flash/test2"))
+        else
+            log.info("little_flash", "挂载失败")
+        end
+    end
+end)
+
+
+-- 用户代码已结束---------------------------------------------
+-- 结尾总是这一句
+sys.run()
+-- sys.run()之后后面不要加任何语句!!!!!

+ 196 - 194
luat/include/luat_libs.h

@@ -1,194 +1,196 @@
-
-#ifndef LUAT_LIBS_H
-#define LUAT_LIBS_H
-#include "lua.h"
-#include "lauxlib.h"
-
-
-/** sys库, 预留, 实际不可用状态*/
-LUAMOD_API int luaopen_sys( lua_State *L );
-/** rtos库*/
-LUAMOD_API int luaopen_rtos( lua_State *L );
-/** timer库*/
-LUAMOD_API int luaopen_timer( lua_State *L );
-/** msgbus库, 预留, 实际不可用状态*/
-// LUAMOD_API int luaopen_msgbus( lua_State *L );
-/** gpio库*/
-LUAMOD_API int luaopen_gpio( lua_State *L );
-/** adc库*/
-LUAMOD_API int luaopen_adc( lua_State *L );
-/** pwm库*/
-LUAMOD_API int luaopen_pwm( lua_State *L );
-/** uart库*/
-LUAMOD_API int luaopen_uart( lua_State *L );
-/** pm库*/
-LUAMOD_API int luaopen_pm( lua_State *L );
-/** fs库*/
-LUAMOD_API int luaopen_fs( lua_State *L );
-/** wlan库*/
-LUAMOD_API int luaopen_wlan( lua_State *L );
-/** socket库*/
-LUAMOD_API int luaopen_socket( lua_State *L );
-/** sensor库*/
-LUAMOD_API int luaopen_sensor( lua_State *L );
-/** log库*/
-LUAMOD_API int luaopen_log( lua_State *L );
-/** json库*/
-LUAMOD_API int luaopen_cjson( lua_State *L );
-/** i2c库*/
-LUAMOD_API int luaopen_i2c( lua_State *L );
-/** spi库*/
-LUAMOD_API int luaopen_spi( lua_State *L );
-/** disp库*/
-LUAMOD_API int luaopen_disp( lua_State *L );
-/** u8g2库*/
-LUAMOD_API int luaopen_u8g2( lua_State *L );
-/** sfud库*/
-LUAMOD_API int luaopen_sfud( lua_State *L );
-/** utest库*/
-// LUAMOD_API int luaopen_utest( lua_State *L );
-/** mqtt库*/
-LUAMOD_API int luaopen_mqtt( lua_State *L );
-/** http库*/
-LUAMOD_API int luaopen_http( lua_State *L );
-/** pack库*/
-LUAMOD_API int luaopen_pack( lua_State *L );
-/** mqttcore库*/
-LUAMOD_API int luaopen_mqttcore( lua_State *L );
-/** crypto库*/
-LUAMOD_API int luaopen_crypto( lua_State *L );
-LUAMOD_API int luaopen_gmssl( lua_State *L );
-/** 功耗调整 */
-LUAMOD_API int luaopen_pm( lua_State *L);
-LUAMOD_API int luaopen_m2m( lua_State *L);
-LUAMOD_API int luaopen_libcoap( lua_State *L);
-LUAMOD_API int luaopen_lpmem( lua_State *L);
-LUAMOD_API int luaopen_ctiot( lua_State *L);
-LUAMOD_API int luaopen_iconv(lua_State *L);
-LUAMOD_API int luaopen_nbiot( lua_State *L );
-LUAMOD_API int luaopen_libgnss( lua_State *L ) ;
-LUAMOD_API int luaopen_fatfs( lua_State *L );
-LUAMOD_API int luaopen_eink( lua_State *L);
-LUAMOD_API int luaopen_dbg( lua_State *L );
-/** zbuff库*/
-LUAMOD_API int luaopen_zbuff( lua_State *L );
-
-LUAMOD_API int luaopen_sfd( lua_State *L );
-LUAMOD_API int luaopen_lfs2( lua_State *L );
-LUAMOD_API int luaopen_lvgl( lua_State *L );
-
-/** ir库, 依赖gpio库*/
-LUAMOD_API int luaopen_ir( lua_State *L );
-
-LUAMOD_API int luaopen_lcd( lua_State *L );
-LUAMOD_API int luaopen_lwip( lua_State *L );
-
-LUAMOD_API int luaopen_wdt( lua_State *L );
-LUAMOD_API int luaopen_mcu( lua_State *L );
-LUAMOD_API int luaopen_hwtimer( lua_State *L );
-LUAMOD_API int luaopen_rtc( lua_State *L );
-LUAMOD_API int luaopen_sdio( lua_State *L );
-
-LUAMOD_API int luaopen_statem( lua_State *L );
-LUAMOD_API int luaopen_vmx( lua_State *L );
-LUAMOD_API int luaopen_lcdseg( lua_State *L );
-
-LUAMOD_API int luaopen_fdb( lua_State *L );
-
-LUAMOD_API int luaopen_keyboard( lua_State *L );
-LUAMOD_API int luaopen_coremark( lua_State *L );
-
-LUAMOD_API int luaopen_fonts( lua_State *L );
-LUAMOD_API int luaopen_gtfont( lua_State *L );
-
-LUAMOD_API int luaopen_pin( lua_State *L );
-LUAMOD_API int luaopen_dac( lua_State *L );
-LUAMOD_API int luaopen_otp( lua_State *L );
-LUAMOD_API int luaopen_mlx90640( lua_State *L );
-LUAMOD_API int luaopen_zlib( lua_State *L );
-LUAMOD_API int luaopen_camera( lua_State *L );
-LUAMOD_API int luaopen_multimedia_audio( lua_State *L );
-LUAMOD_API int luaopen_multimedia_video( lua_State *L );
-LUAMOD_API int luaopen_multimedia_codec( lua_State *L );
-LUAMOD_API int luaopen_luf( lua_State *L );
-
-LUAMOD_API int luaopen_touchkey(lua_State *L);
-LUAMOD_API int luaopen_softkb( lua_State *L );
-LUAMOD_API int luaopen_nes( lua_State *L );
-
-LUAMOD_API int luaopen_io_queue( lua_State *L );
-LUAMOD_API int luaopen_ymodem( lua_State *L );
-LUAMOD_API int luaopen_w5500( lua_State *L );
-LUAMOD_API int luaopen_socket_adapter( lua_State *L );
-
-LUAMOD_API int luaopen_airui( lua_State *L );
-LUAMOD_API int luaopen_fota( lua_State *L );
-LUAMOD_API int luaopen_i2s( lua_State *L );
-LUAMOD_API int luaopen_lora( lua_State *L );
-LUAMOD_API int luaopen_lora2( lua_State *L );
-LUAMOD_API int luaopen_iotauth( lua_State *L );
-LUAMOD_API int luaopen_ufont( lua_State *L );
-LUAMOD_API int luaopen_miniz( lua_State *L );
-LUAMOD_API int luaopen_mobile( lua_State *L );
-
-LUAMOD_API int luaopen_protobuf( lua_State *L );
-
-LUAMOD_API int luaopen_httpsrv( lua_State *L );
-LUAMOD_API int luaopen_rsa( lua_State *L );
-
-LUAMOD_API int luaopen_websocket( lua_State *L );
-
-
-LUAMOD_API int luaopen_ftp( lua_State *L );
-LUAMOD_API int luaopen_hmeta( lua_State *L );
-LUAMOD_API int luaopen_sms( lua_State *L );
-LUAMOD_API int luaopen_errdump( lua_State *L );
-LUAMOD_API int luaopen_profiler( lua_State *L );
-LUAMOD_API int luaopen_fskv( lua_State *L );
-LUAMOD_API int luaopen_max30102( lua_State *L );
-
-LUAMOD_API int luaopen_bit64( lua_State *L );
-
-LUAMOD_API int luaopen_repl( lua_State *L );
-
-
-LUAMOD_API int luaopen_fastlz( lua_State *L );
-
-LUAMOD_API int luaopen_usernet( lua_State *L );
-
-LUAMOD_API int luaopen_ercoap( lua_State *L );
-
-LUAMOD_API int luaopen_sqlite3( lua_State *L );
-
-LUAMOD_API int luaopen_ws2812( lua_State *L );
-
-LUAMOD_API int luaopen_onewire( lua_State *L );
-
-// 蚂蚁链
-LUAMOD_API int luaopen_antbot( lua_State *L );
-
-// xxtea加解密, 强度其实很低
-LUAMOD_API int luaopen_xxtea( lua_State *L );
-
-// 电话功能
-LUAMOD_API int luaopen_cc( lua_State *L );
-
-// 用户侧LWIP集成, 用于对接以太网,wifi等第三方网络设备,通常是SPI或者SDIO协议
-LUAMOD_API int luaopen_ulwip( lua_State *L );
-
-// 基于真正的cjson做的json解析库,未完成
-LUAMOD_API int luaopen_json2( lua_State *L );
-
-// SPI 从机
-LUAMOD_API int luaopen_spislave( lua_State *L );
-
-// WLAN 裸数据收发
-LUAMOD_API int luaopen_wlan_raw(lua_State *L);
-
-// 液晶屏驱动
-LUAMOD_API int luaopen_ht1621(lua_State *L);
-
-// NAPT
-LUAMOD_API int luaopen_napt(lua_State *L);
-
-#endif
+
+#ifndef LUAT_LIBS_H
+#define LUAT_LIBS_H
+#include "lua.h"
+#include "lauxlib.h"
+
+
+/** sys库, 预留, 实际不可用状态*/
+LUAMOD_API int luaopen_sys( lua_State *L );
+/** rtos库*/
+LUAMOD_API int luaopen_rtos( lua_State *L );
+/** timer库*/
+LUAMOD_API int luaopen_timer( lua_State *L );
+/** msgbus库, 预留, 实际不可用状态*/
+// LUAMOD_API int luaopen_msgbus( lua_State *L );
+/** gpio库*/
+LUAMOD_API int luaopen_gpio( lua_State *L );
+/** adc库*/
+LUAMOD_API int luaopen_adc( lua_State *L );
+/** pwm库*/
+LUAMOD_API int luaopen_pwm( lua_State *L );
+/** uart库*/
+LUAMOD_API int luaopen_uart( lua_State *L );
+/** pm库*/
+LUAMOD_API int luaopen_pm( lua_State *L );
+/** fs库*/
+LUAMOD_API int luaopen_fs( lua_State *L );
+/** wlan库*/
+LUAMOD_API int luaopen_wlan( lua_State *L );
+/** socket库*/
+LUAMOD_API int luaopen_socket( lua_State *L );
+/** sensor库*/
+LUAMOD_API int luaopen_sensor( lua_State *L );
+/** log库*/
+LUAMOD_API int luaopen_log( lua_State *L );
+/** json库*/
+LUAMOD_API int luaopen_cjson( lua_State *L );
+/** i2c库*/
+LUAMOD_API int luaopen_i2c( lua_State *L );
+/** spi库*/
+LUAMOD_API int luaopen_spi( lua_State *L );
+/** disp库*/
+LUAMOD_API int luaopen_disp( lua_State *L );
+/** u8g2库*/
+LUAMOD_API int luaopen_u8g2( lua_State *L );
+/** sfud库*/
+LUAMOD_API int luaopen_sfud( lua_State *L );
+/** little_flash库*/
+LUAMOD_API int luaopen_little_flash( lua_State *L );
+/** utest库*/
+// LUAMOD_API int luaopen_utest( lua_State *L );
+/** mqtt库*/
+LUAMOD_API int luaopen_mqtt( lua_State *L );
+/** http库*/
+LUAMOD_API int luaopen_http( lua_State *L );
+/** pack库*/
+LUAMOD_API int luaopen_pack( lua_State *L );
+/** mqttcore库*/
+LUAMOD_API int luaopen_mqttcore( lua_State *L );
+/** crypto库*/
+LUAMOD_API int luaopen_crypto( lua_State *L );
+LUAMOD_API int luaopen_gmssl( lua_State *L );
+/** 功耗调整 */
+LUAMOD_API int luaopen_pm( lua_State *L);
+LUAMOD_API int luaopen_m2m( lua_State *L);
+LUAMOD_API int luaopen_libcoap( lua_State *L);
+LUAMOD_API int luaopen_lpmem( lua_State *L);
+LUAMOD_API int luaopen_ctiot( lua_State *L);
+LUAMOD_API int luaopen_iconv(lua_State *L);
+LUAMOD_API int luaopen_nbiot( lua_State *L );
+LUAMOD_API int luaopen_libgnss( lua_State *L ) ;
+LUAMOD_API int luaopen_fatfs( lua_State *L );
+LUAMOD_API int luaopen_eink( lua_State *L);
+LUAMOD_API int luaopen_dbg( lua_State *L );
+/** zbuff库*/
+LUAMOD_API int luaopen_zbuff( lua_State *L );
+
+LUAMOD_API int luaopen_sfd( lua_State *L );
+LUAMOD_API int luaopen_lfs2( lua_State *L );
+LUAMOD_API int luaopen_lvgl( lua_State *L );
+
+/** ir库, 依赖gpio库*/
+LUAMOD_API int luaopen_ir( lua_State *L );
+
+LUAMOD_API int luaopen_lcd( lua_State *L );
+LUAMOD_API int luaopen_lwip( lua_State *L );
+
+LUAMOD_API int luaopen_wdt( lua_State *L );
+LUAMOD_API int luaopen_mcu( lua_State *L );
+LUAMOD_API int luaopen_hwtimer( lua_State *L );
+LUAMOD_API int luaopen_rtc( lua_State *L );
+LUAMOD_API int luaopen_sdio( lua_State *L );
+
+LUAMOD_API int luaopen_statem( lua_State *L );
+LUAMOD_API int luaopen_vmx( lua_State *L );
+LUAMOD_API int luaopen_lcdseg( lua_State *L );
+
+LUAMOD_API int luaopen_fdb( lua_State *L );
+
+LUAMOD_API int luaopen_keyboard( lua_State *L );
+LUAMOD_API int luaopen_coremark( lua_State *L );
+
+LUAMOD_API int luaopen_fonts( lua_State *L );
+LUAMOD_API int luaopen_gtfont( lua_State *L );
+
+LUAMOD_API int luaopen_pin( lua_State *L );
+LUAMOD_API int luaopen_dac( lua_State *L );
+LUAMOD_API int luaopen_otp( lua_State *L );
+LUAMOD_API int luaopen_mlx90640( lua_State *L );
+LUAMOD_API int luaopen_zlib( lua_State *L );
+LUAMOD_API int luaopen_camera( lua_State *L );
+LUAMOD_API int luaopen_multimedia_audio( lua_State *L );
+LUAMOD_API int luaopen_multimedia_video( lua_State *L );
+LUAMOD_API int luaopen_multimedia_codec( lua_State *L );
+LUAMOD_API int luaopen_luf( lua_State *L );
+
+LUAMOD_API int luaopen_touchkey(lua_State *L);
+LUAMOD_API int luaopen_softkb( lua_State *L );
+LUAMOD_API int luaopen_nes( lua_State *L );
+
+LUAMOD_API int luaopen_io_queue( lua_State *L );
+LUAMOD_API int luaopen_ymodem( lua_State *L );
+LUAMOD_API int luaopen_w5500( lua_State *L );
+LUAMOD_API int luaopen_socket_adapter( lua_State *L );
+
+LUAMOD_API int luaopen_airui( lua_State *L );
+LUAMOD_API int luaopen_fota( lua_State *L );
+LUAMOD_API int luaopen_i2s( lua_State *L );
+LUAMOD_API int luaopen_lora( lua_State *L );
+LUAMOD_API int luaopen_lora2( lua_State *L );
+LUAMOD_API int luaopen_iotauth( lua_State *L );
+LUAMOD_API int luaopen_ufont( lua_State *L );
+LUAMOD_API int luaopen_miniz( lua_State *L );
+LUAMOD_API int luaopen_mobile( lua_State *L );
+
+LUAMOD_API int luaopen_protobuf( lua_State *L );
+
+LUAMOD_API int luaopen_httpsrv( lua_State *L );
+LUAMOD_API int luaopen_rsa( lua_State *L );
+
+LUAMOD_API int luaopen_websocket( lua_State *L );
+
+
+LUAMOD_API int luaopen_ftp( lua_State *L );
+LUAMOD_API int luaopen_hmeta( lua_State *L );
+LUAMOD_API int luaopen_sms( lua_State *L );
+LUAMOD_API int luaopen_errdump( lua_State *L );
+LUAMOD_API int luaopen_profiler( lua_State *L );
+LUAMOD_API int luaopen_fskv( lua_State *L );
+LUAMOD_API int luaopen_max30102( lua_State *L );
+
+LUAMOD_API int luaopen_bit64( lua_State *L );
+
+LUAMOD_API int luaopen_repl( lua_State *L );
+
+
+LUAMOD_API int luaopen_fastlz( lua_State *L );
+
+LUAMOD_API int luaopen_usernet( lua_State *L );
+
+LUAMOD_API int luaopen_ercoap( lua_State *L );
+
+LUAMOD_API int luaopen_sqlite3( lua_State *L );
+
+LUAMOD_API int luaopen_ws2812( lua_State *L );
+
+LUAMOD_API int luaopen_onewire( lua_State *L );
+
+// 蚂蚁链
+LUAMOD_API int luaopen_antbot( lua_State *L );
+
+// xxtea加解密, 强度其实很低
+LUAMOD_API int luaopen_xxtea( lua_State *L );
+
+// 电话功能
+LUAMOD_API int luaopen_cc( lua_State *L );
+
+// 用户侧LWIP集成, 用于对接以太网,wifi等第三方网络设备,通常是SPI或者SDIO协议
+LUAMOD_API int luaopen_ulwip( lua_State *L );
+
+// 基于真正的cjson做的json解析库,未完成
+LUAMOD_API int luaopen_json2( lua_State *L );
+
+// SPI 从机
+LUAMOD_API int luaopen_spislave( lua_State *L );
+
+// WLAN 裸数据收发
+LUAMOD_API int luaopen_wlan_raw(lua_State *L);
+
+// 液晶屏驱动
+LUAMOD_API int luaopen_ht1621(lua_State *L);
+
+// NAPT
+LUAMOD_API int luaopen_napt(lua_State *L);
+
+#endif