lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mar 20, 2014 4:13 AM, "Thijs Schreijer" <thijs@thijsschreijer.nl> wrote:

For a raspberry pi project I’m looking for a Lua smbus module (for the I2C interface). My google foo failed me (or there just isn’t a Lua module). If all else fails I’m considering converting a Python binding [1] to a Lua binding. But preferably I’d use something off the shelf.


https://forum.openwrt.org/viewtopic.php?id=41913

Since it's licensed CC-BY-SA, I've cloned a copy at http://www.place.org/~nop/luai2c.c ; we'll see which last longer: the openwrt forums, my dumpster directory (dating back to lua 4.0 apparently), or the Linux i2c ioctl.

I did some minor futzing around with pointer types, but it worked for me out of the box. 

If anybody needs it, I have a Linux kernel i2c driver for LittleWire ( http://littlewire.cc ) to go with it. The $10 DigiSpark ATtiny85 boards are fun.

Jay

/*
License: CC BY-SA (http://creativecommons.org/licenses/by-sa/2.5/)
This license lets others remix, tweak, and build upon a work even for commercial reasons, as long as they credit the original author and license their new creations under the identical terms.

Orginal Author: Mikael Sundin, se.linkedin.com/in/mikaelsundin
*/