mirror of
https://github.com/armfly/H7-TOOL_STM32H7_App.git
synced 2024-08-09 10:05:34 +08:00
51 lines
991 B
Plaintext
Executable File
51 lines
991 B
Plaintext
Executable File
|
|
程序名字: H7-TOOL_App
|
|
|
|
统一源代码。源代码功能.
|
|
|
|
1. 逻辑分析仪功能、示波器、虚拟串口、虚拟CAN、I2C控制器、SPI控制器、PWM控制器、GPIO控制
|
|
DAC控制、电流检测、编码器输入、频率计.
|
|
|
|
2. CMSIS DAP下载器功能、USB虚拟串口功能
|
|
|
|
3. 脱机下载器
|
|
- STM32
|
|
- EEPROM
|
|
- SPI FLASH
|
|
|
|
|
|
function disp(_addr, _len)
|
|
init(0xA0,1,8)
|
|
s=read(_addr,_len)
|
|
s1=""
|
|
for i=1,string.len(s),1 do
|
|
if (((i - 1) % 16) == 0) then
|
|
s1=s1.."\r\n"
|
|
end
|
|
s1=s1..string.format("%02X ",string.byte(s,i))
|
|
end
|
|
|
|
print(s1)
|
|
end
|
|
|
|
write(0,"12345678",5)
|
|
disp(0,32)
|
|
|
|
|
|
for i=0,512,16 do
|
|
write(i,"8234567890123456")
|
|
end
|
|
|
|
--- 内存查看 ---
|
|
|
|
--为了有干净的环境,先把可以收集的其他垃圾赶走先
|
|
collectgarbage("collect");
|
|
|
|
local c1 = collectgarbage("count")
|
|
print("最开始,Lua的内存为", c1)
|
|
|
|
local c2 = collectgarbage("count")
|
|
print("结束后,Lua的内存为", c2)
|
|
|
|
|