diff --git a/boards/nxp/mr-canhubk3/nuttx-config/nsh/defconfig b/boards/nxp/mr-canhubk3/nuttx-config/nsh/defconfig index addbed16f7..08b2268a5b 100644 --- a/boards/nxp/mr-canhubk3/nuttx-config/nsh/defconfig +++ b/boards/nxp/mr-canhubk3/nuttx-config/nsh/defconfig @@ -210,6 +210,7 @@ CONFIG_S32K3XX_LPSPI2_PINCFG=3 CONFIG_S32K3XX_LPSPI3=y CONFIG_S32K3XX_LPSPI3_PINCFG=3 CONFIG_S32K3XX_LPSPI4=y +CONFIG_S32K3XX_LPSPI4_DMA=y CONFIG_S32K3XX_LPSPI4_PINCFG=3 CONFIG_S32K3XX_LPSPI5=y CONFIG_S32K3XX_LPSPI5_DMA=y @@ -225,6 +226,7 @@ CONFIG_S32K3XX_LPUART9=y CONFIG_S32K3XX_LPUART_INVERT=y CONFIG_S32K3XX_LPUART_SINGLEWIRE=y CONFIG_S32K3XX_QSPI=y +CONFIG_S32K3XX_WKPUINTS=y CONFIG_SCHED_HPWORK=y CONFIG_SCHED_HPWORKPRIORITY=249 CONFIG_SCHED_HPWORKSTACKSIZE=1280 diff --git a/boards/nxp/mr-canhubk3/src/spi.cpp b/boards/nxp/mr-canhubk3/src/spi.cpp index 7fa84fea37..325ad7b7d7 100644 --- a/boards/nxp/mr-canhubk3/src/spi.cpp +++ b/boards/nxp/mr-canhubk3/src/spi.cpp @@ -71,10 +71,10 @@ constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin17}) }), initSPIBus(SPI::Bus::SPI4, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortA, GPIO::Pin16}, SPI::DRDY{GPIO::PortA, GPIO::Pin15, 551}) + initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortA, GPIO::Pin16}, SPI::DRDY{PIN_WKPU20}) }), initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20649, SPI::CS{GPIO::PortA, GPIO::Pin14}, SPI::DRDY{GPIO::PortA, GPIO::Pin13, 549}) + initSPIDevice(DRV_IMU_DEVTYPE_ICM20649, SPI::CS{GPIO::PortA, GPIO::Pin14}, SPI::DRDY{PIN_WKPU4}) }), }; diff --git a/platforms/nuttx/src/px4/nxp/s32k3xx/include/px4_arch/hw_description.h b/platforms/nuttx/src/px4/nxp/s32k3xx/include/px4_arch/hw_description.h index 2f570d79e2..9ae0300f27 100644 --- a/platforms/nuttx/src/px4/nxp/s32k3xx/include/px4_arch/hw_description.h +++ b/platforms/nuttx/src/px4/nxp/s32k3xx/include/px4_arch/hw_description.h @@ -131,7 +131,6 @@ enum Pin { struct GPIOPin { Port port; Pin pin; - uint16_t imcr; }; } @@ -244,7 +243,7 @@ enum class Bus { }; using CS = GPIO::GPIOPin; -using DRDY = GPIO::GPIOPin; +using DRDY = uint32_t; struct bus_device_external_cfg_t { CS cs_gpio; diff --git a/platforms/nuttx/src/px4/nxp/s32k3xx/include/px4_arch/spi_hw_description.h b/platforms/nuttx/src/px4/nxp/s32k3xx/include/px4_arch/spi_hw_description.h index e97c3fdc98..5613a1c328 100644 --- a/platforms/nuttx/src/px4/nxp/s32k3xx/include/px4_arch/spi_hw_description.h +++ b/platforms/nuttx/src/px4/nxp/s32k3xx/include/px4_arch/spi_hw_description.h @@ -45,9 +45,8 @@ static inline constexpr px4_spi_bus_device_t initSPIDevice(uint32_t devid, SPI:: px4_spi_bus_device_t ret{}; ret.cs_gpio = getGPIOPort(cs_gpio.port) | getGPIOPin(cs_gpio.pin) | (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE); - if (drdy_gpio.port != GPIO::PortInvalid) { - ret.drdy_gpio = getGPIOPort(drdy_gpio.port) | getGPIOPin(drdy_gpio.pin) | getIMCR(drdy_gpio.imcr) | - (GPIO_PULLUP | PIN_INT_BOTH); + if (drdy_gpio != 0) { + ret.drdy_gpio = drdy_gpio; } if (PX4_SPIDEVID_TYPE(devid) == 0) { // it's a PX4 device (internal or external)