1
0
mirror of https://github.com/elua/elua.git synced 2025-01-25 01:02:54 +08:00
elua/romfs/LM3S.lua

21 lines
440 B
Lua
Raw Normal View History

local pio = pio
module(...)
2009-07-29 16:10:15 +00:00
BTN_UP = pio.PE_0
BTN_DOWN = pio.PE_1
BTN_LEFT = pio.PE_2
BTN_RIGHT = pio.PE_3
BTN_SELECT = pio.PF_1
btnpressed = function( button )
2009-07-29 16:10:15 +00:00
return pio.pin.getval( button ) == 0
end
2009-07-29 16:10:15 +00:00
LED_1 = pio.PF_0
2009-07-29 16:10:15 +00:00
pio.pin.setdir( pio.INPUT, pio.PE_0, pio.PE_1, pio.PE_2, pio.PE_3, pio.PF_1 )
pio.pin.setpull( pio.PULLUP, pio.PE_0, pio.PE_1, pio.PE_2, pio.PE_3, pio.PF_1 )
pio.pin.setdir( pio.OUTPUT, pio.PF_0 )