mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 17:25:20 +03:00
Initial support for FY90Q hardware
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@146 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
This commit is contained in:
parent
cb334ecf47
commit
d9920756d9
15 changed files with 6681 additions and 2147 deletions
42
src/board.h
42
src/board.h
|
@ -55,7 +55,20 @@ typedef struct sensor_t
|
|||
#define digitalLo(p, i) { p->BRR = i; }
|
||||
#define digitalToggle(p, i) { p->ODR ^= i; }
|
||||
|
||||
// Hardware GPIO
|
||||
// Hardware definitions and GPIO
|
||||
|
||||
#ifdef FY90Q
|
||||
// FY90Q
|
||||
#define LED0_GPIO GPIOC
|
||||
#define LED0_PIN GPIO_Pin_12
|
||||
#define LED1_GPIO GPIOA
|
||||
#define LED1_PIN GPIO_Pin_15
|
||||
|
||||
#define GYRO
|
||||
#define ACC
|
||||
|
||||
#else
|
||||
// Afroflight32
|
||||
#define LED0_GPIO GPIOB
|
||||
#define LED0_PIN GPIO_Pin_3
|
||||
#define LED1_GPIO GPIOB
|
||||
|
@ -65,6 +78,14 @@ typedef struct sensor_t
|
|||
#define BARO_GPIO GPIOC
|
||||
#define BARO_PIN GPIO_Pin_13
|
||||
|
||||
#define GYRO
|
||||
#define ACC
|
||||
#define MAG
|
||||
#define BARO
|
||||
#define LEDRING
|
||||
|
||||
#endif
|
||||
|
||||
// Helpful macros
|
||||
#define LED0_TOGGLE digitalToggle(LED0_GPIO, LED0_PIN);
|
||||
#define LED0_OFF digitalHi(LED0_GPIO, LED0_PIN);
|
||||
|
@ -74,13 +95,26 @@ typedef struct sensor_t
|
|||
#define LED1_OFF digitalHi(LED1_GPIO, LED1_PIN);
|
||||
#define LED1_ON digitalLo(LED1_GPIO, LED1_PIN);
|
||||
|
||||
#ifdef BEEP_GPIO
|
||||
#define BEEP_TOGGLE digitalToggle(BEEP_GPIO, BEEP_PIN);
|
||||
#define BEEP_OFF digitalHi(BEEP_GPIO, BEEP_PIN);
|
||||
#define BEEP_ON digitalLo(BEEP_GPIO, BEEP_PIN);
|
||||
#else
|
||||
#define BEEP_TOGGLE ;
|
||||
#define BEEP_OFF ;
|
||||
#define BEEP_ON ;
|
||||
#endif
|
||||
|
||||
#define BARO_OFF digitalLo(BARO_GPIO, BARO_PIN);
|
||||
#define BARO_ON digitalHi(BARO_GPIO, BARO_PIN);
|
||||
#ifdef FY90Q
|
||||
// FY90Q
|
||||
#include "drv_system.h" // timers, delays, etc
|
||||
#include "drv_adc.h"
|
||||
#include "drv_i2c.h"
|
||||
#include "drv_pwm.h"
|
||||
#include "drv_uart.h"
|
||||
|
||||
#else
|
||||
// AfroFlight32
|
||||
#include "drv_system.h" // timers, delays, etc
|
||||
#include "drv_adc.h"
|
||||
#include "drv_adxl345.h"
|
||||
|
@ -92,3 +126,5 @@ typedef struct sensor_t
|
|||
#include "drv_mpu6050.h"
|
||||
#include "drv_pwm.h"
|
||||
#include "drv_uart.h"
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue