1
0
mirror of https://github.com/elua/elua.git synced 2025-01-08 20:56:17 +08:00
elua/romfs/LM3S.lua
Dado Sutter f8507a7c05 gpio module renamed (back) to pio
romfs Lua examples refactored to work with pio module
examples were _not_ tested after renaming gpio to pio (but should be ok)
2009-03-12 21:06:14 +00:00

20 lines
357 B
Lua

local pio = pio
module(...)
BTN_UP = "PE_0"
BTN_DOWN = "PE_1"
BTN_LEFT = "PE_2"
BTN_RIGHT = "PE_3"
BTN_SELECT = "PF_1"
btnpressed = function( button )
return ( pio[ button ] == 0 )
end
LED_1 = "PF_0"
pio.PE_0_3_DIR, pio.PF_1_DIR = pio.INPUT, pio.INPUT
pio.PE_0_3_PULL, pio.PF_1_PULL = pio.PULLUP, pio.PULLUP
pio.PF_0_DIR = pio.OUTPUT