Skip to content

Commit

Permalink
发布script_LuaTask(V2.3.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhutianhua committed Apr 23, 2020
1 parent b755ded commit cd3ed21
Show file tree
Hide file tree
Showing 52 changed files with 331 additions and 71 deletions.
14 changes: 10 additions & 4 deletions core/readme.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
Air72XU系列的模块Flash总空间都为64Mb=8MB
用户二次开发有两个分区可用,脚本区和文件系统区

脚本区:通过Luatools烧写的所有文件,都存放在此区域
非TTS版本为700KB,TTS版本为426KB
不同版本的core可能会有差异,以版本每次的更新记录为准

用户二次开发有两个分区可用,脚本区和文件系统区
脚本区:通过Luatools烧写的所有文件,都存放在此区域,目前总空间为700KB,不同版本的core可能会有差异,以版本每次的更新记录为准
文件系统区:程序运行过程中实时创建的文件都会存放在此区域,目前总空间为1.4MB,不同版本的core可能会有差异,可通过rtos.get_fs_free_size()查询剩余的文件系统可用空间

文件系统区:程序运行过程中实时创建的文件都会存放在此区域
总空间为1.2MB
不同版本的core可能会有差异,可通过rtos.get_fs_free_size()查询剩余的文件系统可用空间



Expand All @@ -12,5 +17,6 @@


Air720XU系列模块的RAM总空间都为128Mb=16MB
其中Lua运行可用内存1180KB,可通过base.collectgarbage("count")查询已经使用的内存空间(返回值单位为KB)

其中Lua运行可用内存:非TTS版本为1180KB,TTS版本为900KB
可通过collectgarbage("count")查询已经使用的内存空间(返回值单位为KB)
27 changes: 27 additions & 0 deletions core/release notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
版本号:Luat_V0008_RDA8910.pac
发布时间:2020/4/12 15:00
修改记录:
(1)修正“png格式图片显示色彩失真”的问题
(2)支持“rsa加解密”功能
(3)支持ldo vsim1电压域的设置,修改“GPIO29、30、31无法控制”的问题
(4)修正“GPIO6无法正常使用”的问题
(5)修改字体为宋体格式



版本号:Luat_V0007_RDA8910_TTS_FLOAT.pac
发布时间:2020/4/12 15:00
修改记录:
(1)支持TTS功能
(2)支持“Luat串口日志输出”功能
(3)支持“音频播放”功能
(4)修正“SSL服务器连接失败”的问题
(5)支持“ldo电压域设置”功能
(6)支持“浮点数运算和math库”功能
(7)支持“disp库”功能



版本号:Luat_V0003_RDA8910.lod
修改记录:
(1)第一次发布
12 changes: 12 additions & 0 deletions script_LuaTask/demo/audio/testAudio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,15 @@ else
end


--[[
sys.taskInit(function()
while true do
audio.setChannel(1)
sys.wait(5000)
audio.setChannel(2)
sys.wait(5000)
end
end)
]]


11 changes: 9 additions & 2 deletions script_LuaTask/demo/gpio/gpioSingle/testGpioSingle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ require"pins"

--[[
有些GPIO需要打开对应的ldo电压域才能正常工作,电压域和对应的GPIO关系如下
pmd.ldoset(x,pmd.LDO_VSIM2) -- GPIO 29、30、31 --目前core版本还不支持
pmd.ldoset(x,pmd.LDO_VLCD) -- GPIO 0、1、2、3、4、6 --目前core版本,x还控制不了不同等级的电压,都是1.8V
pmd.ldoset(x,pmd.LDO_VSIM1) -- GPIO 29、30、31
pmd.ldoset(x,pmd.LDO_VLCD) -- GPIO 0、1、2、3、4、6
pmd.ldoset(x,pmd.LDO_VMMC) -- GPIO 24、25、26、27、28
x=0时:关闭LDO
x=1时:LDO输出1.716V
Expand Down Expand Up @@ -74,10 +74,16 @@ levelTest = 0
pmd.ldoset(15,pmd.LDO_VMMC)
pins.setup(pio.P0_27,1)
pmd.ldoset(15,pmd.LDO_VSIM1)
pins.setup(pio.P0_29,1)
pins.setup(pio.P0_30,1)
pins.setup(pio.P0_31,1)
sys.timerLoopStart(function()
pmd.ldoset(levelTest,pmd.LDO_VMMC)
pmd.ldoset(levelTest,pmd.LDO_VLCD)
pmd.ldoset(levelTest,pmd.LDO_VSIM1)
log.info("levelTest",levelTest)
levelTest = levelTest+1
Expand All @@ -87,3 +93,4 @@ end,10000)




Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,23 @@ local ip, port, c = "180.97.80.55", "12415"

-- 异步接口演示代码
local asyncClient
local clientConnected
sys.taskInit(function()
while true do
while not socket.isReady() do sys.wait(1000) end
asyncClient = socket.tcp()
while not asyncClient:connect(ip, port) do sys.wait(2000) end
clientConnected = true
while asyncClient:asyncSelect(60, "ping") do end
clientConnected = false
asyncClient:close()
end
end)

-- 测试代码,用于异步发送消息
-- 这里演示如何用非线程发送数据
sys.timerLoopStart(function()
if socket.isReady() then
if clientConnected then
asyncClient:asyncSend("0123456789")
end
end, 10000)
Expand Down
13 changes: 13 additions & 0 deletions script_LuaTask/demo/softdog/testSoftDog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@

module(...,package.seeall)

sys.taskInit(function()
sys.wait(10000)
log.info("softDog loop test start!")
sys.wait(1000)
while true do
end
end

--[[
--[[
函数名:eatSoftDog
功能 :喂狗
Expand Down Expand Up @@ -41,3 +50,7 @@ sys.timerStart(closeSoftDog,180*1000)

--打印版本号
sys.timerLoopStart(log.info,2000,rtos.get_version(),_G.VERSION)
]]



115 changes: 115 additions & 0 deletions script_LuaTask/demo/ui/color_lcd_spi_gc9106l.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
--- 模块功能:GC 9106驱动芯片LCD命令配置
-- @author openLuat
-- @module ui.color_lcd_spi_gc9106
-- @license MIT
-- @copyright openLuat
-- @release 2018.03.27

--[[
注意:disp库目前支持I2C接口和SPI接口的屏,此文件的配置,硬件上使用的是LCD专用的SPI引脚,不是标准的SPI引脚
硬件连线图如下:
Air模块 LCD
GND-------------地
LCD_CS----------片选
LCD_CLK---------时钟
LCD_DATA--------数据
LCD_DC----------数据/命令选择
VDDIO-----------电源
LCD_RST---------复位
]]

module(...,package.seeall)

--[[
函数名:init
功能 :初始化LCD参数
参数 :无
返回值:无
]]
local function init()
local para =
{
width = 128, --分辨率宽度,128像素;用户根据屏的参数自行修改
height = 160, --分辨率高度,160像素;用户根据屏的参数自行修改
bpp = 16, --位深度,彩屏仅支持16位
bus = disp.BUS_SPI4LINE, --LCD专用SPI引脚接口,不可修改
xoffset = 0, --X轴偏移
yoffset = 0, --Y轴偏移
freq = 13000000, --spi时钟频率,支持110K到13M(即110000到13000000)之间的整数(包含110000和13000000)
pinrst = pio.P0_14, --reset,复位引脚
pinrs = pio.P0_18, --rs,命令/数据选择引脚
--初始化命令
--前两个字节表示类型:0001表示延时,0000或者0002表示命令,0003表示数据
--延时类型:后两个字节表示延时时间(单位毫秒)
--命令类型:后两个字节命令的值
--数据类型:后两个字节数据的值
initcmd =
{
0xfe,
0xef,
0xb3,
0x0030003,
0x21,
0x36,
0x00300c8,
--0x0030008,--上下颠倒
0x3a,
0x0030005,
0xb4,
0x0030021,
0xF0,
0x003002d,
0x0030054,
0x0030024,
0x0030061,
0x00300ab,
0x003002e,
0x003002f,
0x0030000,
0x0030020,
0x0030010,
0x0030010,
0x0030017,
0x0030013,
0x003000f,
0xF1,
0x0030002,
0x0030022,
0x0030025,
0x0030035,
0x00300a8,
0x0030008,
0x0030008,
0x0030000,
0x0030000,
0x0030009,
0x0030009,
0x0030017,
0x0030018,
0x003000f,
0xfe,
0xff,
0x11,
0x010078,
0x29,
},
--休眠命令
sleepcmd = {
0x00020010,
},
--唤醒命令
wakecmd = {
0x00020011,
}
}
disp.init(para)
disp.clear()
disp.update()
end

--控制SPI引脚的电压域
pmd.ldoset(15,pmd.LDO_VLCD)
init()

--打开背光
--实际使用时,用户根据自己的lcd背光控制方式,添加背光控制代码
5 changes: 3 additions & 2 deletions script_LuaTask/demo/ui/color_lcd_spi_st7735.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ local function init()
height = 160, --分辨率高度,160像素;用户根据屏的参数自行修改
bpp = 16, --位深度,彩屏仅支持16位
bus = disp.BUS_SPI4LINE, --LCD专用SPI引脚接口,不可修改
xoffset = 0, --X轴偏移
yoffset = 0, --Y轴偏移
xoffset = 2, --X轴偏移
yoffset = 1, --Y轴偏移
freq = 13000000, --spi时钟频率,支持110K到13M(即110000到13000000)之间的整数(包含110000和13000000)
pinrst = pio.P0_14, --reset,复位引脚
pinrs = pio.P0_18, --rs,命令/数据选择引脚
Expand All @@ -47,6 +47,7 @@ local function init()
{
0x00020011,
0x00010078,
--0x00020021, -- 反显
0x000200B1,
0x00030002,
0x00030035,
Expand Down
2 changes: 1 addition & 1 deletion script_LuaTask/demo/ui/lcd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
-- require "mono_lcd_spi_ssd1306"
-- require "mono_lcd_spi_st7567"
require "color_lcd_spi_st7735"
-- require "color_lcd_spi_gc9106"
--require "color_lcd_spi_gc9106l"
--require "mono_i2c_ssd1306"
module(..., package.seeall)

Expand Down
2 changes: 1 addition & 1 deletion script_LuaTask/doc/lib/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ <h2>Modules</h2>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-04-11 23:40:56 </i>
<i style="float:right;">Last updated 2020-04-23 15:02:34 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
2 changes: 1 addition & 1 deletion script_LuaTask/doc/lib/modules/aLiYun.html
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ <h3>Usage:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-04-11 23:40:56 </i>
<i style="float:right;">Last updated 2020-04-23 15:02:34 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
2 changes: 1 addition & 1 deletion script_LuaTask/doc/lib/modules/aLiYunOta.html
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ <h3>Usage:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-04-11 23:40:56 </i>
<i style="float:right;">Last updated 2020-04-23 15:02:34 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
2 changes: 1 addition & 1 deletion script_LuaTask/doc/lib/modules/agps.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ <h3>Info:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-04-11 23:40:56 </i>
<i style="float:right;">Last updated 2020-04-23 15:02:34 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
44 changes: 43 additions & 1 deletion script_LuaTask/doc/lib/modules/audio.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@ <h2><a href="#Functions">Functions</a></h2>
</a></td>
<td class="summary">设置TTS朗读速度</td>
</tr>
<tr>
<td class="name" nowrap><a href="#setChannel">
setChannel (<strong style="color: gray;">[channel=2]</strong>)
</a></td>
<td class="summary">设置音频输出通道
设置后实时生效</td>
</tr>
</table>

<br/>
Expand Down Expand Up @@ -448,6 +455,41 @@ <h3>Usage:</h3>
<li><pre class="example">audio.setTTSSpeed(<span class="number">70</span>)</pre></il>
</ul>

</dd>
<dt>
<a name = "setChannel"></a>
<strong style="color: red;">
setChannel (<strong style="color: green;">[channel=2]</strong>)
</strong>
</dt>
<dd>
<pre class="example" style="color: red;">设置音频输出通道
设置后实时生效</pre>


<h3>Parameters:</h3>
<ul>
<li><span class="parameter">channel</span>
<span class="types"><span class="type">number</span></span>
[<em>此参数可选,默认值为:</em> 2]
<pre class="example">1:headphone耳机 2:speaker喇叭</pre>
</li>
</ul>

<h3>Returns:</h3>
<ul>
<li>
<pre class="example">nil</pre></il>
</ul>



<h3>Usage:</h3>
<ul>
<li><pre class="example">设置为耳机输出:audio.setChannel(<span class="number">1</span>)
设置为喇叭输出:audio.setChannel(<span class="number">2</span>)</pre></il>
</ul>

</dd>
</dl>

Expand All @@ -456,7 +498,7 @@ <h3>Usage:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-04-11 23:40:56 </i>
<i style="float:right;">Last updated 2020-04-23 15:02:34 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
Loading

0 comments on commit cd3ed21

Please sign in to comment.