1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 12:25:20 +03:00

SPRACING32/NAZE32 - Add support for MPU6050 data ready interrupt.

Currently the interrupt handler is unused.  Later it can be used as a
potential source for watchdog checking or to syncronize the system
around new acc/gyro data availability.

Verified on Naze32 rev 3/4/5 and SPRacingF3 targets.
This commit is contained in:
Dominic Clifton 2015-04-11 19:18:11 +01:00
parent d3d9721e91
commit c11c25514b
10 changed files with 157 additions and 20 deletions

View file

@ -76,19 +76,27 @@ uint8_t detectedSensors[MAX_SENSORS_TO_DETECT] = { GYRO_NONE, ACC_NONE, BARO_NON
const mpu6050Config_t *selectMPU6050Config(void)
{
#ifdef NAZE
// MPU_INT output on rev4/5 hardware (PB13, PC13)
// MPU_INT output on rev4 PB13
static const mpu6050Config_t nazeRev4MPU6050Config = {
.gpioAPB2Peripherals = RCC_APB2Periph_GPIOB,
.gpioPort = GPIOB,
.gpioPin = Pin_13
.gpioPin = Pin_13,
.exti_port_source = GPIO_PortSourceGPIOB,
.exti_pin_source = GPIO_PinSource13,
.exti_line = EXTI_Line13,
.exti_irqn = EXTI15_10_IRQn
};
// MPU_INT output on rev5 hardware PC13
static const mpu6050Config_t nazeRev5MPU6050Config = {
.gpioAPB2Peripherals = RCC_APB2Periph_GPIOC,
.gpioPort = GPIOC,
.gpioPin = Pin_13
.gpioPin = Pin_13,
.exti_port_source = GPIO_PortSourceGPIOC,
.exti_pin_source = GPIO_PinSource13,
.exti_line = EXTI_Line13,
.exti_irqn = EXTI15_10_IRQn
};
if (hardwareRevision < NAZE32_REV5) {
return &nazeRev4MPU6050Config;
} else {
@ -100,10 +108,15 @@ const mpu6050Config_t *selectMPU6050Config(void)
static const mpu6050Config_t spRacingF3MPU6050Config = {
.gpioAHBPeripherals = RCC_AHBPeriph_GPIOC,
.gpioPort = GPIOC,
.gpioPin = Pin_13
.gpioPin = Pin_13,
.exti_port_source = EXTI_PortSourceGPIOC,
.exti_pin_source = EXTI_PinSource13,
.exti_line = EXTI_Line13,
.exti_irqn = EXTI15_10_IRQn
};
return &spRacingF3MPU6050Config;
#endif
return NULL;
}