HAL_Linux: separate out the GPIO table for Disco

This commit is contained in:
Andrew Tridgell 2016-06-08 14:55:30 +10:00
parent 677a38a10a
commit 9b057ee4f1
4 changed files with 28 additions and 2 deletions

View File

@ -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

View File

@ -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,

View 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

View File

@ -0,0 +1,8 @@
#pragma once
#include "GPIO_Sysfs.h"
enum gpio_disco {
DISCO_GPIO_MPU6050_DRDY,
_DISCO_GPIO_MAX,
};