diff options
| author | Amaury Pouly <amaury.pouly@gmail.com> | 2016-02-07 21:46:58 +0000 |
|---|---|---|
| committer | Amaury Pouly <amaury.pouly@gmail.com> | 2016-04-08 19:38:18 +0200 |
| commit | f6c61eb11a13f7a5141a980f56b9a14b3309c449 (patch) | |
| tree | d1c4a4d992f88e40eacb65d5e046b595fdcb512a /utils/hwstub/tools/lua/load.lua | |
| parent | a2f4c5201d78b9f351834b0512623eeac622280f (diff) | |
| download | rockbox-f6c61eb11a13f7a5141a980f56b9a14b3309c449.zip rockbox-f6c61eb11a13f7a5141a980f56b9a14b3309c449.tar.gz rockbox-f6c61eb11a13f7a5141a980f56b9a14b3309c449.tar.bz2 rockbox-f6c61eb11a13f7a5141a980f56b9a14b3309c449.tar.xz | |
hwstub: port hwstub_shell to the new library
Also use this opportunity to cleanup support for multiple devices: the shell
now supports dynamic changes in the device and will call init() everytime
a new device is selected, to prepare a new environment. The shell now
honors register width on register read/write. The shell also provides access
to variants as follows by creating a subtable under the register using the
variant type in UPPER case and having the same layout as a register.
For example if register HW.GPIO.DIR has variants "set" and "clr", those can
be used like this:
HW.GPIO.DIR.SET.write(0xff)
HW.GPIO.DIR.CLR.write(0xff00)
Change-Id: I943947fa98bce875de0cba4338e8b7196a4c1165
Diffstat (limited to 'utils/hwstub/tools/lua/load.lua')
| -rw-r--r-- | utils/hwstub/tools/lua/load.lua | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/utils/hwstub/tools/lua/load.lua b/utils/hwstub/tools/lua/load.lua index f636360..cafa827 100644 --- a/utils/hwstub/tools/lua/load.lua +++ b/utils/hwstub/tools/lua/load.lua @@ -1,14 +1,24 @@ package.path = string.sub(string.gsub(debug.getinfo(1).source, "load.lua", "?.lua"),2) .. ";" .. package.path - -if hwstub.dev.target.id == hwstub.dev.target.STMP then - require "stmp" -elseif hwstub.dev.target.id == hwstub.dev.target.PP then - require "pp" -elseif hwstub.dev.target.id == hwstub.dev.target.RK27 then - require "rk27xx" -elseif hwstub.dev.target.id == hwstub.dev.target.ATJ then - require "atj" -end - +require "stmp" +require "pp" +require "rk27xx" +require "atj" +require "jz" require "hwlib" require "dumper" + +LOAD = {} + +function LOAD.init() + if hwstub.dev.target.id == hwstub.dev.target.STMP then + STMP.init() + elseif hwstub.dev.target.id == hwstub.dev.target.PP then + PP.init() + elseif hwstub.dev.target.id == hwstub.dev.target.RK27 then + RK27XX.init() + elseif hwstub.dev.target.id == hwstub.dev.target.ATJ then + ATJ.init() + elseif hwstub.dev.target.id == hwstub.dev.target.JZ then + JZ.init() + end +end
\ No newline at end of file |