[Gambas-user] Request for new feature: SPI and I2C Classes

Matthew Collins matthew.charles.collins.75 at gmail.com
Mon May 13 19:27:15 CEST 2019

Hi Roberto,

Yes, I would also like a native Gambas component for i2c and GPIO (not 
used SPI)...

Take a quick look at my code on the Gambas Farm "gb.PiconZero", I wrote 
a very basic i2c (via shell) and GPIO class (via shell / gpio sysfs).

Also on github add Setup photos:

If you don't already know, the Gambas Farm is a place where other users 
share code and is available directly in the Startup dialog (and Tools > 
Software Farm) in the Gambas IDE.

If you plan to write a Gambas Component in C this might help:


On 5/13/19 5:55 PM, roberto wrote:

> Hello,
> I am just registered to ML, I use gambas 3.9.1 on GNU/Linux.
> I write here to show my needs.
> I use GAMBAS on embedded ARM board (i.e. Raspberry, Nano Pi Fire 2A 
> and 3, and so on).
> Those boards (but in general all ARM embedded boards) offer I/O and 
> dedicated serial lines as UART, SPI and I2C. Gambas has class 
> SerialPort that was great in "desktop" Era, an is still great also in 
> embedded field.
> Unfortunately, many (almost all) devices are controlled by SPI and I2C 
> interfaces (Analog-to-Digital/Digital-to-Analog converter, I/O 
> expander, EEPROM, ecc) and those chip are essential in embedded project.
> Actually, I use GAMBAS to develop GUI where i use class SeriaPort to 
> control a microcontroller and the microcontroller controls the SPI/I2C 
> chip I am interested in. In other words, I must add tho the project a 
> uC and program it as "interpreter" between GAMBAS and the SPI/I2C 
> devices.
> It will be very nice to have 2 new classes to control the SPI and I2C 
> bus and skip the necessity of a "translator": it will be save space on 
> PCB and speed up develop of projects.
> More, it will add new and good value to gambas itself, because it will 
> easely can became *THE* IDE for embedded platforms for all the 
> linuxers, like me, that like to code embedded boards but prefere 
> gambas over Python, C, C++, ecc.
> For both protocol SPI and I2C, in my opinion is not requested 
> immediatly a full support (to play both as master or slave) but it can 
> be enough that the 2 classes SPI and I2C can play as Master, more 
> sophisticated mode can came later.
> Thanks,
> Roberto
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20190513/14d682df/attachment.html>

More information about the User mailing list