[IDEA] Shield Files

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

[IDEA] Shield Files

Postby Giovanni » Wed Mar 16, 2016 9:14 am

Hi,

This is something that could be done in next release. We have a well consolidated concept of board files, the problem is with those boards that can mount additional modules or "shields".

My idea is to formalize the concept of "shield" in the architecture and make board.c to include a shield.h file for extra initializations to be performed.

For example we could have a board ST_NUCLEO_XXX include a shield XXX_MEMS_GYRO (if a macro BOARD_USE_SHIELD is defined). The required initializations for the shield would be performed after the GPIO initialization, for example setting up the SPI pins that connect the gyroscope.

The interface would be done by name rather than port+pin because a certain shield signal could be on a different pin on different boards. This means that the shield file should setup LINE_ARD_D5 rather than GPIOE,GPIOE_ARD_D5. The shield file could also have an initialization function called from boardInit().

Is the concept sound? other ideas?

The problem is that the line mode is platform-dependent, so it would be an ALTERNATE(something) on STM32 and something else on AVR. The shield file would be platform-dependent.

Giovanni

Return to “Development and Feedback”

Who is online

Users browsing this forum: No registered users and 18 guests