Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
imu_aspirin_arch.c
Go to the documentation of this file.
1#include "modules/imu/imu.h"
2
3#include <libopencm3/stm32/gpio.h>
4#include <libopencm3/stm32/rcc.h>
5#include <libopencm3/stm32/exti.h>
6#include <libopencm3/stm32/spi.h>
7#include <libopencm3/stm32/dma.h>
8#include <libopencm3/cm3/nvic.h>
9
10#include "mcu_periph/i2c.h"
11
12#ifndef STM32F1
13#error "imu_aspirin_arch arch currently only implemented for STM32F1"
14#endif
15
17{
18
19#ifdef ASPIRIN_USE_GYRO_INT
22#endif
23
26
27 // should not be needed anymore, handled by the spi driver
28#if 0
29 /* Enable DMA1 channel4 IRQ Channel ( SPI RX) */
32#endif
33}
34
36{
37
38#ifdef ASPIRIN_USE_GYRO_INT
40#endif
41
43
44 // should not be needed anymore, handled by the spi driver
45#if 0
46 /* Enable DMA1 channel4 IRQ Channel ( SPI RX) */
48#endif
49}
50
52{
53
54 // This was needed for Lisa/L????
55#if 0
56 /* Set "mag ss" and "mag reset" as floating inputs ------------------------*/
57 /* "mag ss" (PC12) is shorted to I2C2 SDA */
58 /* "mag reset" (PC13) is shorted to I2C2 SCL */
62#endif
63
64 /* Gyro --------------------------------------------------------------------*/
65 /* configure external interrupt exti15_10 on PC14( gyro int ) */
70
71#ifdef ASPIRIN_USE_GYRO_INT
75#endif
76
77 /* configure external interrupt exti2 on PB2( accel int ) */
84
85}
86
87
88/****** the interrupts should be handled in the peripheral drivers *******/
89
90/*
91 * Gyro data ready
92 */
93void exti15_10_isr(void)
94{
95
96 /* clear EXTI */
98
99#ifdef ASPIRIN_USE_GYRO_INT
100 imu_aspirin.gyro_eoc = true;
102#endif
103
104}
105
106/*
107 * Accel data ready
108 */
109void exti2_isr(void)
110{
111
112 /* clear EXTI */
114
115 //adxl345_start_reading_data();
116}
117
#define GPIO12
Definition gpio_def.h:43
#define GPIO13
Definition gpio_def.h:44
#define GPIO2
Definition gpio_def.h:33
#define GPIO14
Definition gpio_def.h:45
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
Inertial Measurement Unit interface.
struct ImuAspirin imu_aspirin
Definition imu_aspirin.c:68
void exti2_isr(void)
void imu_aspirin_arch_init(void)
void imu_aspirin_arch_int_enable(void)
void imu_aspirin_arch_int_disable(void)
void exti15_10_isr(void)
uint16_t foo
Definition main_demo5.c:58
#define GPIOC
Definition gpio_arch.h:36
#define GPIOB
Definition gpio_arch.h:35