Suggestion : Multiple hello world and libraries for the same component

09 Jan 2015

A nice addition to the components library would be to have the ability to add multiple Hello World and Library links.
I know we can put additional code links into the notes but imho, this would clutter the entire overview.
Another option would be to create separate components but, again, not really user-friendly.

An example where such an addition would come in handy : HY28B-28-Touch-Screen-TFT-LCD-SPI-8-16-bit.
When i create a second (8/16 bit parallel) library for this component, i want to keep it separate from the current SPI library (code readability).

09 Jan 2015

The best approach to maintain and provide related libraries is a base class and derived classes. I did something similar for the TextLCD lib: a base class provides all the real functionality, derived classes implement interfaces through mbed 4-bit bus pins, for I2C and SPI expanders and for devices that support native I2C or SPI. The base class and all derived classes are in a single library, but you could also separate them. However, the derived classes are minimal in size and should not result in much overhead as the linker should remove unused code. I think the advantage of keeping them in one class is easier maintenance.

09 Jan 2015

Wim, thanks for the info. I was thinking of working this way but the current library name won't fit : SPI_TFT_ILI9320
As i already added ILI9325 and ILI9328 support to the current library, i think creating a new library (TFT_ILI932x), including the derived classes and a config file to choose between SPI or 8/16bit (memory footprint), is the way to go.

However, i still like the multiple links idea as other users can add better/other libraries/code to the component without having to remove the original library (this would also prevent discussions about which code is to be kept in place).