mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
HAL_Linux: separate out the GPIO table for Disco
This commit is contained in:
parent
677a38a10a
commit
9b057ee4f1
@ -25,6 +25,8 @@ private:
|
||||
#include "GPIO_RPI.h"
|
||||
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_MINLURE
|
||||
#include "GPIO_Minnow.h"
|
||||
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BEBOP || CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_DISCO
|
||||
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BEBOP
|
||||
#include "GPIO_Bebop.h"
|
||||
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_DISCO
|
||||
#include "GPIO_Disco.h"
|
||||
#endif
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "GPIO_Bebop.h"
|
||||
|
||||
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BEBOP || CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_DISCO
|
||||
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BEBOP
|
||||
|
||||
const unsigned Linux::GPIO_Sysfs::pin_table[] = {
|
||||
[BEBOP_GPIO_CAMV_NRST] = 129,
|
||||
|
16
libraries/AP_HAL_Linux/GPIO_Disco.cpp
Normal file
16
libraries/AP_HAL_Linux/GPIO_Disco.cpp
Normal file
@ -0,0 +1,16 @@
|
||||
#include <AP_Common/AP_Common.h>
|
||||
|
||||
#include "GPIO_Disco.h"
|
||||
|
||||
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_DISCO
|
||||
|
||||
const unsigned Linux::GPIO_Sysfs::pin_table[] = {
|
||||
[DISCO_GPIO_MPU6050_DRDY] = 91,
|
||||
};
|
||||
|
||||
const uint8_t Linux::GPIO_Sysfs::n_pins = _DISCO_GPIO_MAX;
|
||||
|
||||
static_assert(ARRAY_SIZE(Linux::GPIO_Sysfs::pin_table) == _DISCO_GPIO_MAX,
|
||||
"GPIO pin_table must have the same size of entries in enum gpio_disco");
|
||||
|
||||
#endif
|
8
libraries/AP_HAL_Linux/GPIO_Disco.h
Normal file
8
libraries/AP_HAL_Linux/GPIO_Disco.h
Normal file
@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "GPIO_Sysfs.h"
|
||||
|
||||
enum gpio_disco {
|
||||
DISCO_GPIO_MPU6050_DRDY,
|
||||
_DISCO_GPIO_MAX,
|
||||
};
|
Loading…
Reference in New Issue
Block a user