mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 07:53:33 +08:00
Implemented driver for MCP23017
This commit is contained in:
committed by
Alexander Lerach
parent
3d9905251d
commit
845a2d3632
@@ -18,7 +18,7 @@ CONFIG_DRIVERS_DIFFERENTIAL_PRESSURE_AUAV=y
|
||||
CONFIG_COMMON_DISTANCE_SENSOR=y
|
||||
CONFIG_DRIVERS_DSHOT=y
|
||||
CONFIG_DRIVERS_GNSS_SEPTENTRIO=y
|
||||
CONFIG_DRIVERS_GPIO_MCP23009=y
|
||||
CONFIG_DRIVERS_GPIO_MCP23017=y
|
||||
CONFIG_DRIVERS_GPS=y
|
||||
CONFIG_DRIVERS_IMU_BOSCH_BMI088=y
|
||||
CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y
|
||||
@@ -100,3 +100,4 @@ CONFIG_SYSTEMCMDS_TUNE_CONTROL=y
|
||||
CONFIG_SYSTEMCMDS_UORB=y
|
||||
CONFIG_SYSTEMCMDS_VER=y
|
||||
CONFIG_SYSTEMCMDS_WORK_QUEUE=y
|
||||
CONFIG_SYSTEMCMDS_GPIO=y
|
||||
|
||||
@@ -32,3 +32,6 @@ if ver hwbasecmp 00a 008
|
||||
then
|
||||
mcp23009 start -b 3 -X -D 0xf1 -O 0xf0 -P 0x0f -U 10
|
||||
fi
|
||||
|
||||
mcp23017 start -b 2 -X -D 0x0000 -O 0x0000 -P 0x0000 -U 10 -R 0x0000 # set all pins to OUTPUT
|
||||
#mcp23017 start -b 2 -X -D 0xFFFF -O 0x0000 -P 0x0000 -U 10 -R 0x0101 # set all pins to INPUT and enable interrupts on pins 0 and 8
|
||||
|
||||
@@ -70,5 +70,6 @@ else()
|
||||
nuttx_drivers # sdio
|
||||
px4_layer
|
||||
platform_gpio_mcp23009
|
||||
platform_gpio_mcp23017
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -75,6 +75,7 @@
|
||||
#include <px4_platform/board_determine_hw_info.h>
|
||||
#include <px4_platform/board_dma_alloc.h>
|
||||
#include <px4_platform/gpio/mcp23009.hpp>
|
||||
#include <px4_platform/gpio/mcp23017.hpp>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
@@ -283,6 +284,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
# endif /* CONFIG_MMCSD */
|
||||
|
||||
ret = mcp23009_register_gpios(3, 0x25);
|
||||
ret |= mcp23017_register_gpios(2, 0x27, 0, 0x0000);
|
||||
|
||||
if (ret != OK) {
|
||||
led_on(LED_RED);
|
||||
|
||||
Reference in New Issue
Block a user