1
0
mirror of https://github.com/elua/elua.git synced 2025-01-08 20:56:17 +08:00

61 Commits

Author SHA1 Message Date
James Snyder
9a1536b959 Fix LM3S6965 bug related to using lm3s module.
Add tetrives back on LM3S6965.
2010-02-15 22:26:15 +00:00
James Snyder
53f69a9f2f Basic GPIO support for MBED.
dip pins p5-p30 are mapped as P0_5 to P0_30
LEDs are mapped to P1_0 to P1_3

This approach could be switched to using a platform specific Lua module to
define all the pins, or C code to do the same.
2010-02-12 23:03:29 +00:00
Dado Sutter
d890fd3c50 - Fixed LM3S games and aux modules
- Updated lm3s games versions merged with trunk
- Tetrives game added to default LM3S8962 build on SConstruct
2010-02-03 12:32:18 +00:00
James Snyder
51221f8b4c Merge 0.7 changes to trunk. 2010-01-25 23:43:05 +00:00
Dado Sutter
fd2379c07e Pong (game) enhancements 2009-12-12 04:12:18 +00:00
Dado Sutter
67be234b32 eLua platform specific disp module, added to LM3S aux setup Lua modules.
This helps apps to treat natively-supported LM3S OLED RIT display as just another onboard device.
Doc will be enhanced to give examples on these modules' usages.
2009-12-11 06:38:45 +00:00
Dado Sutter
1d24679cc3 Snake game refinements (by Téo Benjamin) 2009-11-29 03:25:32 +00:00
Dado Sutter
c2b214c364 Fixing the snake file format committed, sorry (GCode got me this time :) 2009-11-20 12:32:20 +00:00
Dado Sutter
167cb2a514 New game added to eLua ROMFS. Snake runs on LM3S boards with RIT OLED Display.
Small changes on Pong, another game for the same platform above.
2009-11-20 12:12:20 +00:00
Dado Sutter
2812e9eef3 Randomize seed on start now depends on user time delay
Longer screen power off delay at the end
2009-11-08 01:03:37 +00:00
Dado Sutter
22dc664737 - Scontruct: autorun.lua file, if found in /romfs, is now included in eLua builds for
any platform. No need to specify it in the file_list table.
- minor comments added to SConstruct
- LM3S platform specific modules commented
- Minor comments in Pong
- Debugging prints removed from Tetrives
2009-11-02 17:44:35 +00:00
Bogdan Marinescu
f1d8594ea2 added PWM to the LPC24xx platform (and also pwmled.lua) 2009-10-31 16:52:40 +00:00
Bogdan Marinescu
8476b93446 merged branch lpc24xx (r492:507) to trunk 2009-10-31 11:41:34 +00:00
Dado Sutter
90c5db6d91 Added support for STR-E912 board
As this board doesn't have an LED, the display backlight was used.
The jumper PWM/LIGHT on the board must be placed on the PWM position.
2009-10-19 00:03:26 +00:00
Bogdan Marinescu
cf48728115 - added support for the STR-E912 board from Olimex
- PWM module for STR9
- STR9 port fixes 
- STR9 platform-specific module: str9.pio (the STR9 GPIO subsystem is quite uncommon).
- small LM3S fixes
2009-10-18 01:27:33 +00:00
James Snyder
bd1465ca50 Merge 0.6 branch to trunk.
Conflicts:
	SConstruct
	doc/en/arch_platform.html
	doc/en/comunity.html
	doc/en/overview.html
	doc/en/refman.html
	doc/en/refman_gen.html
	doc/en/status.html
	doc/en/tut_bootstick.html
	doc/images/lng_pt.png
	doc/images/minusnode.png
	doc/images/next.png
	doc/images/node.png
	doc/images/nodelast.png
	doc/images/plusnode.png
	doc/images/plusnodelast.png
	doc/images/previous.png
	doc/images/showall.png
	doc/images/sync.png
	doc/images/vertline.png
	doc/pt/arch.html
	doc/pt/arch_coding.html
	doc/pt/arch_con_term.html
	doc/pt/arch_newport.html
	doc/pt/arch_overview.html
	doc/pt/arch_platform.html
	doc/pt/arch_tcpip.html
	doc/pt/building.html
	doc/pt/comunity.html
	doc/pt/dl_binaries.html
	doc/pt/dl_old.html
	doc/pt/dl_sources.html
	doc/pt/downloads.html
	doc/pt/examples.html
	doc/pt/faq.html
	doc/pt/installing_i386.html
	doc/pt/installing_lm3s.html
	doc/pt/news.html
	doc/pt/overview.html
	doc/pt/refman_dep.html
	doc/pt/refman_gen.html
	doc/pt/status.html
	doc/pt/tc_386.html
	doc/pt/toolchains.html
	doc/pt/tut_openocd.html
	doc/pt/using.html
	romfs/LM3S.lua
	romfs/led.lua
	romfs/morse.lua
	romfs/pong.lua
	src/lua/linit.c
	src/modules/auxmods.h
	src/platform/lm3s/platform.c
	src/platform/lm3s/platform_conf.h
	src/platform/sim/platform_conf.h
