px4_fmu-v4: add runtime external SPI4 detection to support pmw3901 (#11301)

* The build is built with SPI4. At run time the signal GPIO_8266_GPIO2 it tested. If it is low the SPI4 is configured. If it is high SPI4 is not configured.
 * board_common: Add Notion of Board has bus manifest
This commit is contained in:
David Sidrane
2019-01-29 13:44:15 -05:00
committed by Daniel Agar
parent 53a127beb9
commit 6f9a9b3d2c
11 changed files with 248 additions and 52 deletions
+18
View File
@@ -1075,6 +1075,24 @@ __EXPORT bool px4_spi_bus_external(int bus);
#endif /* BOARD_HAS_SIMPLE_HW_VERSIONING */
/************************************************************************************
* Name: board_has_bus
*
************************************************************************************/
enum board_bus_types {
BOARD_SPI_BUS = 1,
BOARD_I2C_BUS = 2
};
#if defined(BOARD_HAS_BUS_MANIFEST)
__EXPORT bool board_has_bus(enum board_bus_types type, uint32_t bus);
#else
# define board_has_bus(t, b) true
#endif /* BOARD_HAS_BUS_MANIFEST */
/************************************************************************************
* Name: board_hardfault_init
*