Skip to content

flamebox/elua_stm32f4

Repository files navigation

stm32f4 discovery上的elua源码移植

在官方源码的基础上增加了Rtc模块,以实现智能方案脚本的核心功能。

Documentation

一、如何编译
1、编译命令:lua build_elua.lua board=myboard prog
   将生成elua_lua_myboard.bin 和 elua_lua_myboard.hex 两个可烧录文件
2、lua build_elua.lua board=myboard -c ,相当于make clean

二、如何烧写
1、烧写命令:st-flash write elua_lua_myboard.bin 0x8000000

三、elua注册的RTC方法
1、stm32f4.rtc.gettime()
  功能:从rtc获取当前的UNIX时间戳
  参数:无
  返回:UNIX时间戳

2、stm32f4.rtc.getdate()
  功能:从rtc获取当前的详细时间
  参数:无
  返回:一个时间table,格式为{year=yy,month=mon,day=dd,hour=hh,min=mm,sec=ss}

3、stm32f4.rtc.gettime_format(table)
  功能:输入一个时间table,返回对应的UNIX时间戳
  参数:时间table,格式为{year=yy,month=mon,day=dd,hour=hh,min=mm,sec=ss}
  返回:UNIX时间戳

4、stm32f4.rtc.set(time)
  功能:设置硬件rtc时间
  参数:要设置的时间,以UNIX时间戳输入
  返回:无

filesystem

1、/romfs
  将lua脚本放在此目录一起编译,脚本将会在elua文件系统的/rom文件夹中。只读属性。
  其中:
  test.lua      led闪烁测试脚本
  time.lua      RTC接口测试程序
  lua.lua       智能方案脚本移植测试脚本
  room.lua      精准通风智能方案测试脚本。注:运行前必须要将level.txt和table.lua上传到/wo文件夹内

About

在stm32f4 discovery上移植elua

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published