2009-10-13 02:14:27 +00:00
Bogdan Marinescu
2dfb889e8d integrated logo and bitarray to the trunk, small additional fixes 2009-08-19 19:18:45 +00:00
James Snyder
9f32aa6115 Working ethernet. 2009-08-03 18:39:43 +00:00
Bogdan Marinescu
179042bc45 syntax revision on tmr (merged to trunk) 2009-07-31 11:56:43 +00:00
Bogdan Marinescu
6f32e784b3 syntax revision on uart module (merged to trunk) 2009-07-30 13:04:10 +00:00
Bogdan Marinescu
b3076326c4 pio syntax revision (merged to trunk) 2009-07-29 16:10:15 +00:00
Bogdan Marinescu
7ca43fe966 syntax revision on term 2009-07-20 19:39:51 +00:00
James Snyder
4b7169fdda PWM support for STM32 working (4 channels running off of TIM8). 2009-07-08 23:40:12 +00:00
James Snyder
a984d2191a Additional specificity in docs, adcpoll updated to use synchronized start. 2009-06-29 16:45:46 +00:00
James Snyder
0437a25b30 Simplify adcpoll.lua slightly, and remove locals so that the example might be
more friendly to less advanced users.
2009-06-29 16:45:37 +00:00
James Snyder
6ffc36ace3 Touchups for documentation & comments for adc* scripts from romfs. 2009-06-29 16:45:28 +00:00
James Snyder
5f00870eb7 Include allocation stats. 2009-06-29 16:44:31 +00:00
James Snyder
bd2e819368 ADC Updated
- adc_wait_samples now returns the actual number of samples available at the
  time it returns.  this simplifies a pattern where one would wait on samples
  if blocking and then subsequently check the number of available samples.
- adc.insertsamples(id, table, idx, count) function now available to take
  samples and insert them into a table.  this is slightly slower than
  assignment for single values in a table, but can avoid having to use
  getsamples (returning new tables) for certain situations
  idx: starting index in table where values will be inserted
  count: number of samples to get from channel id
2009-04-22 15:36:50 +00:00
James Snyder
2f75a1b4a0 Quick change to even out printing. 2009-04-12 20:55:34 +00:00
James Snyder
256991162d Changes to further test that ADC is behaving correctly. 2009-03-25 16:17:19 +00:00
James Snyder
94438ff64b ADC for STM32 + Misc Fixes & Build Adjustments
- ADC adjusted to work with sequenced acquisition setups.  It should now
  accomodate both sequenced and non-sequenced approaches on the backend.
  A few more adjustments should be made to handle multiple sequencers
  but right now neither LM3S or STM32 platforms use more than one sequencer.

- Added adcpoll.lua to demonstrate a simple approach for using clocked
  acquisition and displaying results as they become available.

- ADC now works for STM32 (all 16 channels!). This should receive more
  extensive testing, but everything should be working at this stage.

- the build system now pays attention to changes in header files meaning that
  if any headers change or if the romfs changes (since it is generated as a
  header) these changes will get recompiled without having to do a clean.
2009-03-21 19:59:49 +00:00
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
James Snyder
b4290c4aa4 Added timer compatibility check.
Smoothing resize checks that no operations are pending.
2009-03-05 07:06:59 +00:00
James Snyder
3fc868b534 ADC Changes
- removed getsmoothing, setfreerunning, samplesready
- isdone has returned so that one can check if the reason why the buffer is
  dry is because no more samples are being collected
