From d3fdb2b6ad7c10e0153c19ad59bfc4c9c1cbb7f6 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Mon, 28 Sep 2020 13:43:11 -0700 Subject: [PATCH] nxp_rddrone-uavcan146 add board functions supporting pwm_out --- .../nxp/rddrone-uavcan146/src/board_config.h | 19 +++++++++++++++++++ boards/nxp/rddrone-uavcan146/src/init.c | 19 +++++++++++++++++++ boards/nxp/rddrone-uavcan146/src/spi.c | 4 ++++ 3 files changed, 42 insertions(+) diff --git a/boards/nxp/rddrone-uavcan146/src/board_config.h b/boards/nxp/rddrone-uavcan146/src/board_config.h index 1af447824f..8cca199283 100644 --- a/boards/nxp/rddrone-uavcan146/src/board_config.h +++ b/boards/nxp/rddrone-uavcan146/src/board_config.h @@ -164,6 +164,25 @@ int s32k1xx_bringup(void); void s32k1xx_spidev_initialize(void); #endif +/**************************************************************************************************** + * Name: board_spi_reset board_peripheral_reset + * + * Description: + * Called to reset SPI and the perferal bus + * + ****************************************************************************************************/ +void board_peripheral_reset(int ms); + +/************************************************************************************ + * Name: ucans32k_timer_initialize + * + * Description: + * Called to configure the FTM to provide 1 Mhz + * + ************************************************************************************/ + +void ucans32k_timer_initialize(void); + #include #endif /* __ASSEMBLY__ */ diff --git a/boards/nxp/rddrone-uavcan146/src/init.c b/boards/nxp/rddrone-uavcan146/src/init.c index ffbefdf05f..041633e0fa 100644 --- a/boards/nxp/rddrone-uavcan146/src/init.c +++ b/boards/nxp/rddrone-uavcan146/src/init.c @@ -97,3 +97,22 @@ int board_app_initialize(uintptr_t arg) return s32k1xx_bringup(); #endif } + +/************************************************************************************ + * Name: board_peripheral_reset + * + * Description: + * + ************************************************************************************/ +__EXPORT void board_peripheral_reset(int ms) +{ + /* set the peripheral rails off */ + + /* wait for the peripheral rail to reach GND */ + usleep(ms * 1000); + syslog(LOG_DEBUG, "reset done, %d ms\n", ms); + + /* re-enable power */ + + /* switch the peripheral rail back on */ +} diff --git a/boards/nxp/rddrone-uavcan146/src/spi.c b/boards/nxp/rddrone-uavcan146/src/spi.c index ff6235e6cc..30069e4e2d 100644 --- a/boards/nxp/rddrone-uavcan146/src/spi.c +++ b/boards/nxp/rddrone-uavcan146/src/spi.c @@ -193,4 +193,8 @@ uint8_t s32k1xx_lpspi2status(FAR struct spi_dev_s *dev, uint32_t devid) } #endif +__EXPORT void board_spi_reset(int ms, int bus_mask) +{ + +} #endif /* CONFIG_S32K1XX_LPSPI0 || CONFIG_S32K1XX_LPSPI01 || CONFIG_S32K1XX_LPSPI2 */