[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: AW: Controlling hardware with lua (via USB interface)?
- From: Enrico Colombini <erix@...>
- Date: Fri, 23 Apr 2004 22:41:49 +0200
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