- smoothing should support fairly large lengths now (as long as you have the
  memory)
- added support to adc.sample to take a table as the first argument so that a
  set of channels can be started at closer to the same time.
    example:
    adcchannels = {0,1,2,3}
    adc.sample(adcchannels,8)

    this should collect samples on all 4 channels starting nearly at the same
    time.

- more comments added to elua_adc.c to describe behavior.

Misc
- remove rndpow2, not being used
2009-03-03 01:23:45 +00:00
James Snyder
1e2e05ee55 Fix limitation that prevented smoothing lengths longer than 64. 2009-02-26 02:36:46 +00:00
James Snyder
554dd7126b ADC can now run in freerunning mode (keep collecting samples after ring buffer
is full). Clock and sampling frequency have been moved to a separate function
from burst.  There is now one function to initiate sampling called sample
which takes a channel and count.  setclock takes a channel, clock_id, and
frequency.  Adjustments should be made to make channel groupings somewhat
cleaner, but this is functional.

Suggestions are welcome for simplification :-)

I'll try and make some doc updates in the coming day or so to reflect
finalized adjustments.
2009-02-24 07:58:10 +00:00
Bogdan Marinescu
99c24861f4 Integrated support for Micromint Eagle 100 board (LM3S6918 Cortex-M3).
Fixed the cross compilation script.
Some DOS to UNIX EOL conversions.
2009-02-23 15:28:56 +00:00
James Snyder
2c175a72cb ADC updates & EABI Compiler Support for LM3S
ADC:
- getsamples split into getsamples and getsample.  getsamples always returns a
  table of results.  getsample returns single values (if available).

EABI compiler support:
- added a parameter to SConstruct called cprefix, which allows one to define a
  prefix other than the arm-elf used by some platforms.  Currently the only
  platform that does anything with this parameter is LM3S, conf.py scripts can
  be updated to handle the default toolchain prefix, and accommodate alternate
  ones if needed.
- Added sections to lm3s.ld (originally committed by Jesus Alvarez) to handle
  linking properly for arm-eabi targets.
2009-02-20 21:41:30 +00:00
James Snyder
b3f6110150 ADC bugfixes, and change to sample and burst being non-blocking. Samples are
acquired with getsamples.
2009-02-16 23:01:32 +00:00
Bogdan Marinescu
42ff856578 - the "pio" module is now called "gpio" (Dado will be finally happy :) )
- new addition to the PIO module: now you can use pin ranges in PIO expressions. For example:

  gpio.PA_3_6_DIR = gpio.OUTPUT -- make pins 3-6 from PORTA outputs
  gpio.PB_0_30_PULL = gpio.PULLUP -- activate pullups on all but the last pin of PORTB
  gpio.PB_3_6 = 11 -- set value 10 (1011) to pins 3-6 of PB (so PB.6 == 1, PB.5 == 0, PB.4 == 1, PB.3 == 1 )
  value = gpio.PB_2_9 -- read the value of pins 2-9 of PB into 'value'

  Of course, one can still specify a single pin instead of a range.
  This is still tested, but seems to work fine for now.
- romfs/ samples updated to work with the new module name and syntax
- small fix to buf.c (in the BUF_MOD_INCR macro).
2009-02-16 20:18:48 +00:00
James Snyder
db423ba662 ADC fixes and temporary workarounds for handling buffer resizing. 2009-02-16 07:37:28 +00:00
James Snyder
fbe307e12a Fairly large number of changes in here to make adc work with lua's provided
buf.c.

The smoothing buffer is still kept separate from the main buffering system,
but as samples come in via interrupt, they are placed into a "standard" elua
buf.  The size of this buf is configured according to whether one is grabbing
a bunch of samples rapidly (burst), or singly in order to accommodate the
expected number of incoming samples.  If smoothing is enabled, incoming
samples are claimed until the smoothing buffer is full, and then remaining
samples are left in the main buffer until they are collected.  This means that
whether one is collecting single samples or samples at burst rate, and
smoothing is enabled, the filter will only be providing samples that have
enough history.

Added a function to manually flush both smoothing and main buffers.
This would be useful if you know your state has changed and you only want
fresh samples that are going to be collected after a flush.

