mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 07:03:35 +08:00
same70xplained-v1:use px4_micro_hal PX4_BUS_NUMBER_{TO|FROM}_PX4 mapping
This commit is contained in:
committed by
Daniel Agar
parent
5d33b602f3
commit
442f79dac6
@@ -198,7 +198,7 @@ __BEGIN_DECLS
|
||||
#define GPIO_SPI_CS_BARO (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_SET | GPIO_PORT_PIOD | GPIO_PIN11)
|
||||
#define GPIO_SPI_CS_MPU (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_SET | GPIO_PORT_PIOD | GPIO_PIN27)
|
||||
|
||||
#define PX4_SPI_BUS_SENSORS 1
|
||||
#define PX4_SPI_BUS_SENSORS PX4_BUS_NUMBER_TO_PX4(0)
|
||||
#define PX4_SPI_BUS_BARO PX4_SPI_BUS_SENSORS
|
||||
|
||||
/* Use these in place of the spi_dev_e enumeration to select a specific SPI device on SPI1 */
|
||||
@@ -209,9 +209,9 @@ __BEGIN_DECLS
|
||||
|
||||
|
||||
/* I2C busses */
|
||||
#define PX4_I2C_BUS_EXPANSION 1
|
||||
#define PX4_I2C_BUS_EXPANSION PX4_BUS_NUMBER_TO_PX4(0)
|
||||
/* No Onboard Sensors #define PX4_I2C_BUS_ONBOARD 0 */
|
||||
#define PX4_I2C_BUS_LED 1
|
||||
#define PX4_I2C_BUS_LED PX4_I2C_BUS_EXPANSION
|
||||
|
||||
/* Devices on the onboard bus.
|
||||
*
|
||||
|
||||
@@ -278,10 +278,10 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
|
||||
/* Configure SPI-based devices */
|
||||
|
||||
spi0 = sam_spibus_initialize(0);
|
||||
spi0 = px4_spibus_initialize(PX4_SPI_BUS_SENSORS);
|
||||
|
||||
if (!spi0) {
|
||||
message("[boot] FAILED to initialize SPI port 0\n");
|
||||
message("[boot] FAILED to initialize SPI port %d\n", PX4_SPI_BUS_SENSORS);
|
||||
board_autoled_on(LED_AMBER);
|
||||
return -ENODEV;
|
||||
}
|
||||
@@ -297,7 +297,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
up_udelay(20);
|
||||
|
||||
#if defined(CONFIG_SAMV7_SPI1_MASTER)
|
||||
spi1 = sam_spibus_initialize(1);
|
||||
spi1 = px4_spibus_initialize(PX4_SPI_BUS_MEMORY);
|
||||
|
||||
/* Default SPI4 to 1MHz and de-assert the known chip selects. */
|
||||
SPI_SETFREQUENCY(spi1, 10000000);
|
||||
|
||||
Reference in New Issue
Block a user