summaryrefslogtreecommitdiffstats
path: root/utils/hwstub/tools/lua/stmp/digctl.lua
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-06-13 02:12:01 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-06-13 02:25:15 +0200
commitf9cb5de58020936812653c578c79c79a13bc626c (patch)
treed1d6c29207472bea4daa68d2fffd7e8dbfac998b /utils/hwstub/tools/lua/stmp/digctl.lua
parentc5357940ab0108b4102442d07825c44d5be0d22f (diff)
downloadrockbox-f9cb5de58020936812653c578c79c79a13bc626c.tar.gz
rockbox-f9cb5de58020936812653c578c79c79a13bc626c.zip
hwstub: introduce lua code for the STMP and Creative ZEN V/Mozaic
Change-Id: Ice5f509a2e0d2114436d4760f338b9203ef96691
Diffstat (limited to 'utils/hwstub/tools/lua/stmp/digctl.lua')
-rw-r--r--utils/hwstub/tools/lua/stmp/digctl.lua38
1 files changed, 38 insertions, 0 deletions
diff --git a/utils/hwstub/tools/lua/stmp/digctl.lua b/utils/hwstub/tools/lua/stmp/digctl.lua
new file mode 100644
index 0000000000..8dfc13b7f2
--- /dev/null
+++ b/utils/hwstub/tools/lua/stmp/digctl.lua
@@ -0,0 +1,38 @@
+---
+--- DIGCTL
+---
+STMP.digctl = {}
+
+local h = HELP:get_topic("STMP"):create_topic("digctl")
+h:add("The STMP.digctl table handles the digctl device for all STMPs.")
+
+local hh = h:create_topic("package")
+hh:add("The STMP.digctl.package() function returns the name of the package.")
+hh:add("The following packages can be returned:")
+hh:add("* bga100")
+hh:add("* bga169")
+hh:add("* tqfp100")
+hh:add("* lqfp100")
+hh:add("* lqfp128")
+
+function STMP.digctl.package()
+ local pack = nil
+ if STMP.is_stmp3600() then
+ HW.DIGCTL.CTRL.PACKAGE_SENSE_ENABLE.set()
+ if HW.DIGCTL.STATUS.PACKAGE_TYPE.read() == 1 then
+ pack = "lqfp100"
+ else
+ pack = "bga169"
+ end
+ HW.DIGCTL.CTRL.PACKAGE_SENSE_ENABLE.clr()
+ elseif STMP.is_stmp3700() or STMP.is_stmp3770() or STMP.is_imx233() then
+ local t = HW.DIGCTL.STATUS.PACKAGE_TYPE.read()
+ if t == 0 then pack = "bga169"
+ elseif t == 1 then pack = "bga100"
+ elseif t == 2 then pack = "tqfp100"
+ elseif t == 3 then pack = "tqfp128"
+ end
+ end
+
+ return pack
+end \ No newline at end of file