Also, a lot of functionality moved into elua_adc.c and common.c
(boundaries for what belongs where, might be evaluated), reducing the number
of platform.c specific functions dramatically.

Basic functionality seems to be working, but some more testing should be done.

Also, given that there's now a dynamic buffer behind everything, a shift in
the way sampling is handled could be done:
sample and burst functions could be made to be non-blocking, and to never
return anything except for errors.
a separate getsamples function could be used for removing samples collected by
either function from the buffer.
Suggestions are welcome as it would be nice to keep usage paradigms stable
after the 0.6 release.
2009-02-16 00:53:00 +00:00
Bogdan Marinescu
45285ea064 - LTR: even if we (obviously) can't set new keys/values in a rotable, we still respect the __newindex metamethod. This allows for interesting tricks, like the one shown below :)
- complete rewrite of the PIO module. New usage:

pio.PA = 10 -- set the value of PA to 10
pio.PB_1 = 1 -- set the value of pin 1 of PB to 1

local value = pio.PB -- get the value of PB
local value = pio.PB_3 -- get the value of pin 3 of PB

pio.PA_DIR = pio.OUTPUT/pio.INPUT - set the direction of PA
pio.dir[ pio.PA ] = pio.OUTPUT/pio.INPUT - same as above

pio.PA_2_DIR = pio.OUTPUT/pio.INPUT - set the direction of pin 2 of PA
pio.dir[ pio.PA_2 ] = pio.OUTPUT/pio.INPUT - same as above

pio.PA_PULL = pio.PULLUP/pio.PULLDOWN/pio.NOPULL - set pulls on PA
pio.pull[ pio.PA ] = pio.PULLUP/pio.PULLDOWN/pio.NOPULL - same as above

pio.P0_3_PULL = pio.PULLUP/pio.PULLDOWN/pio.NOPULL - set pulls on pin 3 of P0
pio.pull[ pio.P0_3 ] = pio.PULLUP/pio.PULLDOWN/pio.NOPULL - same as above

- samples modified to use the new PIO syntax
- bugfix in AT91SAM7X256 UART int handler
- fixed yet another bug in AVR32's libc (actually replaced strcmp (which is broken on AVR32) with a custom version).
2009-02-10 17:54:01 +00:00
Bogdan Marinescu
afa96dcc25 I was bored during a long training, so I added partial ANSI term support to i386. Now you can life.lua on it :) 2009-01-28 17:53:33 +00:00
James Snyder
da35498b02 - ADC now runs with an interrupt handler, which manages samples from each
channel.  Smoothing support (rolling average) has been added. adcscope has
  been updated to reflect these changes, and show output from 4 channels at
  once.

- fix for typo in stm32/platform.c
2009-01-27 20:49:45 +00:00
James Snyder
150005cad9 Quick ADC demo (not yet an actual scope, just writes text to OLED with last
reading).
2009-01-21 23:41:04 +00:00
Bogdan Marinescu
f729155fce - Lua Tiny RAM (LTR) patch is now integrated in eLua and is enabled by default
- all eLua modules updated to work with LTR
- "cpu" module added to avr32, at91sam7x, str7
- "disp" module no longer generic (now stays in src/modules/lm3s). For this reason, the "disp" platform interface was also removed.
- the "modcommon" mechanism in STM32 (ROM loader) was depreciated in favour of the Lua Tiny RAM patch (and the "stm3210lcd" module from the STM32 backend now uses LTR).
- small bugfixes
2009-01-11 20:43:02 +00:00
Bogdan Marinescu
843bb3dd59 Now we have both GPIO and timer support on AVR32. led.lua sample was also modified to work with the ATEVK1100 board. More to come after I get rid of some other projects. 2008-12-16 19:01:51 +00:00
Dado Sutter
77d626b26a href tags changed to relative (to current host) to avoid the need for "elua" host be known by DNS.
Modules tested ok after changes.
2008-12-13 21:31:20 +00:00
Dado Sutter
6ac505a181 Pong example remorphed for a require() / module () scheme.
It now illustrates how to create and use a module in Lua for eLua.
An LM3S platform-dependend module is created, exposing it's buttons, leds and offering some utility functions.
2008-12-08 19:39:47 +00:00