In general I think we should write specific device drivers, like I2C
RTCs and LCD/LED modules in pure Lua and leave eLua for device drivers. That way they automatically work on all platforms that have I2C, reserving C drivers just for different classes of hardware and speed-critical stuff. I got this wrong for the Mizar32 RTC and 16x2-char LCD interfaces. I should have written them in Lua, passing an I2C ID (or an LCD/RTC ID) as an extra parameter. Ho hum. I suppose I could rewrite them and make mizar32.{rtc,lcd}.* stubs for the new ones... M _______________________________________________ eLua-dev mailing list [hidden email] https://lists.berlios.de/mailman/listinfo/elua-dev |
On the other hand there are other platforms which have RTC, but it is not an I2C device, for instance the SAM 3 (Arduino Due). I used the Mizar32 RTC as a model when writing the RTC module for that. (I think some of the other supported micros may have built in RTC - e.g. some of the STM32.) Should probably aim to make it transparent, so the user doesn't need to pay attention to whether the library is written in C or eLua. > ----- Original Message ----- > From: Martin Guy > Sent: 01/17/14 03:37 PM > To: [hidden email] > Subject: Re: [eLua-dev] Drivers 100% Lua > > In general I think we should write specific device drivers, like I2C > RTCs and LCD/LED modules in pure Lua and leave eLua for device > drivers. That way they automatically work on all platforms that have > I2C, reserving C drivers just for different classes of hardware and > speed-critical stuff. > > I got this wrong for the Mizar32 RTC and 16x2-char LCD interfaces. I > should have written them in Lua, passing an I2C ID (or an LCD/RTC ID) > as an extra parameter. Ho hum. I suppose I could rewrite them and make > mizar32.{rtc,lcd}.* stubs for the new ones... > > M > _______________________________________________ > eLua-dev mailing list > [hidden email] > https://lists.berlios.de/mailman/listinfo/elua-dev _______________________________________________ eLua-dev mailing list [hidden email] https://lists.berlios.de/mailman/listinfo/elua-dev |
On 18 January 2014 07:02, FP AB <[hidden email]> wrote:
> there are other platforms which have RTC, but it is not an I2C device, That's very true, while "RTC" is a useful generic concept, however it's implemented. OK. So another driver in Lua implementing rtc.* using i2c.* for the various chips would be useful. The Mizar32 one already recognises 2 different I2C chips by probing their I2C addresses, I should port it to pure Lua unless someone else gets there first. M _______________________________________________ eLua-dev mailing list [hidden email] https://lists.berlios.de/mailman/listinfo/elua-dev |
Hi!
I wrote an RTC driver for i2c for PCF8583, full Lua . It is on Github, with the driver for PCF8574 with SC39. I'll try to complete it for another RTC i2c component. Later, I put online the driver for i2c eeprom memory It suits it? https://github.com/AlbertFERNANDES/elua-i2c Le 18/01/2014 12:49, Martin Guy a écrit : > That's very true, while "RTC" is a useful generic concept, however > it's implemented. OK. So another driver in Lua implementing rtc.* > using i2c.* for the various chips would be useful. The Mizar32 one > already recognises 2 different I2C chips by probing their I2C > addresses, I should port it to pure Lua unless someone else gets there > first. -- --- Ce courrier électronique ne contient aucun virus ou logiciel malveillant parce que la protection avast! Antivirus est active. http://www.avast.com _______________________________________________ eLua-dev mailing list [hidden email] https://lists.berlios.de/mailman/listinfo/elua-dev |
Free forum by Nabble | Edit this page |