From 339501ce4999bb8020c417da7f00012701fda169 Mon Sep 17 00:00:00 2001 From: Dado Sutter Date: Wed, 26 Jan 2011 21:34:59 -0200 Subject: [PATCH] - Aux files for these two platforms updated for current examples - These are no longer part of the distro and are required by some games and examples. They must simply be included in one of our File Systems (usually on ROMFS) and eLua will provide them to the main app require() --- EK-LM3S6965.lua | 5 +++++ EK-LM3S8962.lua | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/EK-LM3S6965.lua b/EK-LM3S6965.lua index c9aef15..3824bc4 100755 --- a/EK-LM3S6965.lua +++ b/EK-LM3S6965.lua @@ -13,6 +13,7 @@ -- returns true if the arg button is pressed, false otherwise local pio = pio +local lm3s = lm3s module(...) @@ -28,6 +29,10 @@ end LED_1 = pio.PF_0 +-- Associate the RIT OLED display device supported by the builtin module lm3s with +-- a disp name/device offered here +disp = lm3s.disp + pio.pin.setdir( pio.INPUT, BTN_UP, BTN_DOWN, BTN_LEFT, BTN_RIGHT, BTN_SELECT ) pio.pin.setpull( pio.PULLUP, BTN_UP, BTN_DOWN, BTN_LEFT, BTN_RIGHT, BTN_SELECT ) pio.pin.setdir( pio.OUTPUT, LED_1 ) diff --git a/EK-LM3S8962.lua b/EK-LM3S8962.lua index 07dffb1..eb3f2e0 100755 --- a/EK-LM3S8962.lua +++ b/EK-LM3S8962.lua @@ -1,4 +1,19 @@ +-- This auxiliar platform dependent module defines some hardware devices +-- available in the specific development kit. +-- It will be automatically require()d when eLua detects it is running on the +-- respective platform, exposing auxiliar constants and functions to facilitate +-- and keep portable the access to the underlying hardware. +-- The code configures the MCU to interface with the platform devices and +-- exposes the following objects, constants and fuctions: +-- Onboard Buttons: +-- BTN_UP, BTN_DOWN, BTN_LEFT, BTN_RIGHT, BTN_SELECT +-- Onboard LED: +-- Auxiliar Function: +-- btn_pressed( button ) +-- returns true if the arg button is pressed, false otherwise + local pio = pio +local lm3s = lm3s module(...) @@ -14,6 +29,10 @@ end LED_1 = pio.PF_0 +-- Associate the RIT OLED display device supported by the builtin module lm3s with +-- a disp name/device offered here +-- disp = lm3s.disp + pio.pin.setdir( pio.INPUT, BTN_UP, BTN_DOWN, BTN_LEFT, BTN_RIGHT, BTN_SELECT ) pio.pin.setpull( pio.PULLUP, BTN_UP, BTN_DOWN, BTN_LEFT, BTN_RIGHT, BTN_SELECT ) pio.pin.setdir( pio.OUTPUT, LED_1 )