summaryrefslogtreecommitdiffstats
path: root/utils/hwstub/tools/lua/stmp/digctl.lua
diff options
context:
space:
mode:
Diffstat (limited to 'utils/hwstub/tools/lua/stmp/digctl.lua')
-rw-r--r--utils/hwstub/tools/lua/stmp/digctl.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/utils/hwstub/tools/lua/stmp/digctl.lua b/utils/hwstub/tools/lua/stmp/digctl.lua
index 8dfc13b7f2..2ef3551c77 100644
--- a/utils/hwstub/tools/lua/stmp/digctl.lua
+++ b/utils/hwstub/tools/lua/stmp/digctl.lua
@@ -35,4 +35,15 @@ function STMP.digctl.package()
end
return pack
+end
+
+function STMP.digctl.udelay(us)
+ local tend = HW.DIGCTL.MICROSECONDS.read() + us
+ while HW.DIGCTL.MICROSECONDS.read() < tend do
+
+ end
+end
+
+function STMP.digctl.mdelay(ms)
+ STMP.digctl.udelay(ms * 1000)
end \ No newline at end of file