1
0
Fork 0
forked from len0rd/rockbox

hwstub: improve lcdif, digtctl, add sony nwz-e370

Change-Id: I5316cc9fd9addfca8a674628695fed1c1bf9269f
This commit is contained in:
Amaury Pouly 2013-09-05 23:14:07 +02:00
parent f13cad4c8e
commit f40b15d0cb
4 changed files with 176 additions and 4 deletions

View file

@ -94,5 +94,26 @@ end
function ZENMOZAIC.init()
ZENMOZAIC.lcd_init()
HW.LRADC.CTRL0.SFTRST.clr()
HW.LRADC.CTRL0.CLKGATE.clr()
HW.LRADC.CHn[0].ACCUMULATE.clr()
HW.LRADC.CHn[0].NUM_SAMPLES.write(0)
HW.LRADC.CHn[0].VALUE.write(0)
local t = {}
for i = 1,1000,1 do
HW.LRADC.CTRL0.SCHEDULE.write(1)
--local time = HW.DIGCTL.MICROSECONDS.read()
local time = i * 1000
local val = HW.LRADC.CHn[0].VALUE.read()
t[#t + 1] = {time, val}
end
local file = io.open("data.txt", "w")
for i,v in ipairs(t) do
file:write(string.format("%d %d\n", v[1] / 1000, v[2]))
end
file:close()
print("Display curve using:")
print("gnuplot -persist");
print("> plot \"data.txt\" using 1:2")
end