Browse Source

px4/v5x: enable mcp23009 GPIO driver

release/1.12
Beat Küng 4 years ago committed by Daniel Agar
parent
commit
88fe047556
  1. 1
      boards/px4/fmu-v5x/base_phy_DP83848C.cmake
  2. 1
      boards/px4/fmu-v5x/nuttx-config/base_phy_DP83848C/defconfig
  3. 1
      boards/px4/fmu-v5x/nuttx-config/nsh/defconfig
  4. 5
      boards/px4/fmu-v5x/src/CMakeLists.txt
  5. 8
      boards/px4/fmu-v5x/src/init.cpp

1
boards/px4/fmu-v5x/base_phy_DP83848C.cmake

@ -93,6 +93,7 @@ px4_add_board( @@ -93,6 +93,7 @@ px4_add_board(
dmesg
dumpfile
esc_calib
gpio
hardfault_log
i2cdetect
led_control

1
boards/px4/fmu-v5x/nuttx-config/base_phy_DP83848C/defconfig

@ -57,6 +57,7 @@ CONFIG_DEBUG_HARDFAULT_ALERT=y @@ -57,6 +57,7 @@ CONFIG_DEBUG_HARDFAULT_ALERT=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_DEFAULT_SMALL=y
CONFIG_DEV_FIFO_SIZE=0
CONFIG_DEV_GPIO=y
CONFIG_DEV_PIPE_MAXSIZE=1024
CONFIG_DEV_PIPE_SIZE=70
CONFIG_ETH0_PHY_DP83848C=y

1
boards/px4/fmu-v5x/nuttx-config/nsh/defconfig

@ -57,6 +57,7 @@ CONFIG_DEBUG_HARDFAULT_ALERT=y @@ -57,6 +57,7 @@ CONFIG_DEBUG_HARDFAULT_ALERT=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_DEFAULT_SMALL=y
CONFIG_DEV_FIFO_SIZE=0
CONFIG_DEV_GPIO=y
CONFIG_DEV_PIPE_MAXSIZE=1024
CONFIG_DEV_PIPE_SIZE=70
CONFIG_ETH0_PHY_LAN8742A=y

5
boards/px4/fmu-v5x/src/CMakeLists.txt

@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
add_library(drivers_board
can.c
i2c.cpp
init.c
init.cpp
led.c
manifest.c
mtd.cpp
@ -43,7 +43,7 @@ add_library(drivers_board @@ -43,7 +43,7 @@ add_library(drivers_board
timer_config.cpp
usb.c
)
add_dependencies(drivers_board arch_board_hw_info)
add_dependencies(drivers_board arch_board_hw_info platform_gpio_mcp23009)
target_link_libraries(drivers_board
PRIVATE
@ -53,4 +53,5 @@ target_link_libraries(drivers_board @@ -53,4 +53,5 @@ target_link_libraries(drivers_board
nuttx_arch # sdio
nuttx_drivers # sdio
px4_layer
platform_gpio_mcp23009
)

8
boards/px4/fmu-v5x/src/init.c → boards/px4/fmu-v5x/src/init.cpp

@ -54,7 +54,9 @@ @@ -54,7 +54,9 @@
#include <errno.h>
#include <nuttx/config.h>
extern "C" {
#include <nuttx/board.h>
}
#include <nuttx/spi/spi.h>
#include <nuttx/sdio.h>
#include <nuttx/mmcsd.h>
@ -73,6 +75,7 @@ @@ -73,6 +75,7 @@
#include <px4_platform/gpio.h>
#include <px4_platform/board_determine_hw_info.h>
#include <px4_platform/board_dma_alloc.h>
#include <px4_platform/gpio/mcp23009.hpp>
/****************************************************************************
* Pre-Processor Definitions
@ -158,7 +161,7 @@ __EXPORT void board_on_reset(int status) @@ -158,7 +161,7 @@ __EXPORT void board_on_reset(int status)
*
************************************************************************************/
__EXPORT void
extern "C" __EXPORT void
stm32_boardinitialize(void)
{
board_on_reset(-1); /* Reset PWM first thing */
@ -174,7 +177,7 @@ stm32_boardinitialize(void) @@ -174,7 +177,7 @@ stm32_boardinitialize(void)
/* configure SPI interfaces (we can do this here as long as we only have a single SPI hw config version -
* otherwise we need to move this after board_determine_hw_info()) */
_Static_assert(BOARD_NUM_SPI_CFG_HW_VERSIONS == 1, "Need to move the SPI initialization for multi-version support");
static_assert(BOARD_NUM_SPI_CFG_HW_VERSIONS == 1, "Need to move the SPI initialization for multi-version support");
stm32_spiinitialize();
@ -211,7 +214,6 @@ stm32_boardinitialize(void) @@ -211,7 +214,6 @@ stm32_boardinitialize(void)
*
****************************************************************************/
__EXPORT int board_app_initialize(uintptr_t arg)
{
/* Power on Interfaces */
Loading…
Cancel
Save