lua-users home
lua-l archive

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


On Friday 23 April 2004 16:31, Goetz.Kluge@infineon.com wrote:
> Then the remaining question is how to access USB devices via LUA.

The cleaner (and recommended) way is to find the appropriate C calls of the 
win32 API (or of the external library, or of the driver) for managing USB 
communications and then write a few small C functions to make them available 
to Lua. This operation is well detailed in Roberto's book (Programming in 
Lua) but, as alredy posted, could require writing a low-level driver if 
generic USB communications are not supported by the win32 API.

As a kludge, you could use Asko Kauppi's Lua serial driver and just control 
the RTS and DTR lines as I2C data and clock (I assume his driver can do that). 
This should also work through a USB-serial interface for PCs missing a serial 
port; of course you'll have to shift hardware levels (RS-232 -> I2C).

  Enrico