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
[IDEA] Shield Files
- 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:
Return to “Development and Feedback”
Who is online
Users browsing this forum: No registered users and 18 guests