diff options
Diffstat (limited to 'utils/hwstub/tools/lua/stmp/digctl.lua')
-rw-r--r-- | utils/hwstub/tools/lua/stmp/digctl.lua | 38 |
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 @@ | |||
1 | --- | ||
2 | --- DIGCTL | ||
3 | --- | ||
4 | STMP.digctl = {} | ||
5 | |||
6 | local h = HELP:get_topic("STMP"):create_topic("digctl") | ||
7 | h:add("The STMP.digctl table handles the digctl device for all STMPs.") | ||
8 | |||
9 | local hh = h:create_topic("package") | ||
10 | hh:add("The STMP.digctl.package() function returns the name of the package.") | ||
11 | hh:add("The following packages can be returned:") | ||
12 | hh:add("* bga100") | ||
13 | hh:add("* bga169") | ||
14 | hh:add("* tqfp100") | ||
15 | hh:add("* lqfp100") | ||
16 | hh:add("* lqfp128") | ||
17 | |||
18 | function STMP.digctl.package() | ||
19 | local pack = nil | ||
20 | if STMP.is_stmp3600() then | ||
21 | HW.DIGCTL.CTRL.PACKAGE_SENSE_ENABLE.set() | ||
22 | if HW.DIGCTL.STATUS.PACKAGE_TYPE.read() == 1 then | ||
23 | pack = "lqfp100" | ||
24 | else | ||
25 | pack = "bga169" | ||
26 | end | ||
27 | HW.DIGCTL.CTRL.PACKAGE_SENSE_ENABLE.clr() | ||
28 | elseif STMP.is_stmp3700() or STMP.is_stmp3770() or STMP.is_imx233() then | ||
29 | local t = HW.DIGCTL.STATUS.PACKAGE_TYPE.read() | ||
30 | if t == 0 then pack = "bga169" | ||
31 | elseif t == 1 then pack = "bga100" | ||
32 | elseif t == 2 then pack = "tqfp100" | ||
33 | elseif t == 3 then pack = "tqfp128" | ||
34 | end | ||
35 | end | ||
36 | |||
37 | return pack | ||
38 | end \ No newline at end of file | ||