mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
px4/v5x: enable mcp23009 GPIO driver
This commit is contained in:
@@ -93,6 +93,7 @@ px4_add_board(
|
|||||||
dmesg
|
dmesg
|
||||||
dumpfile
|
dumpfile
|
||||||
esc_calib
|
esc_calib
|
||||||
|
gpio
|
||||||
hardfault_log
|
hardfault_log
|
||||||
i2cdetect
|
i2cdetect
|
||||||
led_control
|
led_control
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ CONFIG_DEBUG_HARDFAULT_ALERT=y
|
|||||||
CONFIG_DEBUG_SYMBOLS=y
|
CONFIG_DEBUG_SYMBOLS=y
|
||||||
CONFIG_DEFAULT_SMALL=y
|
CONFIG_DEFAULT_SMALL=y
|
||||||
CONFIG_DEV_FIFO_SIZE=0
|
CONFIG_DEV_FIFO_SIZE=0
|
||||||
|
CONFIG_DEV_GPIO=y
|
||||||
CONFIG_DEV_PIPE_MAXSIZE=1024
|
CONFIG_DEV_PIPE_MAXSIZE=1024
|
||||||
CONFIG_DEV_PIPE_SIZE=70
|
CONFIG_DEV_PIPE_SIZE=70
|
||||||
CONFIG_ETH0_PHY_DP83848C=y
|
CONFIG_ETH0_PHY_DP83848C=y
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ CONFIG_DEBUG_HARDFAULT_ALERT=y
|
|||||||
CONFIG_DEBUG_SYMBOLS=y
|
CONFIG_DEBUG_SYMBOLS=y
|
||||||
CONFIG_DEFAULT_SMALL=y
|
CONFIG_DEFAULT_SMALL=y
|
||||||
CONFIG_DEV_FIFO_SIZE=0
|
CONFIG_DEV_FIFO_SIZE=0
|
||||||
|
CONFIG_DEV_GPIO=y
|
||||||
CONFIG_DEV_PIPE_MAXSIZE=1024
|
CONFIG_DEV_PIPE_MAXSIZE=1024
|
||||||
CONFIG_DEV_PIPE_SIZE=70
|
CONFIG_DEV_PIPE_SIZE=70
|
||||||
CONFIG_ETH0_PHY_LAN8742A=y
|
CONFIG_ETH0_PHY_LAN8742A=y
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
add_library(drivers_board
|
add_library(drivers_board
|
||||||
can.c
|
can.c
|
||||||
i2c.cpp
|
i2c.cpp
|
||||||
init.c
|
init.cpp
|
||||||
led.c
|
led.c
|
||||||
manifest.c
|
manifest.c
|
||||||
mtd.cpp
|
mtd.cpp
|
||||||
@@ -43,7 +43,7 @@ add_library(drivers_board
|
|||||||
timer_config.cpp
|
timer_config.cpp
|
||||||
usb.c
|
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
|
target_link_libraries(drivers_board
|
||||||
PRIVATE
|
PRIVATE
|
||||||
@@ -53,4 +53,5 @@ target_link_libraries(drivers_board
|
|||||||
nuttx_arch # sdio
|
nuttx_arch # sdio
|
||||||
nuttx_drivers # sdio
|
nuttx_drivers # sdio
|
||||||
px4_layer
|
px4_layer
|
||||||
|
platform_gpio_mcp23009
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -54,7 +54,9 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
extern "C" {
|
||||||
#include <nuttx/board.h>
|
#include <nuttx/board.h>
|
||||||
|
}
|
||||||
#include <nuttx/spi/spi.h>
|
#include <nuttx/spi/spi.h>
|
||||||
#include <nuttx/sdio.h>
|
#include <nuttx/sdio.h>
|
||||||
#include <nuttx/mmcsd.h>
|
#include <nuttx/mmcsd.h>
|
||||||
@@ -73,6 +75,7 @@
|
|||||||
#include <px4_platform/gpio.h>
|
#include <px4_platform/gpio.h>
|
||||||
#include <px4_platform/board_determine_hw_info.h>
|
#include <px4_platform/board_determine_hw_info.h>
|
||||||
#include <px4_platform/board_dma_alloc.h>
|
#include <px4_platform/board_dma_alloc.h>
|
||||||
|
#include <px4_platform/gpio/mcp23009.hpp>
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
@@ -158,7 +161,7 @@ __EXPORT void board_on_reset(int status)
|
|||||||
*
|
*
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
__EXPORT void
|
extern "C" __EXPORT void
|
||||||
stm32_boardinitialize(void)
|
stm32_boardinitialize(void)
|
||||||
{
|
{
|
||||||
board_on_reset(-1); /* Reset PWM first thing */
|
board_on_reset(-1); /* Reset PWM first thing */
|
||||||
@@ -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 -
|
/* 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()) */
|
* 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();
|
stm32_spiinitialize();
|
||||||
|
|
||||||
@@ -211,7 +214,6 @@ stm32_boardinitialize(void)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
__EXPORT int board_app_initialize(uintptr_t arg)
|
__EXPORT int board_app_initialize(uintptr_t arg)
|
||||||
{
|
{
|
||||||
/* Power on Interfaces */
|
/* Power on Interfaces */
|
||||||
Reference in New Issue
Block a user