paparazzi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paparazzi-commits] [6214] moved peripherals arch


From: Felix Ruess
Subject: [paparazzi-commits] [6214] moved peripherals arch
Date: Sat, 23 Oct 2010 21:12:06 +0000

Revision: 6214
          http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=6214
Author:   flixr
Date:     2010-10-23 21:12:06 +0000 (Sat, 23 Oct 2010)
Log Message:
-----------
moved peripherals arch

Modified Paths:
--------------
    paparazzi3/trunk/conf/airframes/Poine/beth.xml
    paparazzi3/trunk/conf/autopilot/booz2_test_progs.makefile
    paparazzi3/trunk/conf/autopilot/booz_test_progs.makefile
    paparazzi3/trunk/conf/autopilot/lisa_l_test_progs.makefile
    paparazzi3/trunk/conf/autopilot/lisa_test_progs.makefile
    
paparazzi3/trunk/conf/autopilot/subsystems/lisa_passthrough/imu_b2_v1.1.makefile
    
paparazzi3/trunk/conf/autopilot/subsystems/lisa_passthrough/imu_b2_v1.2.makefile
    paparazzi3/trunk/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.0.makefile
    paparazzi3/trunk/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.1.makefile
    paparazzi3/trunk/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.2.makefile
    paparazzi3/trunk/conf/autopilot/subsystems/rotorcraft/imu_crista.makefile
    paparazzi3/trunk/sw/airborne/arch/lpc21/sys_time_hw.c
    paparazzi3/trunk/sw/airborne/booz/arch/stm32/peripherals/hmc5843_arch.c
    paparazzi3/trunk/sw/airborne/booz/test/booz2_test_max1168.c
    paparazzi3/trunk/sw/airborne/lisa/test/lisa_test_aspirin.c
    paparazzi3/trunk/sw/airborne/lisa/test/lisa_test_hmc5843.c
    paparazzi3/trunk/sw/airborne/lisa/test/lisa_test_max1168.c
    paparazzi3/trunk/sw/airborne/lisa/test/lisa_test_ms2001.c
    paparazzi3/trunk/sw/airborne/lisa/test/lisa_test_ms2100.c
    paparazzi3/trunk/sw/airborne/peripherals/adxl345.h
    paparazzi3/trunk/sw/airborne/peripherals/ami601.c
    paparazzi3/trunk/sw/airborne/peripherals/ami601.h
    paparazzi3/trunk/sw/airborne/peripherals/hmc5843.c
    paparazzi3/trunk/sw/airborne/peripherals/hmc5843.h
    paparazzi3/trunk/sw/airborne/peripherals/itg3200.h
    paparazzi3/trunk/sw/airborne/peripherals/max1168.c
    paparazzi3/trunk/sw/airborne/peripherals/max1168.h
    paparazzi3/trunk/sw/airborne/peripherals/ms2001.c
    paparazzi3/trunk/sw/airborne/peripherals/ms2001.h
    paparazzi3/trunk/sw/airborne/peripherals/sc18i600.c
    paparazzi3/trunk/sw/airborne/peripherals/sc18i600.h
    paparazzi3/trunk/sw/airborne/subsystems/imu/arch/lpc21/imu_b2_arch.c
    paparazzi3/trunk/sw/airborne/subsystems/imu/arch/sim/imu_b2_arch.c
    paparazzi3/trunk/sw/airborne/subsystems/imu/arch/stm32/imu_b2_arch.c
    paparazzi3/trunk/sw/airborne/subsystems/imu/imu_aspirin.h
    paparazzi3/trunk/sw/airborne/subsystems/imu/imu_b2.c
    paparazzi3/trunk/sw/airborne/subsystems/imu/imu_b2.h
    paparazzi3/trunk/sw/airborne/subsystems/imu/imu_crista.h
    paparazzi3/trunk/sw/airborne/test/peripherals/test_ami601.c

Added Paths:
-----------
    paparazzi3/trunk/sw/airborne/arch/lpc21/peripherals/
    paparazzi3/trunk/sw/airborne/arch/lpc21/peripherals/max1168_arch.c
    paparazzi3/trunk/sw/airborne/arch/lpc21/peripherals/max1168_arch.h
    paparazzi3/trunk/sw/airborne/arch/lpc21/peripherals/ms2001_arch.c
    paparazzi3/trunk/sw/airborne/arch/lpc21/peripherals/ms2001_arch.h
    paparazzi3/trunk/sw/airborne/arch/sim/peripherals/
    paparazzi3/trunk/sw/airborne/arch/sim/peripherals/max1168_arch.c
    paparazzi3/trunk/sw/airborne/arch/sim/peripherals/max1168_arch.h
    paparazzi3/trunk/sw/airborne/arch/stm32/peripherals/
    paparazzi3/trunk/sw/airborne/arch/stm32/peripherals/max1168_arch.c
    paparazzi3/trunk/sw/airborne/arch/stm32/peripherals/max1168_arch.h
    paparazzi3/trunk/sw/airborne/arch/stm32/peripherals/ms2001_arch.c
    paparazzi3/trunk/sw/airborne/arch/stm32/peripherals/ms2001_arch.h

Removed Paths:
-------------
    paparazzi3/trunk/sw/airborne/booz/arch/lpc21/peripherals/
    paparazzi3/trunk/sw/airborne/booz/arch/sim/peripherals/
    paparazzi3/trunk/sw/airborne/booz/arch/stm32/peripherals/booz_max1168_arch.c
    paparazzi3/trunk/sw/airborne/booz/arch/stm32/peripherals/booz_max1168_arch.h
    paparazzi3/trunk/sw/airborne/booz/arch/stm32/peripherals/booz_ms2001_arch.c
    paparazzi3/trunk/sw/airborne/booz/arch/stm32/peripherals/booz_ms2001_arch.h

Modified: paparazzi3/trunk/conf/airframes/Poine/beth.xml
===================================================================
--- paparazzi3/trunk/conf/airframes/Poine/beth.xml      2010-10-23 21:11:54 UTC 
(rev 6213)
+++ paparazzi3/trunk/conf/airframes/Poine/beth.xml      2010-10-23 21:12:06 UTC 
(rev 6214)
@@ -129,8 +129,8 @@
 #main_stm32.srcs += $(SRC_FIRMWARE)/imu.c
 #main_stm32.CFLAGS += -DUSE_SPI2 -DUSE_DMA1_C4_IRQ -DUSE_EXTI2_IRQ 
-DUSE_SPI2_IRQ
 #main_stm32.srcs += $(SRC_FIRMWARE)/imu/imu_b2.c 
$(SRC_FIRMWARE)/imu/arch/$(ARCH)/imu_b2_arch.c
-#main_stm32.srcs += $(SRC_BOOZ)/peripherals/booz_max1168.c 
$(SRC_BOOZ_ARCH)/peripherals/booz_max1168_arch.c
-#main_stm32.srcs += $(SRC_BOOZ)/peripherals/booz_ms2001.c  
$(SRC_BOOZ_ARCH)/peripherals/booz_ms2001_arch.c
+#main_stm32.srcs += peripherals/max1168.c 
$(SRC_ARCH)/peripherals/max1168_arch.c
+#main_stm32.srcs += peripherals/ms2001.c  $(SRC_ARCH)/peripherals/ms2001_arch.c
 #main_stm32.srcs += math/pprz_trig_int.c
 
 #crista IMU

Modified: paparazzi3/trunk/conf/autopilot/booz2_test_progs.makefile
===================================================================
--- paparazzi3/trunk/conf/autopilot/booz2_test_progs.makefile   2010-10-23 
21:11:54 UTC (rev 6213)
+++ paparazzi3/trunk/conf/autopilot/booz2_test_progs.makefile   2010-10-23 
21:12:06 UTC (rev 6214)
@@ -72,8 +72,8 @@
 test_max1168.srcs   += downlink.c pprz_transport.c
 
 test_max1168.CFLAGS += -DMAX1168_EOC_VIC_SLOT=8 -DSSP_VIC_SLOT=9
-test_max1168.srcs   += $(SRC_BOOZ)/peripherals/booz_max1168.c \
-                                          
$(SRC_BOOZ_ARCH)/peripherals/booz_max1168_arch.c
+test_max1168.srcs   += peripherals/max1168.c \
+                                          
$(SRC_ARCH)/peripherals/max1168_arch.c
 
 #
 # test MICROMAG

Modified: paparazzi3/trunk/conf/autopilot/booz_test_progs.makefile
===================================================================
--- paparazzi3/trunk/conf/autopilot/booz_test_progs.makefile    2010-10-23 
21:11:54 UTC (rev 6213)
+++ paparazzi3/trunk/conf/autopilot/booz_test_progs.makefile    2010-10-23 
21:12:06 UTC (rev 6214)
@@ -229,6 +229,6 @@
 test_ami601.srcs += downlink.c pprz_transport.c
 
 test_ami601.CFLAGS += -DUSE_AMI601
-test_ami601.srcs += $(SRC_BOOZ)/peripherals/booz_ami601.c
+test_ami601.srcs += peripherals/ami601.c
 test_ami601.CFLAGS += -DUSE_I2C1  -DI2C1_SCLL=150 -DI2C1_SCLH=150 
-DI2C1_VIC_SLOT=11
 test_ami601.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c

Modified: paparazzi3/trunk/conf/autopilot/lisa_l_test_progs.makefile
===================================================================
--- paparazzi3/trunk/conf/autopilot/lisa_l_test_progs.makefile  2010-10-23 
21:11:54 UTC (rev 6213)
+++ paparazzi3/trunk/conf/autopilot/lisa_l_test_progs.makefile  2010-10-23 
21:12:06 UTC (rev 6214)
@@ -318,8 +318,8 @@
 test_imu_b2.CFLAGS += -DMAX_1168_DRDY_PORT_SOURCE=$(MAX_1168_DRDY_PORT_SOURCE)
 test_imu_b2.CFLAGS += -DUSE_SPI2 -DUSE_DMA1_C4_IRQ -DUSE_EXTI2_IRQ 
-DUSE_SPI2_IRQ
 test_imu_b2.srcs += $(SRC_FIRMWARE)/imu/imu_b2.c 
$(SRC_FIRMWARE)/imu/arch/$(ARCH)/imu_b2_arch.c
-test_imu_b2.srcs += $(SRC_BOOZ)/peripherals/booz_max1168.c 
$(SRC_BOOZ_ARCH)/peripherals/booz_max1168_arch.c
-test_imu_b2.srcs += $(SRC_BOOZ)/peripherals/booz_ms2001.c  
$(SRC_BOOZ_ARCH)/peripherals/booz_ms2001_arch.c
+test_imu_b2.srcs += peripherals/max1168.c 
$(SRC_ARCH)/peripherals/max1168_arch.c
+test_imu_b2.srcs += peripherals/ms2001.c  $(SRC_ARCH)/peripherals/ms2001_arch.c
 
 #
 # test IMU b2 1.2
@@ -359,10 +359,10 @@
 test_imu_b2_2.CFLAGS += 
-DMAX_1168_DRDY_PORT_SOURCE=$(MAX_1168_DRDY_PORT_SOURCE)
 test_imu_b2_2.CFLAGS += -DUSE_SPI2 -DUSE_DMA1_C4_IRQ -DUSE_EXTI2_IRQ 
-DUSE_SPI2_IRQ
 test_imu_b2_2.srcs += $(SRC_FIRMWARE)/imu/imu_b2.c 
$(SRC_FIRMWARE)/imu/arch/$(ARCH)/imu_b2_arch.c
-test_imu_b2_2.srcs += $(SRC_BOOZ)/peripherals/booz_max1168.c 
$(SRC_BOOZ_ARCH)/peripherals/booz_max1168_arch.c
+test_imu_b2_2.srcs += peripherals/max1168.c 
$(SRC_ARCH)/peripherals/max1168_arch.c
 test_imu_b2_2.CFLAGS += -DUSE_I2C2
 test_imu_b2_2.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c
-test_imu_b2_2.srcs += $(SRC_BOOZ)/peripherals/booz_hmc5843.c 
$(SRC_BOOZ_ARCH)/peripherals/hmc5843_arch.c
+test_imu_b2_2.srcs += peripherals/hmc5843.c 
$(SRC_BOOZ_ARCH)/peripherals/hmc5843_arch.c
 test_imu_b2_2.CFLAGS += -DUSE_EXTI9_5_IRQ    # Mag Int on PB5
 
 

Modified: paparazzi3/trunk/conf/autopilot/lisa_test_progs.makefile
===================================================================
--- paparazzi3/trunk/conf/autopilot/lisa_test_progs.makefile    2010-10-23 
21:11:54 UTC (rev 6213)
+++ paparazzi3/trunk/conf/autopilot/lisa_test_progs.makefile    2010-10-23 
21:12:06 UTC (rev 6214)
@@ -427,8 +427,8 @@
 test_imu_b2.srcs += $(SRC_FIRMWARE)/imu.c
 test_imu_b2.CFLAGS += -DUSE_SPI2 -DUSE_DMA1_C4_IRQ -DUSE_EXTI2_IRQ 
-DUSE_SPI2_IRQ
 test_imu_b2.srcs += $(SRC_FIRMWARE)/imu/imu_b2.c 
$(SRC_FIRMWARE)/imu/arch/$(ARCH)/imu_b2_arch.c
-test_imu_b2.srcs += $(SRC_BOOZ)/peripherals/booz_max1168.c 
$(SRC_BOOZ_ARCH)/peripherals/booz_max1168_arch.c
-test_imu_b2.srcs += $(SRC_BOOZ)/peripherals/booz_ms2001.c  
$(SRC_BOOZ_ARCH)/peripherals/booz_ms2001_arch.c
+test_imu_b2.srcs += peripherals/max1168.c 
$(SRC_ARCH)/peripherals/max1168_arch.c
+test_imu_b2.srcs += peripherals/ms2001.c  $(SRC_ARCH)/peripherals/ms2001_arch.c
 
 
 #
@@ -851,8 +851,8 @@
 test_sc18is600.srcs += math/pprz_trig_int.c
 
 test_sc18is600.CFLAGS += -DUSE_EXTI2_IRQ  -DUSE_DMA1_C4_IRQ
-test_sc18is600.srcs += $(SRC_BOOZ)/peripherals/booz_sc18is600.c \
-                       $(SRC_BOOZ_ARCH)/peripherals/booz_sc18is600_arch.c
+test_sc18is600.srcs += peripherals/booz_sc18is600.c \
+                       $(SRC_ARCH)/peripherals/sc18is600_arch.c
 
 
 #
@@ -873,8 +873,8 @@
 test_max1168.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c
 
 test_max1168.CFLAGS += -DUSE_SPI2 -DUSE_EXTI2_IRQ -DUSE_DMA1_C4_IRQ 
-DMAX1168_HANDLES_DMA_IRQ
-test_max1168.srcs   += $(SRC_BOOZ)/peripherals/booz_max1168.c \
-                       $(SRC_BOOZ_ARCH)/peripherals/booz_max1168_arch.c
+test_max1168.srcs   += peripherals/max1168.c \
+                       $(SRC_ARCH)/peripherals/max1168_arch.c
 
 test_max1168.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600
 test_max1168.srcs += $(SRC_ARCH)/uart_hw.c
@@ -902,8 +902,8 @@
 test_ms2001.CFLAGS += -DUSE_SPI2
 test_ms2001.CFLAGS += -DUSE_DMA1_C4_IRQ -DMS2001_HANDLES_DMA_IRQ
 test_ms2001.CFLAGS += -DUSE_SPI2_IRQ -DMS2001_HANDLES_SPI_IRQ
-test_ms2001.srcs   += $(SRC_BOOZ)/peripherals/booz_ms2001.c \
-                      $(SRC_BOOZ_ARCH)/peripherals/booz_ms2001_arch.c
+test_ms2001.srcs   += peripherals/ms2001.c \
+                      $(SRC_ARCH)/peripherals/ms2001_arch.c
 
 test_ms2001.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600
 test_ms2001.srcs += $(SRC_ARCH)/uart_hw.c
@@ -1095,8 +1095,8 @@
 ptw.srcs += $(SRC_FIRMWARE)/imu.c
 ptw.CFLAGS += -DUSE_SPI2 -DUSE_DMA1_C4_IRQ -DUSE_EXTI2_IRQ -DUSE_SPI2_IRQ
 ptw.srcs += $(SRC_FIRMWARE)/imu/imu_b2.c 
$(SRC_FIRMWARE)/imu/arch/$(ARCH)/imu_b2_arch.c
-ptw.srcs += $(SRC_BOOZ)/peripherals/booz_max1168.c 
$(SRC_BOOZ_ARCH)/peripherals/booz_max1168_arch.c
-ptw.srcs += $(SRC_BOOZ)/peripherals/booz_ms2001.c  
$(SRC_BOOZ_ARCH)/peripherals/booz_ms2001_arch.c
+ptw.srcs += peripherals/max1168.c $(SRC_ARCH)/peripherals/max1168_arch.c
+ptw.srcs += peripherals/ms2001.c  $(SRC_ARCH)/peripherals/ms2001_arch.c
 ptw.srcs += math/pprz_trig_int.c
 
 ptw.srcs += $(SRC_BOOZ)/booz2_commands.c
@@ -1354,8 +1354,8 @@
 hs_gyro_b2.srcs += $(SRC_FIRMWARE)/imu.c
 hs_gyro_b2.CFLAGS += -DUSE_SPI2 -DUSE_DMA1_C4_IRQ -DUSE_EXTI2_IRQ 
-DUSE_SPI2_IRQ
 hs_gyro_b2.srcs += $(SRC_FIRMWARE)/imu/imu_b2.c 
$(SRC_FIRMWARE)/imu/arch/$(ARCH)/imu_b2_arch.c
-hs_gyro_b2.srcs += $(SRC_BOOZ)/peripherals/booz_max1168.c 
$(SRC_BOOZ_ARCH)/peripherals/booz_max1168_arch.c
-hs_gyro_b2.srcs += $(SRC_BOOZ)/peripherals/booz_ms2001.c  
$(SRC_BOOZ_ARCH)/peripherals/booz_ms2001_arch.c
+hs_gyro_b2.srcs += peripherals/max1168.c $(SRC_ARCH)/peripherals/max1168_arch.c
+hs_gyro_b2.srcs += peripherals/ms2001.c  $(SRC_ARCH)/peripherals/ms2001_arch.c
 
 #
 # Spits every samples of one axis of gyro on IMU crista

Modified: 
paparazzi3/trunk/conf/autopilot/subsystems/lisa_passthrough/imu_b2_v1.1.makefile
===================================================================
--- 
paparazzi3/trunk/conf/autopilot/subsystems/lisa_passthrough/imu_b2_v1.1.makefile
    2010-10-23 21:11:54 UTC (rev 6213)
+++ 
paparazzi3/trunk/conf/autopilot/subsystems/lisa_passthrough/imu_b2_v1.1.makefile
    2010-10-23 21:12:06 UTC (rev 6214)
@@ -47,11 +47,11 @@
                   $(SRC_FIRMWARE)/imu/imu_b2.c            \
                   $(SRC_FIRMWARE)/imu/arch/$(ARCH)/imu_b2_arch.c
 
-$(TARGET).srcs += $(SRC_BOOZ)/peripherals/booz_max1168.c \
-                  $(SRC_BOOZ_ARCH)/peripherals/booz_max1168_arch.c
+$(TARGET).srcs += peripherals/max1168.c \
+                  $(SRC_ARCH)/peripherals/max1168_arch.c
 
-$(TARGET).srcs += $(SRC_BOOZ)/peripherals/booz_ms2001.c \
-                  $(SRC_BOOZ_ARCH)/peripherals/booz_ms2001_arch.c
+$(TARGET).srcs += peripherals/ms2001.c \
+                  $(SRC_ARCH)/peripherals/ms2001_arch.c
 
 ifeq ($(ARCH), lpc21)
 $(TARGET).CFLAGS += -DSSP_VIC_SLOT=9
@@ -75,9 +75,9 @@
                        $(SRC_BOOZ_SIM)/imu/imu_b2_arch.c
 
 
-sim.srcs += $(SRC_BOOZ)/peripherals/booz_max1168.c \
-                       $(SRC_BOOZ_SIM)/peripherals/booz_max1168_arch.c
+sim.srcs += peripherals/max1168.c \
+                       $(SRC_BOOZ_SIM)/peripherals/max1168_arch.c
 
 sim.CFLAGS += -DUSE_AMI601
-sim.srcs += $(SRC_BOOZ)/peripherals/booz_ami601.c
+sim.srcs += peripherals/ami601.c
 sim.CFLAGS += -DUSE_I2C1

Modified: 
paparazzi3/trunk/conf/autopilot/subsystems/lisa_passthrough/imu_b2_v1.2.makefile
===================================================================
--- 
paparazzi3/trunk/conf/autopilot/subsystems/lisa_passthrough/imu_b2_v1.2.makefile
    2010-10-23 21:11:54 UTC (rev 6213)
+++ 
paparazzi3/trunk/conf/autopilot/subsystems/lisa_passthrough/imu_b2_v1.2.makefile
    2010-10-23 21:12:06 UTC (rev 6214)
@@ -51,10 +51,10 @@
            $(SRC_FIRMWARE)/imu/imu_b2.c            \
            $(SRC_FIRMWARE)/imu/arch/$(ARCH)/imu_b2_arch.c
 
-imu_srcs += $(SRC_BOOZ)/peripherals/booz_max1168.c \
-            $(SRC_BOOZ_ARCH)/peripherals/booz_max1168_arch.c
+imu_srcs += peripherals/max1168.c \
+            $(SRC_ARCH)/peripherals/max1168_arch.c
 
-imu_srcs += $(SRC_BOOZ)/peripherals/booz_hmc5843.c \
+imu_srcs += peripherals/hmc5843.c \
             $(SRC_BOOZ_ARCH)/peripherals/hmc5843_arch.c
 
 ifeq ($(ARCH), lpc21)
@@ -87,9 +87,9 @@
             $(SRC_FIRMWARE)/imu/imu_b2.c            \
             $(SRC_FIRMWARE)/imu/arch/$(ARCH)/imu_b2_arch.c
 
-sim.srcs += $(SRC_BOOZ)/peripherals/booz_max1168.c \
-            $(SRC_BOOZ_SIM)/peripherals/booz_max1168_arch.c
+sim.srcs += peripherals/max1168.c \
+            $(SRC_BOOZ_SIM)/peripherals/max1168_arch.c
 
 sim.CFLAGS += -DUSE_AMI601
-sim.srcs   += $(SRC_BOOZ)/peripherals/booz_ami601.c
+sim.srcs   += peripherals/ami601.c
 sim.CFLAGS += -DUSE_I2C1

Modified: 
paparazzi3/trunk/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.0.makefile
===================================================================
--- paparazzi3/trunk/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.0.makefile  
2010-10-23 21:11:54 UTC (rev 6213)
+++ paparazzi3/trunk/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.0.makefile  
2010-10-23 21:12:06 UTC (rev 6214)
@@ -48,11 +48,11 @@
            $(SRC_SUBSYSTEMS)/imu/arch/$(ARCH)/imu_b2_arch.c
 
 ap.CFLAGS += -DMAX1168_EOC_VIC_SLOT=8
-ap.srcs += $(SRC_BOOZ)/peripherals/booz_max1168.c \
-           $(SRC_BOOZ_ARCH)/peripherals/booz_max1168_arch.c
+ap.srcs += peripherals/max1168.c \
+           $(SRC_ARCH)/peripherals/max1168_arch.c
 
 ap.CFLAGS += -DUSE_AMI601
-ap.srcs += $(SRC_BOOZ)/peripherals/booz_ami601.c
+ap.srcs += peripherals/ami601.c
 ap.CFLAGS += -DUSE_I2C1  -DI2C1_SCLL=150 -DI2C1_SCLH=150 -DI2C1_VIC_SLOT=11
 
 
@@ -70,9 +70,9 @@
            $(SRC_SUBSYSTEMS)/imu/imu_b2.c            \
            $(SRC_SUBSYSTEMS)/imu/arch/$(ARCH)/imu_b2_arch.c
 
-sim.srcs += $(SRC_BOOZ)/peripherals/booz_max1168.c \
-            $(SRC_BOOZ_SIM)/peripherals/booz_max1168_arch.c
+sim.srcs += peripherals/max1168.c \
+            $(SRC_BOOZ_SIM)/peripherals/max1168_arch.c
 
 sim.CFLAGS += -DUSE_AMI601
-sim.srcs += $(SRC_BOOZ)/peripherals/booz_ami601.c
+sim.srcs += peripherals/ami601.c
 sim.CFLAGS += -DUSE_I2C1

Modified: 
paparazzi3/trunk/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.1.makefile
===================================================================
--- paparazzi3/trunk/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.1.makefile  
2010-10-23 21:11:54 UTC (rev 6213)
+++ paparazzi3/trunk/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.1.makefile  
2010-10-23 21:12:06 UTC (rev 6214)
@@ -51,11 +51,11 @@
            $(SRC_SUBSYSTEMS)/imu/imu_b2.c            \
            $(SRC_SUBSYSTEMS)/imu/arch/$(ARCH)/imu_b2_arch.c
 
-imu_srcs += $(SRC_BOOZ)/peripherals/booz_max1168.c \
-            $(SRC_BOOZ_ARCH)/peripherals/booz_max1168_arch.c
+imu_srcs += peripherals/max1168.c \
+            $(SRC_ARCH)/peripherals/max1168_arch.c
 
-imu_srcs += $(SRC_BOOZ)/peripherals/booz_ms2001.c \
-            $(SRC_BOOZ_ARCH)/peripherals/booz_ms2001_arch.c
+imu_srcs += peripherals/ms2001.c \
+            $(SRC_ARCH)/peripherals/ms2001_arch.c
 
 ifeq ($(ARCH), lpc21)
 imu_CFLAGS += -DSSP_VIC_SLOT=9
@@ -86,9 +86,9 @@
             $(SRC_SUBSYSTEMS)/imu/imu_b2.c            \
             $(SRC_SUBSYSTEMS)/imu/arch/$(ARCH)/imu_b2_arch.c
 
-sim.srcs += $(SRC_BOOZ)/peripherals/booz_max1168.c \
-            $(SRC_BOOZ_SIM)/peripherals/booz_max1168_arch.c
+sim.srcs += peripherals/max1168.c \
+            $(SRC_BOOZ_SIM)/peripherals/max1168_arch.c
 
 sim.CFLAGS += -DUSE_AMI601
-sim.srcs   += $(SRC_BOOZ)/peripherals/booz_ami601.c
+sim.srcs   += peripherals/ami601.c
 sim.CFLAGS += -DUSE_I2C1

Modified: 
paparazzi3/trunk/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.2.makefile
===================================================================
--- paparazzi3/trunk/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.2.makefile  
2010-10-23 21:11:54 UTC (rev 6213)
+++ paparazzi3/trunk/conf/autopilot/subsystems/rotorcraft/imu_b2_v1.2.makefile  
2010-10-23 21:12:06 UTC (rev 6214)
@@ -51,11 +51,11 @@
            $(SRC_SUBSYSTEMS)/imu/imu_b2.c            \
            $(SRC_SUBSYSTEMS)/imu/arch/$(ARCH)/imu_b2_arch.c
 
-imu_srcs += $(SRC_BOOZ)/peripherals/booz_max1168.c \
-            $(SRC_BOOZ_ARCH)/peripherals/booz_max1168_arch.c
+imu_srcs += peripherals/max1168.c \
+            $(SRC_ARCH)/peripherals/max1168_arch.c
 
 imu_srcs += i2c.c $(SRC_ARCH)/i2c_hw.c
-imu_srcs += $(SRC_BOOZ)/peripherals/booz_hmc5843.c \
+imu_srcs += peripherals/hmc5843.c \
             $(SRC_BOOZ_ARCH)/peripherals/hmc5843_arch.c
 
 ifeq ($(ARCH), lpc21)
@@ -88,9 +88,9 @@
             $(SRC_SUBSYSTEMS)/imu/imu_b2.c            \
             $(SRC_SUBSYSTEMS)/imu/arch/$(ARCH)/imu_b2_arch.c
 
-sim.srcs += $(SRC_BOOZ)/peripherals/booz_max1168.c \
-            $(SRC_BOOZ_SIM)/peripherals/booz_max1168_arch.c
+sim.srcs += peripherals/max1168.c \
+            $(SRC_BOOZ_SIM)/peripherals/max1168_arch.c
 
 sim.CFLAGS += -DUSE_AMI601
-sim.srcs   += $(SRC_BOOZ)/peripherals/booz_ami601.c
+sim.srcs   += peripherals/ami601.c
 sim.CFLAGS += -DUSE_I2C1

Modified: 
paparazzi3/trunk/conf/autopilot/subsystems/rotorcraft/imu_crista.makefile
===================================================================
--- paparazzi3/trunk/conf/autopilot/subsystems/rotorcraft/imu_crista.makefile   
2010-10-23 21:11:54 UTC (rev 6213)
+++ paparazzi3/trunk/conf/autopilot/subsystems/rotorcraft/imu_crista.makefile   
2010-10-23 21:12:06 UTC (rev 6214)
@@ -69,7 +69,7 @@
            $(SRC_SUBSYSTEMS)/imu/arch/$(ARCH)/imu_crista_arch.c
 
 ap.CFLAGS += -DUSE_AMI601
-ap.srcs   += $(SRC_BOOZ)/peripherals/booz_ami601.c
+ap.srcs   += peripherals/ami601.c
 ap.CFLAGS += -DUSE_I2C1  -DI2C1_SCLL=150 -DI2C1_SCLH=150 -DI2C1_VIC_SLOT=11 
-DI2C1_BUF_LEN=16
 
 
@@ -86,5 +86,5 @@
               $(SRC_SUBSYSTEMS)/imu/arch/$(ARCH)/imu_crista_arch.c
 
 sim.CFLAGS += -DUSE_AMI601
-sim.srcs   += $(SRC_BOOZ)/peripherals/booz_ami601.c
+sim.srcs   += peripherals/ami601.c
 sim.CFLAGS += -DUSE_I2C1

Copied: paparazzi3/trunk/sw/airborne/arch/lpc21/peripherals/max1168_arch.c 
(from rev 6213, 
paparazzi3/trunk/sw/airborne/booz/arch/lpc21/peripherals/booz_max1168_arch.c)
===================================================================
--- paparazzi3/trunk/sw/airborne/arch/lpc21/peripherals/max1168_arch.c          
                (rev 0)
+++ paparazzi3/trunk/sw/airborne/arch/lpc21/peripherals/max1168_arch.c  
2010-10-23 21:12:06 UTC (rev 6214)
@@ -0,0 +1,91 @@
+/*
+ * $Id$
+ *
+ * Copyright (C) 2008-2009 Antoine Drouin <address@hidden>
+ *
+ * This file is part of paparazzi.
+ *
+ * paparazzi is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * paparazzi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with paparazzi; see the file COPYING.  If not, write to
+ * the Free Software Foundation, 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "peripherals/max1168.h"
+
+static void EXTINT0_ISR(void) __attribute__((naked));
+
+void max1168_arch_init( void ) {
+
+  /* unselected max1168 */
+  Max1168Unselect();
+  /* SS pin is output */
+  SetBit(MAX1168_SS_IODIR, MAX1168_SS_PIN);
+
+  /* connect P0.16 to extint0 (EOC) */
+  MAX1168_EOC_PINSEL |= MAX1168_EOC_PINSEL_VAL << MAX1168_EOC_PINSEL_BIT;
+  /* extint0 is edge trigered */
+  SetBit(EXTMODE, MAX1168_EOC_EINT);
+  /* extint0 is trigered on falling edge */
+  ClearBit(EXTPOLAR, MAX1168_EOC_EINT);
+  /* clear pending extint0 before enabling interrupts */
+  SetBit(EXTINT, MAX1168_EOC_EINT);
+
+   /* initialize interrupt vector */
+  VICIntSelect &= ~VIC_BIT( VIC_EINT0 );                     // EXTINT0 
selected as IRQ
+  VICIntEnable = VIC_BIT( VIC_EINT0 );                       // EXTINT0 
interrupt enabled
+  _VIC_CNTL(MAX1168_EOC_VIC_SLOT) = VIC_ENABLE | VIC_EINT0;
+  _VIC_ADDR(MAX1168_EOC_VIC_SLOT) = (uint32_t)EXTINT0_ISR;   // address of the 
ISR
+}
+
+
+void max1168_read( void ) {
+  ASSERT((max1168_status == STA_MAX1168_IDLE),         \
+     DEBUG_MAX_1168, MAX1168_ERR_READ_OVERUN);
+  /* select max1168 */
+  Max1168Select();
+  /* enable SPI */
+  SSP_ClearRti();
+  SSP_DisableRti();
+  SSP_Enable();
+  /* write control byte - wait EOC on extint */
+  SSPDR = (1 << 0 | 1 << 3 | 7 << 5) << 8;
+  max1168_status = STA_MAX1168_SENDING_REQ;
+
+}
+
+void EXTINT0_ISR(void) {
+  ISR_ENTRY();
+  ASSERT((max1168_status == STA_MAX1168_SENDING_REQ),  \
+     DEBUG_MAX_1168, MAX1168_ERR_SPURIOUS_EOC);
+  /* read dummy control byte reply */
+  uint16_t foo __attribute__ ((unused));
+  foo = SSPDR;
+  /* trigger 8 frames read */
+  SSP_Send(0);
+  SSP_Send(0);
+  SSP_Send(0);
+  SSP_Send(0);
+  SSP_Send(0);
+  SSP_Send(0);
+  SSP_Send(0);
+  SSP_Send(0);
+  SSP_ClearRti();
+  SSP_EnableRti();
+  max1168_status = STA_MAX1168_READING_RES;
+  //SetBit(EXTINT, MAX1168_EOC_EINT);   /* clear extint0 */
+  EXTINT = (1<<MAX1168_EOC_EINT);
+  VICVectAddr = 0x00000000;             /* clear this interrupt from the VIC */
+
+  ISR_EXIT();
+}

Copied: paparazzi3/trunk/sw/airborne/arch/lpc21/peripherals/max1168_arch.h 
(from rev 6213, 
paparazzi3/trunk/sw/airborne/booz/arch/lpc21/peripherals/booz_max1168_arch.h)
===================================================================
--- paparazzi3/trunk/sw/airborne/arch/lpc21/peripherals/max1168_arch.h          
                (rev 0)
+++ paparazzi3/trunk/sw/airborne/arch/lpc21/peripherals/max1168_arch.h  
2010-10-23 21:12:06 UTC (rev 6214)
@@ -0,0 +1,79 @@
+/*
+ * $Id$
+ *
+ * Copyright (C) 2008-2009 Antoine Drouin <address@hidden>
+ *
+ * This file is part of paparazzi.
+ *
+ * paparazzi is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * paparazzi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with paparazzi; see the file COPYING.  If not, write to
+ * the Free Software Foundation, 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+
+#ifndef MAX1168_ARCH_H
+#define MAX1168_ARCH_H
+
+
+/*
+  MAX1168 SPI ADC connected on SPI1
+  SS on P0.20
+  EOC on P0.16 ( EINT0 )
+*/
+
+#include "std.h"
+#include "LPC21xx.h"
+#include "interrupt_hw.h"
+#include "ssp_hw.h"
+
+#include "pprz_debug.h"
+
+#define MAX1168_ERR_ISR_STATUS   0
+#define MAX1168_ERR_READ_OVERUN  1
+#define MAX1168_ERR_SPURIOUS_EOC 2
+
+#define MAX1168_SS_PIN 20
+#define MAX1168_SS_IODIR IO0DIR
+#define MAX1168_SS_IOSET IO0SET
+#define MAX1168_SS_IOCLR IO0CLR
+
+#define MAX1168_EOC_PIN 16
+#define MAX1168_EOC_PINSEL PINSEL1
+#define MAX1168_EOC_PINSEL_BIT 0
+#define MAX1168_EOC_PINSEL_VAL 1
+#define MAX1168_EOC_EINT 0
+
+#define Max1168Unselect() SetBit(MAX1168_SS_IOSET, MAX1168_SS_PIN)
+#define Max1168Select() SetBit(MAX1168_SS_IOCLR, MAX1168_SS_PIN)
+
+#define Max1168OnSpiInt() {                                            \
+    ASSERT((max1168_status == STA_MAX1168_READING_RES),                \
+       DEBUG_MAX_1168, MAX1168_ERR_ISR_STATUS);                        \
+    /* store convertion result */                                      \
+    max1168_values[0] = SSPDR;                                 \
+    max1168_values[1] = SSPDR;                                 \
+    max1168_values[2] = SSPDR;                                 \
+    max1168_values[3] = SSPDR;                                 \
+    max1168_values[4] = SSPDR;                                 \
+    max1168_values[5] = SSPDR;                                 \
+    max1168_values[6] = SSPDR;                                 \
+    max1168_values[7] = SSPDR;                                 \
+    SSP_ClearRti();                                                    \
+    SSP_DisableRti();                                                  \
+    SSP_Disable();                                                     \
+    Max1168Unselect();                                                 \
+    max1168_status = STA_MAX1168_DATA_AVAILABLE;                       \
+  }
+
+#endif /* MAX1168_ARCH_H */

Copied: paparazzi3/trunk/sw/airborne/arch/lpc21/peripherals/ms2001_arch.c (from 
rev 6213, 
paparazzi3/trunk/sw/airborne/booz/arch/lpc21/peripherals/booz_ms2001_arch.c)
===================================================================
--- paparazzi3/trunk/sw/airborne/arch/lpc21/peripherals/ms2001_arch.c           
                (rev 0)
+++ paparazzi3/trunk/sw/airborne/arch/lpc21/peripherals/ms2001_arch.c   
2010-10-23 21:12:06 UTC (rev 6214)
@@ -0,0 +1,50 @@
+/* PNI ms2001 connected on SPI1 */
+/*
+  IMU b2
+  SS on P1.28
+  RESET on P1.19
+  DRDY on P0.30 ( EINT3)
+*/
+
+#include "peripherals/ms2001.h"
+
+volatile uint8_t ms2001_cur_axe;
+
+static void EXTINT_ISR(void) __attribute__((naked));
+
+void ms2001_arch_init( void ) {
+
+   ms2001_cur_axe = 0;
+
+  /* configure SS pin */
+  Ms2001Unselect();                       /* pin idles high */
+  SetBit(MS2001_SS_IODIR, MS2001_SS_PIN); /* pin is output  */
+
+  /* configure RESET pin */
+  Ms2001Reset();                                /* pin idles low  */
+  SetBit(MS2001_RESET_IODIR, MS2001_RESET_PIN); /* pin is output  */
+
+  /* configure DRDY pin */
+  /* connected pin to EXINT */
+  MS2001_DRDY_PINSEL |= MS2001_DRDY_PINSEL_VAL << MS2001_DRDY_PINSEL_BIT;
+  SetBit(EXTMODE, MS2001_DRDY_EINT); /* EINT is edge trigered */
+  SetBit(EXTPOLAR,MS2001_DRDY_EINT); /* EINT is trigered on rising edge */
+  SetBit(EXTINT,MS2001_DRDY_EINT);   /* clear pending EINT */
+
+  /* initialize interrupt vector */
+  VICIntSelect &= ~VIC_BIT( MS2001_DRDY_VIC_IT );                       /* 
select EINT as IRQ source */
+  VICIntEnable = VIC_BIT( MS2001_DRDY_VIC_IT );                         /* 
enable it                 */
+  _VIC_CNTL(MS2001_DRDY_VIC_SLOT) = VIC_ENABLE | MS2001_DRDY_VIC_IT;
+  _VIC_ADDR(MS2001_DRDY_VIC_SLOT) = (uint32_t)EXTINT_ISR;         // address 
of the ISR
+
+}
+
+void EXTINT_ISR(void) {
+  ISR_ENTRY();
+  /* no, we won't do anything asynchronously, so just notify */
+  ms2001_status = MS2001_GOT_EOC;
+  /* clear EINT */
+  EXTINT = (1<<MS2001_DRDY_EINT);
+  VICVectAddr = 0x00000000;    /* clear this interrupt from the VIC */
+  ISR_EXIT();
+}

Copied: paparazzi3/trunk/sw/airborne/arch/lpc21/peripherals/ms2001_arch.h (from 
rev 6213, 
paparazzi3/trunk/sw/airborne/booz/arch/lpc21/peripherals/booz_ms2001_arch.h)
===================================================================
--- paparazzi3/trunk/sw/airborne/arch/lpc21/peripherals/ms2001_arch.h           
                (rev 0)
+++ paparazzi3/trunk/sw/airborne/arch/lpc21/peripherals/ms2001_arch.h   
2010-10-23 21:12:06 UTC (rev 6214)
@@ -0,0 +1,88 @@
+#ifndef MS2001_ARCH_H
+#define MS2001_ARCH_H
+
+#include <stdlib.h>  // for abs
+
+#include "std.h"
+#include "LPC21xx.h"
+#include "interrupt_hw.h"
+
+#include "ssp_hw.h"
+#include BOARD_CONFIG
+
+#include "airframe.h"
+
+
+
+extern volatile uint8_t ms2001_cur_axe;
+
+#define Ms2001Select()   SetBit(MS2001_SS_IOCLR,MS2001_SS_PIN)
+#define Ms2001Unselect() SetBit(MS2001_SS_IOSET,MS2001_SS_PIN)
+
+#define Ms2001Reset() SetBit(MS2001_RESET_IOCLR,MS2001_RESET_PIN)
+#define Ms2001Set()   SetBit(MS2001_RESET_IOSET,MS2001_RESET_PIN)
+
+#define Ms2001OnSpiIt() {                                              \
+    switch (ms2001_status) {                                           \
+    case MS2001_SENDING_REQ:                                           \
+      {                                                                        
\
+    /* read dummy control byte reply */                                \
+    uint8_t foo __attribute__ ((unused)) = SSPDR;                      \
+    ms2001_status = MS2001_WAITING_EOC;                                \
+    Ms2001Unselect();                                          \
+    SSP_ClearRti();                                                    \
+    SSP_DisableRti();                                          \
+    SSP_Disable();                                                     \
+      }                                                                        
\
+      break;                                                           \
+    case MS2001_READING_RES:                                           \
+      {                                                                        
\
+    int16_t new_val;                                           \
+    new_val = SSPDR << 8;                                              \
+    new_val += SSPDR;                                          \
+    if (abs(new_val) < 2000)                                   \
+      ms2001_values[ms2001_cur_axe] = new_val;                 \
+    Ms2001Unselect();                                          \
+    SSP_ClearRti();                                                    \
+    SSP_DisableRti();                                          \
+    SSP_Disable();                                                     \
+    ms2001_cur_axe++;                                          \
+    if (ms2001_cur_axe > 2) {                                  \
+      ms2001_cur_axe = 0;                                              \
+      ms2001_status = MS2001_DATA_AVAILABLE;                   \
+    }                                                          \
+    else                                                               \
+      ms2001_status = MS2001_IDLE;                                     \
+      }                                                                        
\
+      break;                                                           \
+    }                                                                  \
+  }
+
+
+#define Ms2001SendReq() {                                              \
+    Ms2001Select();                                                    \
+    ms2001_status = MS2001_SENDING_REQ;                                        
\
+    Ms2001Set();                                                       \
+    SSP_ClearRti();                                                    \
+    SSP_EnableRti();                                                   \
+    Ms2001Reset();                                                     \
+    uint8_t control_byte = (ms2001_cur_axe+1) << 0 |                   \
+                            MS2001_DIVISOR << 4;                       \
+    SSP_Send(control_byte);                                            \
+    SSP_Enable();                                                      \
+  }
+
+#define Ms2001ReadRes() {                                              \
+    ms2001_status = MS2001_READING_RES;                                        
\
+    Ms2001Select();                                                    \
+    /* trigger 2 bytes read */                                         \
+    SSP_Send(0);                                                       \
+    SSP_Send(0);                                                       \
+    SSP_Enable();                                                      \
+    SSP_ClearRti();                                                    \
+    SSP_EnableRti();                                                   \
+  }
+
+
+
+#endif /* MS2001_ARCH_H */

Modified: paparazzi3/trunk/sw/airborne/arch/lpc21/sys_time_hw.c
===================================================================
--- paparazzi3/trunk/sw/airborne/arch/lpc21/sys_time_hw.c       2010-10-23 
21:11:54 UTC (rev 6213)
+++ paparazzi3/trunk/sw/airborne/arch/lpc21/sys_time_hw.c       2010-10-23 
21:12:06 UTC (rev 6214)
@@ -47,7 +47,7 @@
 #endif
 
 #ifdef USE_AMI601
-#include "booz/peripherals/booz_ami601.h"
+#include "booz/peripherals/ami601.h"
 #else
 #define AMI601_IT 0x00
 #endif

Copied: paparazzi3/trunk/sw/airborne/arch/sim/peripherals/max1168_arch.c (from 
rev 6213, 
paparazzi3/trunk/sw/airborne/booz/arch/sim/peripherals/booz_max1168_arch.c)
===================================================================
--- paparazzi3/trunk/sw/airborne/arch/sim/peripherals/max1168_arch.c            
                (rev 0)
+++ paparazzi3/trunk/sw/airborne/arch/sim/peripherals/max1168_arch.c    
2010-10-23 21:12:06 UTC (rev 6214)
@@ -0,0 +1,28 @@
+/*
+ * $Id$
+ *
+ * Copyright (C) 2008-2009 Antoine Drouin <address@hidden>
+ *
+ * This file is part of paparazzi.
+ *
+ * paparazzi is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * paparazzi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with paparazzi; see the file COPYING.  If not, write to
+ * the Free Software Foundation, 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "peripherals/max1168.h"
+
+void max1168_arch_init( void ) {}
+
+void max1168_read( void ) {}

Copied: paparazzi3/trunk/sw/airborne/arch/sim/peripherals/max1168_arch.h (from 
rev 6213, 
paparazzi3/trunk/sw/airborne/booz/arch/sim/peripherals/booz_max1168_arch.h)
===================================================================
--- paparazzi3/trunk/sw/airborne/arch/sim/peripherals/max1168_arch.h            
                (rev 0)
+++ paparazzi3/trunk/sw/airborne/arch/sim/peripherals/max1168_arch.h    
2010-10-23 21:12:06 UTC (rev 6214)
@@ -0,0 +1,34 @@
+/*
+ * $Id$
+ *
+ * Copyright (C) 2008-2009 Antoine Drouin <address@hidden>
+ *
+ * This file is part of paparazzi.
+ *
+ * paparazzi is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * paparazzi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with paparazzi; see the file COPYING.  If not, write to
+ * the Free Software Foundation, 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+/*
+ *
+ * simulator plug for max1168 SPI Analog to Digital converter
+ *
+ */
+
+#ifndef MAX1168_HW_H
+#define MAX1168_HW_H
+
+
+#endif /* MAX1168_HW_H */

Copied: paparazzi3/trunk/sw/airborne/arch/stm32/peripherals/max1168_arch.c 
(from rev 6213, 
paparazzi3/trunk/sw/airborne/booz/arch/stm32/peripherals/booz_max1168_arch.c)
===================================================================
--- paparazzi3/trunk/sw/airborne/arch/stm32/peripherals/max1168_arch.c          
                (rev 0)
+++ paparazzi3/trunk/sw/airborne/arch/stm32/peripherals/max1168_arch.c  
2010-10-23 21:12:06 UTC (rev 6214)
@@ -0,0 +1,174 @@
+/*
+ * $Id$
+ *
+ * Copyright (C) 2010 Antoine Drouin <address@hidden>
+ *
+ * This file is part of paparazzi.
+ *
+ * paparazzi is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * paparazzi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with paparazzi; see the file COPYING.  If not, write to
+ * the Free Software Foundation, 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#include "peripherals/max1168.h"
+
+#include <stm32/rcc.h>
+#include <stm32/spi.h>
+#include <stm32/exti.h>
+#include <stm32/misc.h>
+#include <stm32/dma.h>
+
+
+/* I can't use GPIOD as it's already defined in some system header */
+#define __DRDY_PORT(dev, _x) _x##dev
+#define _DRDY_PORT(dev, _x)  __DRDY_PORT(dev, _x)
+#define DRDY_PORT(_x) _DRDY_PORT(MAX_1168_DRDY_PORT, _x)
+
+#define __DRDY_PORT_SOURCE(dev, _x) _x##dev
+#define _DRDY_PORT_SOURCE(dev, _x)  __DRDY_PORT_SOURCE(dev, _x)
+#define DRDY_PORT_SOURCE(_x) _DRDY_PORT_SOURCE(MAX_1168_DRDY_PORT_SOURCE, _x)
+
+void exti2_irq_handler(void);
+
+void max1168_arch_init( void ) {
+
+  /* set slave select as output and assert it ( on PB12) */
+  Max1168Unselect();
+  RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
+  GPIO_InitTypeDef GPIO_InitStructure;
+  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12;
+  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
+  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
+  GPIO_Init(GPIOB, &GPIO_InitStructure);
+
+  /* configure external interrupt exti2 on PD2( data ready ) v1.0*/
+  /*                                       PB2( data ready ) v1.1*/
+  //  RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD | RCC_APB2Periph_AFIO, 
ENABLE);
+  RCC_APB2PeriphClockCmd(DRDY_PORT(RCC_APB2Periph) | RCC_APB2Periph_AFIO, 
ENABLE);
+  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;
+  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
+  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
+  GPIO_Init(GPIOD, &GPIO_InitStructure);
+
+  EXTI_InitTypeDef EXTI_InitStructure;
+  //  GPIO_EXTILineConfig(GPIO_PortSourceGPIOD, GPIO_PinSource2);
+  GPIO_EXTILineConfig(DRDY_PORT_SOURCE(GPIO_), GPIO_PinSource2);
+  EXTI_InitStructure.EXTI_Line = EXTI_Line2;
+  EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
+  EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling;
+  EXTI_InitStructure.EXTI_LineCmd = ENABLE;
+  EXTI_Init(&EXTI_InitStructure);
+
+  NVIC_InitTypeDef NVIC_InitStructure;
+  NVIC_InitStructure.NVIC_IRQChannel = EXTI2_IRQn;
+  NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x0F;
+  NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x0F;
+  NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
+
+  NVIC_Init(&NVIC_InitStructure);
+
+#ifdef MAX1168_HANDLES_DMA_IRQ
+  /* Enable DMA1 channel4 IRQ Channel */
+  NVIC_InitTypeDef NVIC_init_struct = {
+    .NVIC_IRQChannel = DMA1_Channel4_IRQn,
+    .NVIC_IRQChannelPreemptionPriority = 0,
+    .NVIC_IRQChannelSubPriority = 0,
+    .NVIC_IRQChannelCmd = ENABLE
+  };
+  NVIC_Init(&NVIC_init_struct);
+#endif /* MAX1168_HANDLES_DMA_IRQ */
+}
+
+void max1168_read( void ) {
+  /*  ASSERT((max1168_status == STA_MAX1168_IDLE),     \
+   *   DEBUG_MAX_1168, MAX1168_ERR_READ_OVERUN);
+   */
+  /* select max1168 */
+  Max1168Select();
+
+  /* write control byte - wait EOC on extint */
+  const uint16_t ctl_byte = (1 << 0 | 1 << 3 | 7 << 5) << 8;
+  SPI_I2S_SendData(SPI2, ctl_byte);
+  max1168_status = STA_MAX1168_SENDING_REQ;
+
+}
+
+void exti2_irq_handler(void) {
+
+  /*  ASSERT((max1168_status == STA_MAX1168_SENDING_REQ),      \
+   *     DEBUG_MAX_1168, MAX1168_ERR_SPURIOUS_EOC);
+   */
+
+  /* clear EXTI */
+  if(EXTI_GetITStatus(EXTI_Line2) != RESET)
+    EXTI_ClearITPendingBit(EXTI_Line2);
+
+  /* read control byte FIXME: is this needed ?, yes*/
+   uint16_t foo __attribute__ ((unused)) = SPI_I2S_ReceiveData(SPI2);
+
+  /* trigger 8 frames read */
+  /* SPI2_Rx_DMA_Channel configuration ------------------------------------*/
+  DMA_DeInit(DMA1_Channel4);
+  DMA_InitTypeDef DMA_initStructure_4 = {
+    .DMA_PeripheralBaseAddr = (uint32_t)(SPI2_BASE+0x0C),
+    .DMA_MemoryBaseAddr = (uint32_t)max1168_values,
+    .DMA_DIR = DMA_DIR_PeripheralSRC,
+    .DMA_BufferSize = MAX1168_NB_CHAN,
+    .DMA_PeripheralInc = DMA_PeripheralInc_Disable,
+    .DMA_MemoryInc = DMA_MemoryInc_Enable,
+    .DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord,
+    .DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord,
+    .DMA_Mode = DMA_Mode_Normal,
+    .DMA_Priority = DMA_Priority_VeryHigh,
+    .DMA_M2M = DMA_M2M_Disable
+  };
+  DMA_Init(DMA1_Channel4, &DMA_initStructure_4);
+
+  /* SPI2_Tx_DMA_Channel configuration ------------------------------------*/
+  DMA_DeInit(DMA1_Channel5);
+  DMA_InitTypeDef DMA_initStructure_5 = {
+    .DMA_PeripheralBaseAddr = (uint32_t)(SPI2_BASE+0x0C),
+    .DMA_MemoryBaseAddr = (uint32_t)max1168_values,
+    .DMA_DIR = DMA_DIR_PeripheralDST,
+    .DMA_BufferSize = MAX1168_NB_CHAN,
+    .DMA_PeripheralInc = DMA_PeripheralInc_Disable,
+    .DMA_MemoryInc = DMA_MemoryInc_Enable,
+    .DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord,
+    .DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord,
+    .DMA_Mode = DMA_Mode_Normal,
+    .DMA_Priority = DMA_Priority_Medium,
+    .DMA_M2M = DMA_M2M_Disable
+  };
+  DMA_Init(DMA1_Channel5, &DMA_initStructure_5);
+
+  /* Enable SPI_2 Rx request */
+  SPI_I2S_DMACmd(SPI2, SPI_I2S_DMAReq_Rx, ENABLE);
+  /* Enable DMA1 Channel4 */
+  DMA_Cmd(DMA1_Channel4, ENABLE);
+
+  /* Enable SPI_2 Tx request */
+  SPI_I2S_DMACmd(SPI2, SPI_I2S_DMAReq_Tx, ENABLE);
+  /* Enable DMA1 Channel5 */
+  DMA_Cmd(DMA1_Channel5, ENABLE);
+
+  /* Enable DMA1 Channel4 Transfer Complete interrupt */
+  DMA_ITConfig(DMA1_Channel4, DMA_IT_TC, ENABLE);
+
+  max1168_status = STA_MAX1168_READING_RES;
+}
+
+#ifdef MAX1168_HANDLES_DMA_IRQ
+void dma1_c4_irq_handler(void) {
+  Max1168OnDmaIrq();
+}
+#endif /*MAX1168_HANDLES_DMA_IRQ */

Copied: paparazzi3/trunk/sw/airborne/arch/stm32/peripherals/max1168_arch.h 
(from rev 6213, 
paparazzi3/trunk/sw/airborne/booz/arch/stm32/peripherals/booz_max1168_arch.h)
===================================================================
--- paparazzi3/trunk/sw/airborne/arch/stm32/peripherals/max1168_arch.h          
                (rev 0)
+++ paparazzi3/trunk/sw/airborne/arch/stm32/peripherals/max1168_arch.h  
2010-10-23 21:12:06 UTC (rev 6214)
@@ -0,0 +1,69 @@
+/*
+ * $Id$
+ *
+ * Copyright (C) 2010 Antoine Drouin <address@hidden>
+ *
+ * This file is part of paparazzi.
+ *
+ * paparazzi is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * paparazzi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with paparazzi; see the file COPYING.  If not, write to
+ * the Free Software Foundation, 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef MAX1168_ARCH_H
+#define MAX1168_ARCH_H
+
+/*
+ * max1168 analog to digital converter
+ * connected on spi2
+ * select on PB12
+ * drdy on PD2
+ */
+#include <stm32/gpio.h>
+
+#define Max1168Unselect() GPIOB->BSRR = GPIO_Pin_12
+#define Max1168Select() GPIOB->BRR = GPIO_Pin_12
+
+#define Max1168OnDmaIrq() {                                            \
+    /*  ASSERT((max1168_status == STA_MAX1168_READING_RES),    \
+     *          DEBUG_MAX_1168, MAX1168_ERR_SPURIOUS_DMA_IRQ);         \
+     */                                                                        
\
+    Max1168Unselect();                                                 \
+    DMA_ITConfig(DMA1_Channel4, DMA_IT_TC, DISABLE);                   \
+    /* Disable SPI_2 Rx and TX request */                              \
+    SPI_I2S_DMACmd(SPI2, SPI_I2S_DMAReq_Rx, DISABLE);                  \
+    SPI_I2S_DMACmd(SPI2, SPI_I2S_DMAReq_Tx, DISABLE);                  \
+    /* Disable DMA1 Channel4 and 5 */                                  \
+    DMA_Cmd(DMA1_Channel4, DISABLE);                                   \
+    DMA_Cmd(DMA1_Channel5, DISABLE);                                   \
+                                    \
+    max1168_status = STA_MAX1168_DATA_AVAILABLE;                       \
+  }
+
+
+#define Max1168ConfigureSPI() {                                                
\
+    SPI_InitTypeDef SPI_InitStructure;                                 \
+    SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex; \
+    SPI_InitStructure.SPI_Mode = SPI_Mode_Master;                      \
+    SPI_InitStructure.SPI_DataSize = SPI_DataSize_16b;                 \
+    SPI_InitStructure.SPI_CPOL = SPI_CPOL_Low;                         \
+    SPI_InitStructure.SPI_CPHA = SPI_CPHA_1Edge;                       \
+    SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;                          \
+    SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_16;        
\
+    SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;                 \
+    SPI_InitStructure.SPI_CRCPolynomial = 7;                           \
+    SPI_Init(SPI2, &SPI_InitStructure);                                        
\
+  }
+
+#endif /* MAX1168_ARCH_H */

Copied: paparazzi3/trunk/sw/airborne/arch/stm32/peripherals/ms2001_arch.c (from 
rev 6213, 
paparazzi3/trunk/sw/airborne/booz/arch/stm32/peripherals/booz_ms2001_arch.c)
===================================================================
--- paparazzi3/trunk/sw/airborne/arch/stm32/peripherals/ms2001_arch.c           
                (rev 0)
+++ paparazzi3/trunk/sw/airborne/arch/stm32/peripherals/ms2001_arch.c   
2010-10-23 21:12:06 UTC (rev 6214)
@@ -0,0 +1,95 @@
+/*
+ * $Id$
+ *
+ * Copyright (C) 2010 Antoine Drouin <address@hidden>
+ *
+ * This file is part of paparazzi.
+ *
+ * paparazzi is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * paparazzi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with paparazzi; see the file COPYING.  If not, write to
+ * the Free Software Foundation, 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "peripherals/ms2001.h"
+
+#include <stm32/rcc.h>
+#include <stm32/spi.h>
+#include <stm32/exti.h>
+#include <stm32/misc.h>
+#include <stm32/dma.h>
+
+uint8_t ms2001_cur_axe;
+int16_t ms2001_last_reading; // can't write in place because that stupid beast
+                             // stips stupid values once in a while that I need
+                             // to filter - high time we get rid of this crap 
hardware
+                             // and no, I checked with the logic analyzer, 
timing are
+                             // within specs
+
+void ms2001_arch_init( void ) {
+
+  ms2001_cur_axe = 0;
+
+  /* set mag SS and reset as output and assert them (SS on PC12  reset on 
PC13) ----*/
+  Ms2001Unselect();
+  Ms2001Set();
+
+  RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE);
+  GPIO_InitTypeDef GPIO_InitStructure;
+  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12 | GPIO_Pin_13;
+  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
+  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
+  GPIO_Init(GPIOC, &GPIO_InitStructure);
+
+  /* configure data ready on PB5 */
+  RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB | RCC_APB2Periph_AFIO, ENABLE);
+  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5;
+  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
+  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
+  GPIO_Init(GPIOB, &GPIO_InitStructure);
+
+#ifdef MS2001_HANDLES_DMA_IRQ
+ /* Enable DMA1 channel4 IRQ Channel */
+  NVIC_InitTypeDef NVIC_init_structure_dma = {
+    .NVIC_IRQChannel = DMA1_Channel4_IRQn,
+    .NVIC_IRQChannelPreemptionPriority = 0,
+    .NVIC_IRQChannelSubPriority = 0,
+    .NVIC_IRQChannelCmd = ENABLE
+  };
+  NVIC_Init(&NVIC_init_structure_dma);
+#endif /* MS2001_HANDLES_DMA_IRQ */
+
+#ifdef MS2001_HANDLES_SPI_IRQ
+  NVIC_InitTypeDef NVIC_init_structure_spi = {
+    .NVIC_IRQChannel = SPI2_IRQn,
+    .NVIC_IRQChannelPreemptionPriority = 0,
+    .NVIC_IRQChannelSubPriority = 1,
+    .NVIC_IRQChannelCmd = ENABLE
+  };
+  NVIC_Init(&NVIC_init_structure_spi);
+#endif /* MS2001_HANDLES_SPI_IRQ */
+
+}
+
+#ifdef MS2001_HANDLES_SPI_IRQ
+void spi2_irq_handler(void) {
+  Ms2001OnSpiIrq();
+}
+#endif
+
+
+#ifdef MS2001_HANDLES_DMA_IRQ
+void dma1_c4_irq_handler(void) {
+  Ms2001OnDmaIrq();
+}
+#endif /* MS2001_HANDLES_DMA_IRQ */

Copied: paparazzi3/trunk/sw/airborne/arch/stm32/peripherals/ms2001_arch.h (from 
rev 6213, 
paparazzi3/trunk/sw/airborne/booz/arch/stm32/peripherals/booz_ms2001_arch.h)
===================================================================
--- paparazzi3/trunk/sw/airborne/arch/stm32/peripherals/ms2001_arch.h           
                (rev 0)
+++ paparazzi3/trunk/sw/airborne/arch/stm32/peripherals/ms2001_arch.h   
2010-10-23 21:12:06 UTC (rev 6214)
@@ -0,0 +1,155 @@
+#ifndef MS2001_ARCH_H
+#define MS2001_ARCH_H
+
+/*
+ * $Id$
+ *
+ * Copyright (C) 2010 Antoine Drouin <address@hidden>
+ *
+ * This file is part of paparazzi.
+ *
+ * paparazzi is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * paparazzi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with paparazzi; see the file COPYING.  If not, write to
+ * the Free Software Foundation, 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <stm32/gpio.h>
+#include <stm32/spi.h>
+
+extern uint8_t ms2001_cur_axe;
+extern int16_t ms2001_last_reading;
+
+#define Ms2001Select()   GPIOC->BRR = GPIO_Pin_12
+#define Ms2001Unselect() GPIOC->BSRR = GPIO_Pin_12
+
+#define Ms2001Reset() GPIOC->BSRR = GPIO_Pin_13;
+#define Ms2001Set()   GPIOC->BRR = GPIO_Pin_13
+
+#define Ms2001HasEOC() GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_5)
+
+#define Ms2001SendReq() {                                              \
+    Ms2001Select();                                                    \
+    __IO uint32_t nCount = 4;for(; nCount != 0; nCount--);             \
+    Ms2001Reset();                                                     \
+    ms2001_status = MS2001_SENDING_REQ;                                        
\
+    nCount = 4;for(; nCount != 0; nCount--);                           \
+    Ms2001Set();                                                       \
+    uint16_t ctl_byte = ((ms2001_cur_axe+1) | (MS2001_DIVISOR << 4));  \
+    nCount = 20;for(; nCount != 0; nCount--);                          \
+    SPI_Cmd(SPI2, DISABLE);                                            \
+    SPI_InitTypeDef SPI_InitStructure = {                              \
+      .SPI_Direction = SPI_Direction_2Lines_FullDuplex,                        
\
+      .SPI_Mode = SPI_Mode_Master,                                     \
+      .SPI_DataSize = SPI_DataSize_8b,                                 \
+      .SPI_CPOL = SPI_CPOL_Low,                                                
\
+      .SPI_CPHA = SPI_CPHA_1Edge,                                      \
+      .SPI_NSS = SPI_NSS_Soft,                                         \
+      .SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_64,               \
+      .SPI_FirstBit = SPI_FirstBit_MSB,                                        
\
+      .SPI_CRCPolynomial = 7                                           \
+    };                                                                 \
+    SPI_Init(SPI2, &SPI_InitStructure);                                        
\
+    SPI_I2S_ITConfig(SPI2, SPI_I2S_IT_RXNE, ENABLE);                   \
+    SPI_Cmd(SPI2, ENABLE);                                             \
+    SPI_I2S_SendData(SPI2, ctl_byte);                                  \
+  }
+
+#define Ms2001ReadRes() {                                              \
+    ms2001_status = MS2001_READING_RES;                                        
\
+    Ms2001Select();                                                    \
+    SPI_Cmd(SPI2, DISABLE);                                            \
+    SPI_InitTypeDef SPI_InitStructure = {                              \
+      .SPI_Direction = SPI_Direction_2Lines_FullDuplex,                        
\
+      .SPI_Mode = SPI_Mode_Master,                                     \
+      .SPI_DataSize = SPI_DataSize_16b,                                        
\
+      .SPI_CPOL = SPI_CPOL_Low,                                                
\
+      .SPI_CPHA = SPI_CPHA_1Edge,                                      \
+      .SPI_NSS = SPI_NSS_Soft,                                         \
+      .SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_64,               \
+      .SPI_FirstBit = SPI_FirstBit_MSB,                                        
\
+      .SPI_CRCPolynomial = 7                                           \
+    };                                                                 \
+    SPI_Init(SPI2, &SPI_InitStructure);                                        
\
+    SPI_Cmd(SPI2, ENABLE);                                             \
+                                                                       \
+    /* trigger 2 frames read */                                                
\
+    /* SPI2_Rx_DMA_Channel configuration 
------------------------------------*/ \
+    DMA_InitTypeDef  DMA_InitStructure;                                        
\
+    DMA_DeInit(DMA1_Channel4);                                         \
+    DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)(SPI2_BASE+0x0C); \
+    DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)(&ms2001_last_reading); \
+    DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralSRC;                 \
+    DMA_InitStructure.DMA_BufferSize = 1;                              \
+    DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;   \
+    DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;            \
+    DMA_InitStructure.DMA_PeripheralDataSize = 
DMA_PeripheralDataSize_HalfWord; \
+    DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord;        
\
+    DMA_InitStructure.DMA_Mode = DMA_Mode_Normal;                      \
+    DMA_InitStructure.DMA_Priority = DMA_Priority_VeryHigh;            \
+    DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;                       \
+    DMA_Init(DMA1_Channel4, &DMA_InitStructure);                       \
+    /* SPI2_Tx_DMA_Channel configuration 
------------------------------------*/ \
+    DMA_DeInit(DMA1_Channel5);                                         \
+    DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)(SPI2_BASE+0x0C); \
+    DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)&ms2001_values;   \
+    DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralDST;                 \
+    DMA_InitStructure.DMA_Priority = DMA_Priority_Medium;              \
+    DMA_Init(DMA1_Channel5, &DMA_InitStructure);                       \
+                                                                       \
+    /* Enable SPI_2 Rx request */                                      \
+    SPI_I2S_DMACmd(SPI2, SPI_I2S_DMAReq_Rx, ENABLE);                   \
+    /* Enable DMA1 Channel4 */                                         \
+    DMA_Cmd(DMA1_Channel4, ENABLE);                                    \
+                                                                       \
+    /* Enable SPI_2 Tx request */                                      \
+    SPI_I2S_DMACmd(SPI2, SPI_I2S_DMAReq_Tx, ENABLE);                   \
+    /* Enable DMA1 Channel5 */                                         \
+    DMA_Cmd(DMA1_Channel5, ENABLE);                                    \
+                                                                       \
+    /* Enable DMA1 Channel4 Transfer Complete interrupt */             \
+    DMA_ITConfig(DMA1_Channel4, DMA_IT_TC, ENABLE);                    \
+                                                                       \
+  }
+
+#define Ms2001OnDmaIrq() {                                     \
+    /*  ASSERT((ms2001_status == MS2001_READING_RES),          \
+     *   DEBUG_MS2001, MS2001_ERR_SPURIOUS_DMA_IRQ);           \
+     */                                                                \
+    if (abs(ms2001_last_reading) < 1000)                       \
+      ms2001_values[ms2001_cur_axe] = ms2001_last_reading;     \
+    Ms2001Unselect();                                          \
+    ms2001_cur_axe++;                                          \
+    if (ms2001_cur_axe > 2) {                                  \
+      ms2001_cur_axe = 0;                                      \
+      ms2001_status = MS2001_DATA_AVAILABLE;                   \
+    }                                                          \
+    else                                                       \
+      ms2001_status = MS2001_IDLE;                             \
+    SPI_Cmd(SPI2, DISABLE);                                    \
+    DMA_ITConfig(DMA1_Channel4, DMA_IT_TC, DISABLE);           \
+  }
+
+#define Ms2001OnSpiIrq() {                                             \
+    /*  ASSERT((ms2001_status == MS2001_SENDING_REQ),                  \
+     *   DEBUG_MS2001, MS2001_ERR_SPURIOUS_SPI_IRQ);                   \
+     */                                                                        
\
+    /* read unused control byte reply */                               \
+    uint8_t foo __attribute__ ((unused)) = SPI_I2S_ReceiveData(SPI2);  \
+    Ms2001Unselect();                                                  \
+    ms2001_status = MS2001_WAITING_EOC;                                        
\
+    SPI_Cmd(SPI2, DISABLE);                                            \
+    SPI_I2S_ITConfig(SPI2, SPI_I2S_IT_RXNE, DISABLE);                  \
+  }
+
+#endif /* MS2001_ARCH_H */

Deleted: 
paparazzi3/trunk/sw/airborne/booz/arch/stm32/peripherals/booz_max1168_arch.c
===================================================================
--- 
paparazzi3/trunk/sw/airborne/booz/arch/stm32/peripherals/booz_max1168_arch.c    
    2010-10-23 21:11:54 UTC (rev 6213)
+++ 
paparazzi3/trunk/sw/airborne/booz/arch/stm32/peripherals/booz_max1168_arch.c    
    2010-10-23 21:12:06 UTC (rev 6214)
@@ -1,174 +0,0 @@
-/*
- * $Id$
- *  
- * Copyright (C) 2010 Antoine Drouin <address@hidden>
- *
- * This file is part of paparazzi.
- *
- * paparazzi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * paparazzi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with paparazzi; see the file COPYING.  If not, write to
- * the Free Software Foundation, 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA. 
- */
-#include "peripherals/booz_max1168.h"
-
-#include <stm32/rcc.h>
-#include <stm32/spi.h>
-#include <stm32/exti.h>
-#include <stm32/misc.h>
-#include <stm32/dma.h>
-
-
-/* I can't use GPIOD as it's already defined in some system header */
-#define __DRDY_PORT(dev, _x) _x##dev
-#define _DRDY_PORT(dev, _x)  __DRDY_PORT(dev, _x)
-#define DRDY_PORT(_x) _DRDY_PORT(MAX_1168_DRDY_PORT, _x)
-
-#define __DRDY_PORT_SOURCE(dev, _x) _x##dev
-#define _DRDY_PORT_SOURCE(dev, _x)  __DRDY_PORT_SOURCE(dev, _x)
-#define DRDY_PORT_SOURCE(_x) _DRDY_PORT_SOURCE(MAX_1168_DRDY_PORT_SOURCE, _x)
-
-void exti2_irq_handler(void);
-
-void booz_max1168_arch_init( void ) {
-
-  /* set slave select as output and assert it ( on PB12) */
-  Max1168Unselect();
-  RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
-  GPIO_InitTypeDef GPIO_InitStructure;
-  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12;
-  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
-  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
-  GPIO_Init(GPIOB, &GPIO_InitStructure);
-
-  /* configure external interrupt exti2 on PD2( data ready ) v1.0*/
-  /*                                       PB2( data ready ) v1.1*/
-  //  RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD | RCC_APB2Periph_AFIO, 
ENABLE);
-  RCC_APB2PeriphClockCmd(DRDY_PORT(RCC_APB2Periph) | RCC_APB2Periph_AFIO, 
ENABLE);
-  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;
-  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
-  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
-  GPIO_Init(GPIOD, &GPIO_InitStructure);
-
-  EXTI_InitTypeDef EXTI_InitStructure;
-  //  GPIO_EXTILineConfig(GPIO_PortSourceGPIOD, GPIO_PinSource2);
-  GPIO_EXTILineConfig(DRDY_PORT_SOURCE(GPIO_), GPIO_PinSource2);
-  EXTI_InitStructure.EXTI_Line = EXTI_Line2;
-  EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
-  EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling;
-  EXTI_InitStructure.EXTI_LineCmd = ENABLE;
-  EXTI_Init(&EXTI_InitStructure);
-
-  NVIC_InitTypeDef NVIC_InitStructure;
-  NVIC_InitStructure.NVIC_IRQChannel = EXTI2_IRQn;
-  NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x0F;
-  NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x0F;
-  NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
-  
-  NVIC_Init(&NVIC_InitStructure); 
-
-#ifdef MAX1168_HANDLES_DMA_IRQ
-  /* Enable DMA1 channel4 IRQ Channel */
-  NVIC_InitTypeDef NVIC_init_struct = {
-    .NVIC_IRQChannel = DMA1_Channel4_IRQn,
-    .NVIC_IRQChannelPreemptionPriority = 0,
-    .NVIC_IRQChannelSubPriority = 0,
-    .NVIC_IRQChannelCmd = ENABLE 
-  };
-  NVIC_Init(&NVIC_init_struct);
-#endif /* MAX1168_HANDLES_DMA_IRQ */
-}
-
-void booz_max1168_read( void ) {
-  /*  ASSERT((booz_max1168_status == STA_MAX1168_IDLE),        \
-   *   DEBUG_MAX_1168, MAX1168_ERR_READ_OVERUN);
-   */
-  /* select max1168 */ 
-  Max1168Select();
-
-  /* write control byte - wait EOC on extint */
-  const uint16_t ctl_byte = (1 << 0 | 1 << 3 | 7 << 5) << 8;
-  SPI_I2S_SendData(SPI2, ctl_byte);
-  booz_max1168_status = STA_MAX1168_SENDING_REQ;
-  
-}
-
-void exti2_irq_handler(void) {
-  
-  /*  ASSERT((booz_max1168_status == STA_MAX1168_SENDING_REQ), \
-   *    DEBUG_MAX_1168, MAX1168_ERR_SPURIOUS_EOC);
-   */
-
-  /* clear EXTI */
-  if(EXTI_GetITStatus(EXTI_Line2) != RESET)
-    EXTI_ClearITPendingBit(EXTI_Line2);
-
-  /* read control byte FIXME: is this needed ?, yes*/
-   uint16_t foo __attribute__ ((unused)) = SPI_I2S_ReceiveData(SPI2);
-
-  /* trigger 8 frames read */
-  /* SPI2_Rx_DMA_Channel configuration ------------------------------------*/
-  DMA_DeInit(DMA1_Channel4);                                           
-  DMA_InitTypeDef DMA_initStructure_4 = {
-    .DMA_PeripheralBaseAddr = (uint32_t)(SPI2_BASE+0x0C),
-    .DMA_MemoryBaseAddr = (uint32_t)booz_max1168_values,
-    .DMA_DIR = DMA_DIR_PeripheralSRC,                  
-    .DMA_BufferSize = MAX1168_NB_CHAN,
-    .DMA_PeripheralInc = DMA_PeripheralInc_Disable,    
-    .DMA_MemoryInc = DMA_MemoryInc_Enable,
-    .DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord,
-    .DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord, 
-    .DMA_Mode = DMA_Mode_Normal,
-    .DMA_Priority = DMA_Priority_VeryHigh,             
-    .DMA_M2M = DMA_M2M_Disable
-  };
-  DMA_Init(DMA1_Channel4, &DMA_initStructure_4);
-
-  /* SPI2_Tx_DMA_Channel configuration ------------------------------------*/
-  DMA_DeInit(DMA1_Channel5);  
-  DMA_InitTypeDef DMA_initStructure_5 = {
-    .DMA_PeripheralBaseAddr = (uint32_t)(SPI2_BASE+0x0C),
-    .DMA_MemoryBaseAddr = (uint32_t)booz_max1168_values,
-    .DMA_DIR = DMA_DIR_PeripheralDST,
-    .DMA_BufferSize = MAX1168_NB_CHAN,
-    .DMA_PeripheralInc = DMA_PeripheralInc_Disable,
-    .DMA_MemoryInc = DMA_MemoryInc_Enable,
-    .DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord,
-    .DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord, 
-    .DMA_Mode = DMA_Mode_Normal,
-    .DMA_Priority = DMA_Priority_Medium,
-    .DMA_M2M = DMA_M2M_Disable
-  };
-  DMA_Init(DMA1_Channel5, &DMA_initStructure_5);
-  
-  /* Enable SPI_2 Rx request */
-  SPI_I2S_DMACmd(SPI2, SPI_I2S_DMAReq_Rx, ENABLE);
-  /* Enable DMA1 Channel4 */
-  DMA_Cmd(DMA1_Channel4, ENABLE);
-   
-  /* Enable SPI_2 Tx request */
-  SPI_I2S_DMACmd(SPI2, SPI_I2S_DMAReq_Tx, ENABLE);
-  /* Enable DMA1 Channel5 */
-  DMA_Cmd(DMA1_Channel5, ENABLE);
-
-  /* Enable DMA1 Channel4 Transfer Complete interrupt */
-  DMA_ITConfig(DMA1_Channel4, DMA_IT_TC, ENABLE);
-
-  booz_max1168_status = STA_MAX1168_READING_RES;
-}
-
-#ifdef MAX1168_HANDLES_DMA_IRQ
-void dma1_c4_irq_handler(void) {
-  Max1168OnDmaIrq();
-}
-#endif /*MAX1168_HANDLES_DMA_IRQ */ 

Deleted: 
paparazzi3/trunk/sw/airborne/booz/arch/stm32/peripherals/booz_max1168_arch.h
===================================================================
--- 
paparazzi3/trunk/sw/airborne/booz/arch/stm32/peripherals/booz_max1168_arch.h    
    2010-10-23 21:11:54 UTC (rev 6213)
+++ 
paparazzi3/trunk/sw/airborne/booz/arch/stm32/peripherals/booz_max1168_arch.h    
    2010-10-23 21:12:06 UTC (rev 6214)
@@ -1,69 +0,0 @@
-/*
- * $Id$
- *  
- * Copyright (C) 2010 Antoine Drouin <address@hidden>
- *
- * This file is part of paparazzi.
- *
- * paparazzi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * paparazzi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with paparazzi; see the file COPYING.  If not, write to
- * the Free Software Foundation, 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA. 
- */
-
-#ifndef BOOZ_MAX1168_ARCH_H
-#define BOOZ_MAX1168_ARCH_H
-
-/* 
- * max1168 analog to digital converter
- * connected on spi2
- * select on PB12
- * drdy on PD2
- */
-#include <stm32/gpio.h>
-
-#define Max1168Unselect() GPIOB->BSRR = GPIO_Pin_12
-#define Max1168Select() GPIOB->BRR = GPIO_Pin_12
-
-#define Max1168OnDmaIrq() {                                            \
-    /*  ASSERT((booz_max1168_status == STA_MAX1168_READING_RES),       \
-     *          DEBUG_MAX_1168, MAX1168_ERR_SPURIOUS_DMA_IRQ);         \
-     */                                                                        
\
-    Max1168Unselect();                                                 \
-    DMA_ITConfig(DMA1_Channel4, DMA_IT_TC, DISABLE);                   \
-    /* Disable SPI_2 Rx and TX request */                              \
-    SPI_I2S_DMACmd(SPI2, SPI_I2S_DMAReq_Rx, DISABLE);                  \
-    SPI_I2S_DMACmd(SPI2, SPI_I2S_DMAReq_Tx, DISABLE);                  \
-    /* Disable DMA1 Channel4 and 5 */                                  \
-    DMA_Cmd(DMA1_Channel4, DISABLE);                                   \
-    DMA_Cmd(DMA1_Channel5, DISABLE);                                   \
-                                                                       \
-    booz_max1168_status = STA_MAX1168_DATA_AVAILABLE;                  \
-  }
-
-
-#define Max1168ConfigureSPI() {                                                
\
-    SPI_InitTypeDef SPI_InitStructure;                                 \
-    SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex; \
-    SPI_InitStructure.SPI_Mode = SPI_Mode_Master;                      \
-    SPI_InitStructure.SPI_DataSize = SPI_DataSize_16b;                 \
-    SPI_InitStructure.SPI_CPOL = SPI_CPOL_Low;                         \
-    SPI_InitStructure.SPI_CPHA = SPI_CPHA_1Edge;                       \
-    SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;                          \
-    SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_16;        
\
-    SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;                 \
-    SPI_InitStructure.SPI_CRCPolynomial = 7;                           \
-    SPI_Init(SPI2, &SPI_InitStructure);                                        
\
-  }
-
-#endif /* BOOZ_MAX1168_ARCH_H */

Deleted: 
paparazzi3/trunk/sw/airborne/booz/arch/stm32/peripherals/booz_ms2001_arch.c
===================================================================
--- paparazzi3/trunk/sw/airborne/booz/arch/stm32/peripherals/booz_ms2001_arch.c 
2010-10-23 21:11:54 UTC (rev 6213)
+++ paparazzi3/trunk/sw/airborne/booz/arch/stm32/peripherals/booz_ms2001_arch.c 
2010-10-23 21:12:06 UTC (rev 6214)
@@ -1,95 +0,0 @@
-/*
- * $Id$
- *  
- * Copyright (C) 2010 Antoine Drouin <address@hidden>
- *
- * This file is part of paparazzi.
- *
- * paparazzi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * paparazzi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with paparazzi; see the file COPYING.  If not, write to
- * the Free Software Foundation, 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA. 
- */
-
-#include "peripherals/booz_ms2001.h"
-
-#include <stm32/rcc.h>
-#include <stm32/spi.h>
-#include <stm32/exti.h>
-#include <stm32/misc.h>
-#include <stm32/dma.h>
-
-uint8_t ms2001_cur_axe;
-int16_t ms2001_last_reading; // can't write in place because that stupid beast
-                             // stips stupid values once in a while that I need
-                             // to filter - high time we get rid of this crap 
hardware
-                             // and no, I checked with the logic analyzer, 
timing are
-                             // within specs
-
-void ms2001_arch_init( void ) {
-
-  ms2001_cur_axe = 0;
-
-  /* set mag SS and reset as output and assert them (SS on PC12  reset on 
PC13) ----*/
-  Ms2001Unselect();
-  Ms2001Set();
-
-  RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE);
-  GPIO_InitTypeDef GPIO_InitStructure;
-  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12 | GPIO_Pin_13;
-  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
-  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
-  GPIO_Init(GPIOC, &GPIO_InitStructure);
-
-  /* configure data ready on PB5 */
-  RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB | RCC_APB2Periph_AFIO, ENABLE);
-  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5;
-  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
-  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
-  GPIO_Init(GPIOB, &GPIO_InitStructure);
-
-#ifdef MS2001_HANDLES_DMA_IRQ
- /* Enable DMA1 channel4 IRQ Channel */
-  NVIC_InitTypeDef NVIC_init_structure_dma = {
-    .NVIC_IRQChannel = DMA1_Channel4_IRQn,
-    .NVIC_IRQChannelPreemptionPriority = 0,
-    .NVIC_IRQChannelSubPriority = 0,
-    .NVIC_IRQChannelCmd = ENABLE
-  };
-  NVIC_Init(&NVIC_init_structure_dma);
-#endif /* MS2001_HANDLES_DMA_IRQ */
-
-#ifdef MS2001_HANDLES_SPI_IRQ
-  NVIC_InitTypeDef NVIC_init_structure_spi = {
-    .NVIC_IRQChannel = SPI2_IRQn,
-    .NVIC_IRQChannelPreemptionPriority = 0,
-    .NVIC_IRQChannelSubPriority = 1,
-    .NVIC_IRQChannelCmd = ENABLE
-  };
-  NVIC_Init(&NVIC_init_structure_spi);
-#endif /* MS2001_HANDLES_SPI_IRQ */
-
-}
-
-#ifdef MS2001_HANDLES_SPI_IRQ
-void spi2_irq_handler(void) {
-  Ms2001OnSpiIrq();
-}
-#endif
-
-
-#ifdef MS2001_HANDLES_DMA_IRQ
-void dma1_c4_irq_handler(void) {
-  Ms2001OnDmaIrq();
-}
-#endif /* MS2001_HANDLES_DMA_IRQ */

Deleted: 
paparazzi3/trunk/sw/airborne/booz/arch/stm32/peripherals/booz_ms2001_arch.h
===================================================================
--- paparazzi3/trunk/sw/airborne/booz/arch/stm32/peripherals/booz_ms2001_arch.h 
2010-10-23 21:11:54 UTC (rev 6213)
+++ paparazzi3/trunk/sw/airborne/booz/arch/stm32/peripherals/booz_ms2001_arch.h 
2010-10-23 21:12:06 UTC (rev 6214)
@@ -1,155 +0,0 @@
-#ifndef BOOZ_MS2001_ARCH_H
-#define BOOZ_MS2001_ARCH_H
-
-/*
- * $Id$
- *  
- * Copyright (C) 2010 Antoine Drouin <address@hidden>
- *
- * This file is part of paparazzi.
- *
- * paparazzi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * paparazzi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with paparazzi; see the file COPYING.  If not, write to
- * the Free Software Foundation, 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA. 
- */
-
-#include <stm32/gpio.h>
-#include <stm32/spi.h>
-
-extern uint8_t ms2001_cur_axe;
-extern int16_t ms2001_last_reading;
-
-#define Ms2001Select()   GPIOC->BRR = GPIO_Pin_12
-#define Ms2001Unselect() GPIOC->BSRR = GPIO_Pin_12
-
-#define Ms2001Reset() GPIOC->BSRR = GPIO_Pin_13;
-#define Ms2001Set()   GPIOC->BRR = GPIO_Pin_13
-
-#define Ms2001HasEOC() GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_5) 
-
-#define Ms2001SendReq() {                                              \
-    Ms2001Select();                                                    \
-    __IO uint32_t nCount = 4;for(; nCount != 0; nCount--);             \
-    Ms2001Reset();                                                     \
-    ms2001_status = MS2001_SENDING_REQ;                                        
\
-    nCount = 4;for(; nCount != 0; nCount--);                           \
-    Ms2001Set();                                                       \
-    uint16_t ctl_byte = ((ms2001_cur_axe+1) | (MS2001_DIVISOR << 4));  \
-    nCount = 20;for(; nCount != 0; nCount--);                          \
-    SPI_Cmd(SPI2, DISABLE);                                            \
-    SPI_InitTypeDef SPI_InitStructure = {                              \
-      .SPI_Direction = SPI_Direction_2Lines_FullDuplex,                        
\
-      .SPI_Mode = SPI_Mode_Master,                                     \
-      .SPI_DataSize = SPI_DataSize_8b,                                 \
-      .SPI_CPOL = SPI_CPOL_Low,                                                
\
-      .SPI_CPHA = SPI_CPHA_1Edge,                                      \
-      .SPI_NSS = SPI_NSS_Soft,                                         \
-      .SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_64,               \
-      .SPI_FirstBit = SPI_FirstBit_MSB,                                        
\
-      .SPI_CRCPolynomial = 7                                           \
-    };                                                                 \
-    SPI_Init(SPI2, &SPI_InitStructure);                                        
\
-    SPI_I2S_ITConfig(SPI2, SPI_I2S_IT_RXNE, ENABLE);                   \
-    SPI_Cmd(SPI2, ENABLE);                                             \
-    SPI_I2S_SendData(SPI2, ctl_byte);                                  \
-  }
-
-#define Ms2001ReadRes() {                                              \
-    ms2001_status = MS2001_READING_RES;                                        
\
-    Ms2001Select();                                                    \
-    SPI_Cmd(SPI2, DISABLE);                                            \
-    SPI_InitTypeDef SPI_InitStructure = {                              \
-      .SPI_Direction = SPI_Direction_2Lines_FullDuplex,                        
\
-      .SPI_Mode = SPI_Mode_Master,                                     \
-      .SPI_DataSize = SPI_DataSize_16b,                                        
\
-      .SPI_CPOL = SPI_CPOL_Low,                                                
\
-      .SPI_CPHA = SPI_CPHA_1Edge,                                      \
-      .SPI_NSS = SPI_NSS_Soft,                                         \
-      .SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_64,               \
-      .SPI_FirstBit = SPI_FirstBit_MSB,                                        
\
-      .SPI_CRCPolynomial = 7                                           \
-    };                                                                 \
-    SPI_Init(SPI2, &SPI_InitStructure);                                        
\
-    SPI_Cmd(SPI2, ENABLE);                                             \
-                                                                       \
-    /* trigger 2 frames read */                                                
\
-    /* SPI2_Rx_DMA_Channel configuration 
------------------------------------*/ \
-    DMA_InitTypeDef  DMA_InitStructure;                                        
\
-    DMA_DeInit(DMA1_Channel4);                                         \
-    DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)(SPI2_BASE+0x0C); \
-    DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)(&ms2001_last_reading); \
-    DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralSRC;                 \
-    DMA_InitStructure.DMA_BufferSize = 1;                              \
-    DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;   \
-    DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;            \
-    DMA_InitStructure.DMA_PeripheralDataSize = 
DMA_PeripheralDataSize_HalfWord; \
-    DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord;        
\
-    DMA_InitStructure.DMA_Mode = DMA_Mode_Normal;                      \
-    DMA_InitStructure.DMA_Priority = DMA_Priority_VeryHigh;            \
-    DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;                       \
-    DMA_Init(DMA1_Channel4, &DMA_InitStructure);                       \
-    /* SPI2_Tx_DMA_Channel configuration 
------------------------------------*/ \
-    DMA_DeInit(DMA1_Channel5);                                         \
-    DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)(SPI2_BASE+0x0C); \
-    DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)&ms2001_values;   \
-    DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralDST;                 \
-    DMA_InitStructure.DMA_Priority = DMA_Priority_Medium;              \
-    DMA_Init(DMA1_Channel5, &DMA_InitStructure);                       \
-                                                                       \
-    /* Enable SPI_2 Rx request */                                      \
-    SPI_I2S_DMACmd(SPI2, SPI_I2S_DMAReq_Rx, ENABLE);                   \
-    /* Enable DMA1 Channel4 */                                         \
-    DMA_Cmd(DMA1_Channel4, ENABLE);                                    \
-                                                                       \
-    /* Enable SPI_2 Tx request */                                      \
-    SPI_I2S_DMACmd(SPI2, SPI_I2S_DMAReq_Tx, ENABLE);                   \
-    /* Enable DMA1 Channel5 */                                         \
-    DMA_Cmd(DMA1_Channel5, ENABLE);                                    \
-                                                                       \
-    /* Enable DMA1 Channel4 Transfer Complete interrupt */             \
-    DMA_ITConfig(DMA1_Channel4, DMA_IT_TC, ENABLE);                    \
-                                                                       \
-  }
-
-#define Ms2001OnDmaIrq() {                                     \
-    /*  ASSERT((ms2001_status == MS2001_READING_RES),          \
-     *   DEBUG_MS2001, MS2001_ERR_SPURIOUS_DMA_IRQ);           \
-     */                                                                \
-    if (abs(ms2001_last_reading) < 1000)                       \
-      ms2001_values[ms2001_cur_axe] = ms2001_last_reading;     \
-    Ms2001Unselect();                                          \
-    ms2001_cur_axe++;                                          \
-    if (ms2001_cur_axe > 2) {                                  \
-      ms2001_cur_axe = 0;                                      \
-      ms2001_status = MS2001_DATA_AVAILABLE;                   \
-    }                                                          \
-    else                                                       \
-      ms2001_status = MS2001_IDLE;                             \
-    SPI_Cmd(SPI2, DISABLE);                                    \
-    DMA_ITConfig(DMA1_Channel4, DMA_IT_TC, DISABLE);           \
-  }
-
-#define Ms2001OnSpiIrq() {                                             \
-    /*  ASSERT((ms2001_status == MS2001_SENDING_REQ),                  \
-     *   DEBUG_MS2001, MS2001_ERR_SPURIOUS_SPI_IRQ);                   \
-     */                                                                        
\
-    /* read unused control byte reply */                               \
-    uint8_t foo __attribute__ ((unused)) = SPI_I2S_ReceiveData(SPI2);  \
-    Ms2001Unselect();                                                  \
-    ms2001_status = MS2001_WAITING_EOC;                                        
\
-    SPI_Cmd(SPI2, DISABLE);                                            \
-    SPI_I2S_ITConfig(SPI2, SPI_I2S_IT_RXNE, DISABLE);                  \
-  }
-
-#endif /* BOOZ_MS2001_ARCH_H */

Modified: 
paparazzi3/trunk/sw/airborne/booz/arch/stm32/peripherals/hmc5843_arch.c
===================================================================
--- paparazzi3/trunk/sw/airborne/booz/arch/stm32/peripherals/hmc5843_arch.c     
2010-10-23 21:11:54 UTC (rev 6213)
+++ paparazzi3/trunk/sw/airborne/booz/arch/stm32/peripherals/hmc5843_arch.c     
2010-10-23 21:12:06 UTC (rev 6214)
@@ -20,7 +20,7 @@
  * the Free Software Foundation, 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA. 
  */
-#include "peripherals/booz_hmc5843.h"
+#include "peripherals/hmc5843.h"
 
 #include <stm32/gpio.h>
 #include <stm32/rcc.h>

Modified: paparazzi3/trunk/sw/airborne/booz/test/booz2_test_max1168.c
===================================================================
--- paparazzi3/trunk/sw/airborne/booz/test/booz2_test_max1168.c 2010-10-23 
21:11:54 UTC (rev 6213)
+++ paparazzi3/trunk/sw/airborne/booz/test/booz2_test_max1168.c 2010-10-23 
21:12:06 UTC (rev 6214)
@@ -32,7 +32,7 @@
 
 #include "armVIC.h"
 #include "LPC21xx.h"
-#include "peripherals/booz_max1168.h"
+#include "peripherals/max1168.h"
 
 static inline void main_init( void );
 static inline void main_periodic_task( void );
@@ -60,23 +60,23 @@
   sys_time_init();
 
   main_init_ssp();
-  booz_max1168_init();
+  max1168_init();
 
   int_enable();
 }
 
 static inline void main_periodic_task( void ) {
   LED_TOGGLE(3);
-  booz_max1168_read();
+  max1168_read();
 }
 
 static inline void main_event_task( void ) {
-  if (booz_max1168_status == STA_MAX1168_DATA_AVAILABLE) {
+  if (max1168_status == STA_MAX1168_DATA_AVAILABLE) {
     RunOnceEvery(10, {
-       DOWNLINK_SEND_IMU_GYRO_RAW(DefaultChannel, &booz_max1168_values[0], 
&booz_max1168_values[1], &booz_max1168_values[2]); 
-       DOWNLINK_SEND_IMU_ACCEL_RAW(DefaultChannel, &booz_max1168_values[3], 
&booz_max1168_values[4], &booz_max1168_values[6]);
-       DOWNLINK_SEND_BOOT(DefaultChannel, &booz_max1168_values[7]); });
-    booz_max1168_status = STA_MAX1168_IDLE;
+       DOWNLINK_SEND_IMU_GYRO_RAW(DefaultChannel, &max1168_values[0], 
&max1168_values[1], &max1168_values[2]);
+       DOWNLINK_SEND_IMU_ACCEL_RAW(DefaultChannel, &max1168_values[3], 
&max1168_values[4], &max1168_values[6]);
+       DOWNLINK_SEND_BOOT(DefaultChannel, &max1168_values[7]); });
+    max1168_status = STA_MAX1168_IDLE;
   }
 }
 

Modified: paparazzi3/trunk/sw/airborne/lisa/test/lisa_test_aspirin.c
===================================================================
--- paparazzi3/trunk/sw/airborne/lisa/test/lisa_test_aspirin.c  2010-10-23 
21:11:54 UTC (rev 6213)
+++ paparazzi3/trunk/sw/airborne/lisa/test/lisa_test_aspirin.c  2010-10-23 
21:12:06 UTC (rev 6214)
@@ -33,7 +33,7 @@
 #include "downlink.h"
 
 #include "peripherals/booz_itg3200.h"
-#include "peripherals/booz_hmc5843.h"
+#include "peripherals/hmc5843.h"
 
 static inline void main_init( void );
 static inline void main_periodic_task( void );

Modified: paparazzi3/trunk/sw/airborne/lisa/test/lisa_test_hmc5843.c
===================================================================
--- paparazzi3/trunk/sw/airborne/lisa/test/lisa_test_hmc5843.c  2010-10-23 
21:11:54 UTC (rev 6213)
+++ paparazzi3/trunk/sw/airborne/lisa/test/lisa_test_hmc5843.c  2010-10-23 
21:12:06 UTC (rev 6214)
@@ -33,7 +33,7 @@
 #include "downlink.h"
 #include "std.h"
 
-#include "peripherals/booz_hmc5843.h"
+#include "peripherals/hmc5843.h"
 #include "my_debug_servo.h"
 #include "math/pprz_algebra_int.h"
 

Modified: paparazzi3/trunk/sw/airborne/lisa/test/lisa_test_max1168.c
===================================================================
--- paparazzi3/trunk/sw/airborne/lisa/test/lisa_test_max1168.c  2010-10-23 
21:11:54 UTC (rev 6213)
+++ paparazzi3/trunk/sw/airborne/lisa/test/lisa_test_max1168.c  2010-10-23 
21:12:06 UTC (rev 6214)
@@ -32,7 +32,7 @@
 #include "init_hw.h"
 #include "sys_time.h"
 #include "downlink.h"
-#include "peripherals/booz_max1168.h"
+#include "peripherals/max1168.h"
 
 static inline void main_init( void );
 static inline void main_periodic_task( void );
@@ -56,13 +56,13 @@
 static inline void main_init( void ) {
   hw_init();
   sys_time_init();
-  booz_max1168_init();
+  max1168_init();
   main_spi2_init();
 }
 
 static inline void main_periodic_task( void ) {
   //  LED_TOGGLE(6);
-  booz_max1168_read();
+  max1168_read();
   RunOnceEvery(10, 
               {
                 DOWNLINK_SEND_BOOT(DefaultChannel, &cpu_time_sec);
@@ -72,13 +72,13 @@
 }
 
 static inline void main_event_task( void ) {
-  if (booz_max1168_status == STA_MAX1168_DATA_AVAILABLE) {
+  if (max1168_status == STA_MAX1168_DATA_AVAILABLE) {
     RunOnceEvery(10, {
-       DOWNLINK_SEND_IMU_GYRO_RAW(DefaultChannel, &booz_max1168_values[0], 
&booz_max1168_values[1], &booz_max1168_values[2]); 
-       DOWNLINK_SEND_IMU_ACCEL_RAW(DefaultChannel, &booz_max1168_values[3], 
&booz_max1168_values[4], &booz_max1168_values[6]);
-       //      DOWNLINK_SEND_BOOT(DefaultChannel, &booz_max1168_values[7]); });
+       DOWNLINK_SEND_IMU_GYRO_RAW(DefaultChannel, &max1168_values[0], 
&max1168_values[1], &max1168_values[2]);
+       DOWNLINK_SEND_IMU_ACCEL_RAW(DefaultChannel, &max1168_values[3], 
&max1168_values[4], &max1168_values[6]);
+       //      DOWNLINK_SEND_BOOT(DefaultChannel, &max1168_values[7]); });
       });
-    booz_max1168_status = STA_MAX1168_IDLE;
+    max1168_status = STA_MAX1168_IDLE;
   }
 }
 

Modified: paparazzi3/trunk/sw/airborne/lisa/test/lisa_test_ms2001.c
===================================================================
--- paparazzi3/trunk/sw/airborne/lisa/test/lisa_test_ms2001.c   2010-10-23 
21:11:54 UTC (rev 6213)
+++ paparazzi3/trunk/sw/airborne/lisa/test/lisa_test_ms2001.c   2010-10-23 
21:12:06 UTC (rev 6214)
@@ -32,7 +32,7 @@
 #include "init_hw.h"
 #include "sys_time.h"
 #include "downlink.h"
-#include "peripherals/booz_ms2001.h"
+#include "peripherals/ms2001.h"
 
 static inline void main_init( void );
 static inline void main_periodic_task( void );

Modified: paparazzi3/trunk/sw/airborne/lisa/test/lisa_test_ms2100.c
===================================================================
--- paparazzi3/trunk/sw/airborne/lisa/test/lisa_test_ms2100.c   2010-10-23 
21:11:54 UTC (rev 6213)
+++ paparazzi3/trunk/sw/airborne/lisa/test/lisa_test_ms2100.c   2010-10-23 
21:12:06 UTC (rev 6214)
@@ -56,13 +56,13 @@
 static inline void main_init( void ) {
   hw_init();
   sys_time_init();
-  booz_max1168_init();
+  max1168_init();
   main_spi2_init();
 }
 
 static inline void main_periodic_task( void ) {
   //  LED_TOGGLE(6);
-  booz_max1168_read();
+  max1168_read();
   RunOnceEvery(10, 
               {
                 DOWNLINK_SEND_BOOT(DefaultChannel, &cpu_time_sec);
@@ -72,13 +72,13 @@
 }
 
 static inline void main_event_task( void ) {
-  if (booz_max1168_status == STA_MAX1168_DATA_AVAILABLE) {
+  if (max1168_status == STA_MAX1168_DATA_AVAILABLE) {
     RunOnceEvery(10, {
-       DOWNLINK_SEND_IMU_GYRO_RAW(DefaultChannel, &booz_max1168_values[0], 
&booz_max1168_values[1], &booz_max1168_values[2]); 
-       DOWNLINK_SEND_IMU_ACCEL_RAW(DefaultChannel, &booz_max1168_values[3], 
&booz_max1168_values[4], &booz_max1168_values[6]);
-       //      DOWNLINK_SEND_BOOT(DefaultChannel, &booz_max1168_values[7]); });
+       DOWNLINK_SEND_IMU_GYRO_RAW(DefaultChannel, &max1168_values[0], 
&max1168_values[1], &max1168_values[2]);
+       DOWNLINK_SEND_IMU_ACCEL_RAW(DefaultChannel, &max1168_values[3], 
&max1168_values[4], &max1168_values[6]);
+       //      DOWNLINK_SEND_BOOT(DefaultChannel, &max1168_values[7]); });
       });
-    booz_max1168_status = STA_MAX1168_IDLE;
+    max1168_status = STA_MAX1168_IDLE;
   }
 }
 

Modified: paparazzi3/trunk/sw/airborne/peripherals/adxl345.h
===================================================================
--- paparazzi3/trunk/sw/airborne/peripherals/adxl345.h  2010-10-23 21:11:54 UTC 
(rev 6213)
+++ paparazzi3/trunk/sw/airborne/peripherals/adxl345.h  2010-10-23 21:12:06 UTC 
(rev 6214)
@@ -1,5 +1,5 @@
-#ifndef BOOZ_ADXL345_H
-#define BOOZ_ADXL345_H
+#ifndef ADXL345_H
+#define ADXL345_H
 
 
 #define ADXL345_REG_BW_RATE     0x2C
@@ -14,4 +14,4 @@
 #define ADXL345_REG_DATA_Z1     0x37
 
 
-#endif /* BOOZ_ADXL345_H */
+#endif /* ADXL345_H */

Modified: paparazzi3/trunk/sw/airborne/peripherals/ami601.c
===================================================================
--- paparazzi3/trunk/sw/airborne/peripherals/ami601.c   2010-10-23 21:11:54 UTC 
(rev 6213)
+++ paparazzi3/trunk/sw/airborne/peripherals/ami601.c   2010-10-23 21:12:06 UTC 
(rev 6214)
@@ -1,4 +1,4 @@
-#include "peripherals/booz_ami601.h"
+#include "peripherals/ami601.h"
 
 uint8_t ami601_foo1;
 uint8_t ami601_foo2;

Modified: paparazzi3/trunk/sw/airborne/peripherals/ami601.h
===================================================================
--- paparazzi3/trunk/sw/airborne/peripherals/ami601.h   2010-10-23 21:11:54 UTC 
(rev 6213)
+++ paparazzi3/trunk/sw/airborne/peripherals/ami601.h   2010-10-23 21:12:06 UTC 
(rev 6214)
@@ -1,5 +1,5 @@
-#ifndef BOOZ_AMI601_H
-#define BOOZ_AMI601_H
+#ifndef AMI601_H
+#define AMI601_H
 
 #include "std.h"
 #include "i2c.h"

Modified: paparazzi3/trunk/sw/airborne/peripherals/hmc5843.c
===================================================================
--- paparazzi3/trunk/sw/airborne/peripherals/hmc5843.c  2010-10-23 21:11:54 UTC 
(rev 6213)
+++ paparazzi3/trunk/sw/airborne/peripherals/hmc5843.c  2010-10-23 21:12:06 UTC 
(rev 6214)
@@ -1,4 +1,4 @@
-#include "peripherals/booz_hmc5843.h"
+#include "peripherals/hmc5843.h"
 
 #define HMC5843_TIMEOUT 100
 
@@ -9,11 +9,11 @@
 
 void hmc5843_init(void)
 {
-       hmc5843.i2c_trans.status = I2CTransSuccess;
-       hmc5843.i2c_trans.slave_addr = HMC5843_ADDR;
-       hmc5843.i2c_trans.stop_after_transmit = TRUE;
+    hmc5843.i2c_trans.status = I2CTransSuccess;
+    hmc5843.i2c_trans.slave_addr = HMC5843_ADDR;
+    hmc5843.i2c_trans.stop_after_transmit = TRUE;
 
-       hmc5843_arch_init();
+    hmc5843_arch_init();
 }
 
 // blocking, only intended to be called for initialization
@@ -24,52 +24,52 @@
   hmc5843.i2c_trans.buf[1] = 0x00 | (0x06 << 2);
   hmc5843.i2c_trans.len_w = 2;
   i2c_submit(&i2c2,&hmc5843.i2c_trans);
-       while(hmc5843.i2c_trans.status == I2CTransPending);
+    while(hmc5843.i2c_trans.status == I2CTransPending);
 
   hmc5843.i2c_trans.type = I2CTransTx;
   hmc5843.i2c_trans.buf[0] = HMC5843_REG_CFGB;  // set to gain to 1 Gauss
   hmc5843.i2c_trans.buf[1] = 0x01<<5;
   hmc5843.i2c_trans.len_w = 2;
   i2c_submit(&i2c2,&hmc5843.i2c_trans);
-       while(hmc5843.i2c_trans.status == I2CTransPending);
+    while(hmc5843.i2c_trans.status == I2CTransPending);
 
   hmc5843.i2c_trans.type = I2CTransTx;
   hmc5843.i2c_trans.buf[0] = HMC5843_REG_MODE;  // set to continuous mode
   hmc5843.i2c_trans.buf[1] = 0x00;
   hmc5843.i2c_trans.len_w = 2;
   i2c_submit(&i2c2,&hmc5843.i2c_trans);
-       while(hmc5843.i2c_trans.status == I2CTransPending);
+    while(hmc5843.i2c_trans.status == I2CTransPending);
 
 }
 
 void hmc5843_idle_task(void)
 {
-       if (hmc5843.initialized && hmc5843.ready_for_read && 
(hmc5843.i2c_trans.status == I2CTransSuccess || hmc5843.i2c_trans.status == 
I2CTransFailed)) {
-               hmc5843.i2c_trans.type = I2CTransRx;
-               hmc5843.i2c_trans.len_r = 7;
-               i2c_submit(&i2c2, &hmc5843.i2c_trans);
-               hmc5843.reading = TRUE;
-               hmc5843.ready_for_read = FALSE;
-       }
+    if (hmc5843.initialized && hmc5843.ready_for_read && 
(hmc5843.i2c_trans.status == I2CTransSuccess || hmc5843.i2c_trans.status == 
I2CTransFailed)) {
+        hmc5843.i2c_trans.type = I2CTransRx;
+        hmc5843.i2c_trans.len_r = 7;
+        i2c_submit(&i2c2, &hmc5843.i2c_trans);
+        hmc5843.reading = TRUE;
+        hmc5843.ready_for_read = FALSE;
+    }
 
-       if (hmc5843.reading && hmc5843.i2c_trans.status == I2CTransSuccess) {
-               hmc5843.timeout = 0;
-               hmc5843.data_available = TRUE;
-               hmc5843.reading = FALSE;
-               memcpy(hmc5843.data.buf, (const void *) hmc5843.i2c_trans.buf, 
6);
-               for (int i = 0; i < 3; i++) {
-                       hmc5843.data.value[i] = bswap_16(hmc5843.data.value[i]);
-               }
-       }
+    if (hmc5843.reading && hmc5843.i2c_trans.status == I2CTransSuccess) {
+        hmc5843.timeout = 0;
+        hmc5843.data_available = TRUE;
+        hmc5843.reading = FALSE;
+        memcpy(hmc5843.data.buf, (const void *) hmc5843.i2c_trans.buf, 6);
+        for (int i = 0; i < 3; i++) {
+            hmc5843.data.value[i] = bswap_16(hmc5843.data.value[i]);
+        }
+    }
 }
 
 void hmc5843_periodic(void)
 {
-       if (!hmc5843.initialized) {
-               send_config();
-               hmc5843.initialized = TRUE;
-       } else if (hmc5843.timeout++ > HMC5843_TIMEOUT) {
-               hmc5843_arch_reset();
-               hmc5843.timeout = 0;
-       }
+    if (!hmc5843.initialized) {
+        send_config();
+        hmc5843.initialized = TRUE;
+    } else if (hmc5843.timeout++ > HMC5843_TIMEOUT) {
+        hmc5843_arch_reset();
+        hmc5843.timeout = 0;
+    }
 }

Modified: paparazzi3/trunk/sw/airborne/peripherals/hmc5843.h
===================================================================
--- paparazzi3/trunk/sw/airborne/peripherals/hmc5843.h  2010-10-23 21:11:54 UTC 
(rev 6213)
+++ paparazzi3/trunk/sw/airborne/peripherals/hmc5843.h  2010-10-23 21:12:06 UTC 
(rev 6214)
@@ -21,8 +21,8 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#ifndef BOOZ_HMC5843_H
-#define BOOZ_HMC5843_H
+#ifndef HMC5843_H
+#define HMC5843_H
 
 #include "std.h"
 #include "i2c.h"
@@ -30,16 +30,16 @@
 #include "peripherals/hmc5843_arch.h"
 
 struct Hmc5843 {
-       struct i2c_transaction i2c_trans;
+    struct i2c_transaction i2c_trans;
   union {
     uint8_t buf[7];
     int16_t value[3];
   } data;
-       uint8_t initialized;
-       uint8_t reading;
-       volatile uint8_t ready_for_read;
-       uint8_t data_available;
-       uint32_t timeout;
+    uint8_t initialized;
+    uint8_t reading;
+    volatile uint8_t ready_for_read;
+    uint8_t data_available;
+    uint32_t timeout;
 };
 
 extern struct Hmc5843 hmc5843;
@@ -72,10 +72,10 @@
 #include <string.h>
 
 #define MagEvent(_m_handler) {                                         \
-         hmc5843_idle_task(); \
+      hmc5843_idle_task(); \
     if (hmc5843.data_available) { \
-                       _m_handler(); \
+            _m_handler(); \
     } \
   }
 
-#endif /* BOOZ_HMC5843_H */
+#endif /* HMC5843_H */

Modified: paparazzi3/trunk/sw/airborne/peripherals/itg3200.h
===================================================================
--- paparazzi3/trunk/sw/airborne/peripherals/itg3200.h  2010-10-23 21:11:54 UTC 
(rev 6213)
+++ paparazzi3/trunk/sw/airborne/peripherals/itg3200.h  2010-10-23 21:12:06 UTC 
(rev 6214)
@@ -1,5 +1,5 @@
-#ifndef BOOZ_ITG3200
-#define BOOZ_ITG3200
+#ifndef ITG3200
+#define ITG3200
 
 /* default I2C address */
 #define ITG3200_ADDR 0xD0
@@ -22,4 +22,4 @@
 
 
 
-#endif /* BOOZ_ITG3200 */
+#endif /* ITG3200 */

Modified: paparazzi3/trunk/sw/airborne/peripherals/max1168.c
===================================================================
--- paparazzi3/trunk/sw/airborne/peripherals/max1168.c  2010-10-23 21:11:54 UTC 
(rev 6213)
+++ paparazzi3/trunk/sw/airborne/peripherals/max1168.c  2010-10-23 21:12:06 UTC 
(rev 6214)
@@ -22,19 +22,19 @@
  *
  */
 
-#include "booz_max1168.h"
+#include "max1168.h"
 
 
-volatile uint8_t booz_max1168_status;
-uint16_t booz_max1168_values[MAX1168_NB_CHAN];
+volatile uint8_t max1168_status;
+uint16_t max1168_values[MAX1168_NB_CHAN];
 
-extern void booz_max1168_init( void ) {
+extern void max1168_init( void ) {
 
-  booz_max1168_arch_init();
+  max1168_arch_init();
 
   uint8_t i;
   for (i=0; i<MAX1168_NB_CHAN; i++)
-    booz_max1168_values[i] = 0;
+    max1168_values[i] = 0;
 
-  booz_max1168_status = STA_MAX1168_IDLE;
+  max1168_status = STA_MAX1168_IDLE;
 }

Modified: paparazzi3/trunk/sw/airborne/peripherals/max1168.h
===================================================================
--- paparazzi3/trunk/sw/airborne/peripherals/max1168.h  2010-10-23 21:11:54 UTC 
(rev 6213)
+++ paparazzi3/trunk/sw/airborne/peripherals/max1168.h  2010-10-23 21:12:06 UTC 
(rev 6214)
@@ -21,28 +21,28 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#ifndef BOOZ_MAX1168_H
-#define BOOZ_MAX1168_H
+#ifndef MAX1168_H
+#define MAX1168_H
 
 #include "std.h"
 
 #define MAX1168_NB_CHAN 8
 
-extern void booz_max1168_init( void );
+extern void max1168_init( void );
 
 #define STA_MAX1168_IDLE           0
 #define STA_MAX1168_SENDING_REQ    1
 #define STA_MAX1168_READING_RES    2
 #define STA_MAX1168_DATA_AVAILABLE 3
-extern volatile uint8_t booz_max1168_status;
+extern volatile uint8_t max1168_status;
 
-extern uint16_t booz_max1168_values[MAX1168_NB_CHAN];
+extern uint16_t max1168_values[MAX1168_NB_CHAN];
 
 /* underlying architecture */
-#include "peripherals/booz_max1168_arch.h"
+#include "peripherals/max1168_arch.h"
 /* must be implemented by underlying architecture */
-extern void booz_max1168_arch_init( void );
-extern void booz_max1168_read( void );
+extern void max1168_arch_init( void );
+extern void max1168_read( void );
 
 
-#endif /* BOOZ_MAX1168_H */
+#endif /* MAX1168_H */

Modified: paparazzi3/trunk/sw/airborne/peripherals/ms2001.c
===================================================================
--- paparazzi3/trunk/sw/airborne/peripherals/ms2001.c   2010-10-23 21:11:54 UTC 
(rev 6213)
+++ paparazzi3/trunk/sw/airborne/peripherals/ms2001.c   2010-10-23 21:12:06 UTC 
(rev 6214)
@@ -21,7 +21,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "booz_ms2001.h"
+#include "ms2001.h"
 
 volatile uint8_t ms2001_status;
 volatile int16_t ms2001_values[MS2001_NB_AXIS];

Modified: paparazzi3/trunk/sw/airborne/peripherals/ms2001.h
===================================================================
--- paparazzi3/trunk/sw/airborne/peripherals/ms2001.h   2010-10-23 21:11:54 UTC 
(rev 6213)
+++ paparazzi3/trunk/sw/airborne/peripherals/ms2001.h   2010-10-23 21:12:06 UTC 
(rev 6214)
@@ -21,8 +21,8 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#ifndef BOOZ_MS2001_H
-#define BOOZ_MS2001_H
+#ifndef MS2001_H
+#define MS2001_H
 
 
 #include "std.h"
@@ -44,7 +44,7 @@
 extern volatile int16_t ms2001_values[MS2001_NB_AXIS];
 
 /* underlying architecture */
-#include "peripherals/booz_ms2001_arch.h"
+#include "peripherals/ms2001_arch.h"
 /* must be implemented by underlying architecture */
 extern void ms2001_arch_init( void );
 
@@ -56,4 +56,4 @@
 #define MS2001_DIVISOR MS2001_DIVISOR_1024
 
 
-#endif /* BOOZ_MS2001_H */
+#endif /* MS2001_H */

Modified: paparazzi3/trunk/sw/airborne/peripherals/sc18i600.c
===================================================================
--- paparazzi3/trunk/sw/airborne/peripherals/sc18i600.c 2010-10-23 21:11:54 UTC 
(rev 6213)
+++ paparazzi3/trunk/sw/airborne/peripherals/sc18i600.c 2010-10-23 21:12:06 UTC 
(rev 6214)
@@ -1,4 +1,4 @@
-#include "booz/peripherals/booz_sc18is600.h"
+#include "booz/peripherals/sc18is600.h"
 
 struct Sc18Is600 sc18is600;
 

Modified: paparazzi3/trunk/sw/airborne/peripherals/sc18i600.h
===================================================================
--- paparazzi3/trunk/sw/airborne/peripherals/sc18i600.h 2010-10-23 21:11:54 UTC 
(rev 6213)
+++ paparazzi3/trunk/sw/airborne/peripherals/sc18i600.h 2010-10-23 21:12:06 UTC 
(rev 6214)
@@ -48,7 +48,7 @@
 extern void sc18is600_write_to_register(uint8_t addr, uint8_t value);
 extern void sc18is600_read_from_register(uint8_t addr);
 
-#include "peripherals/booz_sc18is600_arch.h"
+#include "peripherals/sc18is600_arch.h"
 extern void sc18is600_arch_init(void);
 
 #endif /* SC18IS600_H */

Modified: paparazzi3/trunk/sw/airborne/subsystems/imu/arch/lpc21/imu_b2_arch.c
===================================================================
--- paparazzi3/trunk/sw/airborne/subsystems/imu/arch/lpc21/imu_b2_arch.c        
2010-10-23 21:11:54 UTC (rev 6213)
+++ paparazzi3/trunk/sw/airborne/subsystems/imu/arch/lpc21/imu_b2_arch.c        
2010-10-23 21:12:06 UTC (rev 6214)
@@ -90,7 +90,7 @@
   ImuSetSSP16bits();
   // read adc
   imu_ssp_status = IMU_SSP_STA_BUSY_MAX1168;
-  booz_max1168_read();
+  max1168_read();
 #if defined IMU_B2_MAG_TYPE && IMU_B2_MAG_TYPE == IMU_B2_MAG_AMI601
   RunOnceEvery(10, { ami601_read(); });
 #endif

Modified: paparazzi3/trunk/sw/airborne/subsystems/imu/arch/sim/imu_b2_arch.c
===================================================================
--- paparazzi3/trunk/sw/airborne/subsystems/imu/arch/sim/imu_b2_arch.c  
2010-10-23 21:11:54 UTC (rev 6213)
+++ paparazzi3/trunk/sw/airborne/subsystems/imu/arch/sim/imu_b2_arch.c  
2010-10-23 21:12:06 UTC (rev 6214)
@@ -36,13 +36,13 @@
 #include "nps_sensors.h"
 
 void imu_feed_gyro_accel(void) {
-  booz_max1168_values[IMU_GYRO_P_CHAN]  = sensors.gyro.value.x;
-  booz_max1168_values[IMU_GYRO_Q_CHAN]  = sensors.gyro.value.y;
-  booz_max1168_values[IMU_GYRO_R_CHAN]  = sensors.gyro.value.z;
-  booz_max1168_values[IMU_ACCEL_X_CHAN] = sensors.accel.value.x;
-  booz_max1168_values[IMU_ACCEL_Y_CHAN] = sensors.accel.value.y;
-  booz_max1168_values[IMU_ACCEL_Z_CHAN] = sensors.accel.value.z;
-  booz_max1168_status = STA_MAX1168_DATA_AVAILABLE;
+  max1168_values[IMU_GYRO_P_CHAN]  = sensors.gyro.value.x;
+  max1168_values[IMU_GYRO_Q_CHAN]  = sensors.gyro.value.y;
+  max1168_values[IMU_GYRO_R_CHAN]  = sensors.gyro.value.z;
+  max1168_values[IMU_ACCEL_X_CHAN] = sensors.accel.value.x;
+  max1168_values[IMU_ACCEL_Y_CHAN] = sensors.accel.value.y;
+  max1168_values[IMU_ACCEL_Z_CHAN] = sensors.accel.value.z;
+  max1168_status = STA_MAX1168_DATA_AVAILABLE;
 }
 
 

Modified: paparazzi3/trunk/sw/airborne/subsystems/imu/arch/stm32/imu_b2_arch.c
===================================================================
--- paparazzi3/trunk/sw/airborne/subsystems/imu/arch/stm32/imu_b2_arch.c        
2010-10-23 21:11:54 UTC (rev 6213)
+++ paparazzi3/trunk/sw/airborne/subsystems/imu/arch/stm32/imu_b2_arch.c        
2010-10-23 21:12:06 UTC (rev 6214)
@@ -79,7 +79,7 @@
   imu_ssp_status = IMU_SSP_STA_BUSY_MAX1168;
   Max1168ConfigureSPI();
   SPI_Cmd(SPI2, ENABLE);
-  booz_max1168_read();
+  max1168_read();
 #if IMU_B2_MAG_TYPE == IMU_B2_MAG_HMC5843
        hmc5843_periodic();
 #endif

Modified: paparazzi3/trunk/sw/airborne/subsystems/imu/imu_aspirin.h
===================================================================
--- paparazzi3/trunk/sw/airborne/subsystems/imu/imu_aspirin.h   2010-10-23 
21:11:54 UTC (rev 6213)
+++ paparazzi3/trunk/sw/airborne/subsystems/imu/imu_aspirin.h   2010-10-23 
21:12:06 UTC (rev 6214)
@@ -29,7 +29,7 @@
 
 #include "i2c.h"
 #include "booz/peripherals/booz_itg3200.h"
-#include "booz/peripherals/booz_hmc5843.h"
+#include "booz/peripherals/hmc5843.h"
 #include "booz/peripherals/booz_adxl345.h"
 
 

Modified: paparazzi3/trunk/sw/airborne/subsystems/imu/imu_b2.c
===================================================================
--- paparazzi3/trunk/sw/airborne/subsystems/imu/imu_b2.c        2010-10-23 
21:11:54 UTC (rev 6213)
+++ paparazzi3/trunk/sw/airborne/subsystems/imu/imu_b2.c        2010-10-23 
21:12:06 UTC (rev 6214)
@@ -27,7 +27,7 @@
 
   imu_b2_arch_init();
 
-  booz_max1168_init();
+  max1168_init();
 #if defined IMU_B2_MAG_TYPE && IMU_B2_MAG_TYPE == IMU_B2_MAG_MS2001
   ms2001_init();
 #elif defined IMU_B2_MAG_TYPE && IMU_B2_MAG_TYPE == IMU_B2_MAG_AMI601

Modified: paparazzi3/trunk/sw/airborne/subsystems/imu/imu_b2.h
===================================================================
--- paparazzi3/trunk/sw/airborne/subsystems/imu/imu_b2.h        2010-10-23 
21:11:54 UTC (rev 6213)
+++ paparazzi3/trunk/sw/airborne/subsystems/imu/imu_b2.h        2010-10-23 
21:12:06 UTC (rev 6214)
@@ -27,7 +27,7 @@
 #include <subsystems/imu.h>
 #include "airframe.h"
 
-#include "peripherals/booz_max1168.h"
+#include "peripherals/max1168.h"
 
 /* type of magnetometer */
 #define IMU_B2_MAG_NONE   0
@@ -143,7 +143,7 @@
 
 
 #if defined IMU_B2_MAG_TYPE && IMU_B2_MAG_TYPE == IMU_B2_MAG_MS2001
-#include "peripherals/booz_ms2001.h"
+#include "peripherals/ms2001.h"
 #define ImuMagEvent(_mag_handler) {                                    \
     if (ms2001_status == MS2001_DATA_AVAILABLE) {                      \
       imu.mag_unscaled.x = ms2001_values[IMU_MAG_X_CHAN];              \
@@ -154,7 +154,7 @@
     }                                                                  \
   }
 #elif defined IMU_B2_MAG_TYPE && IMU_B2_MAG_TYPE == IMU_B2_MAG_AMI601
-#include "peripherals/booz_ami601.h"
+#include "peripherals/ami601.h"
 #define foo_handler() {}
 #define ImuMagEvent(_mag_handler) {                                    \
     AMI601Event(foo_handler);                                          \
@@ -167,7 +167,7 @@
     }                                                                  \
   }
 #elif defined IMU_B2_MAG_TYPE && IMU_B2_MAG_TYPE == IMU_B2_MAG_HMC5843
-#include "peripherals/booz_hmc5843.h"
+#include "peripherals/hmc5843.h"
 #define foo_handler() {}
 #define ImuMagEvent(_mag_handler) {                                    \
          MagEvent(foo_handler); \
@@ -185,14 +185,14 @@
 
 
 #define ImuEvent(_gyro_accel_handler, _mag_handler) {          \
-    if (booz_max1168_status == STA_MAX1168_DATA_AVAILABLE) {           \
-      imu.gyro_unscaled.p  = booz_max1168_values[IMU_GYRO_P_CHAN]; \
-      imu.gyro_unscaled.q  = booz_max1168_values[IMU_GYRO_Q_CHAN]; \
-      imu.gyro_unscaled.r  = booz_max1168_values[IMU_GYRO_R_CHAN]; \
-      imu.accel_unscaled.x = booz_max1168_values[IMU_ACCEL_X_CHAN]; \
-      imu.accel_unscaled.y = booz_max1168_values[IMU_ACCEL_Y_CHAN]; \
-      imu.accel_unscaled.z = booz_max1168_values[IMU_ACCEL_Z_CHAN]; \
-      booz_max1168_status = STA_MAX1168_IDLE;                          \
+    if (max1168_status == STA_MAX1168_DATA_AVAILABLE) {                \
+      imu.gyro_unscaled.p  = max1168_values[IMU_GYRO_P_CHAN]; \
+      imu.gyro_unscaled.q  = max1168_values[IMU_GYRO_Q_CHAN]; \
+      imu.gyro_unscaled.r  = max1168_values[IMU_GYRO_R_CHAN]; \
+      imu.accel_unscaled.x = max1168_values[IMU_ACCEL_X_CHAN]; \
+      imu.accel_unscaled.y = max1168_values[IMU_ACCEL_Y_CHAN]; \
+      imu.accel_unscaled.z = max1168_values[IMU_ACCEL_Z_CHAN]; \
+      max1168_status = STA_MAX1168_IDLE;                               \
       _gyro_accel_handler();                                           \
     }                                                                  \
     ImuMagEvent(_mag_handler);                                 \

Modified: paparazzi3/trunk/sw/airborne/subsystems/imu/imu_crista.h
===================================================================
--- paparazzi3/trunk/sw/airborne/subsystems/imu/imu_crista.h    2010-10-23 
21:11:54 UTC (rev 6213)
+++ paparazzi3/trunk/sw/airborne/subsystems/imu/imu_crista.h    2010-10-23 
21:12:06 UTC (rev 6214)
@@ -47,7 +47,7 @@
   }
 
 #ifdef USE_AMI601
-#include "peripherals/booz_ami601.h"
+#include "peripherals/ami601.h"
 #define foo_handler() {}
 #define ImuMagEvent(_mag_handler) {                                    \
     AMI601Event(foo_handler);                                          \

Modified: paparazzi3/trunk/sw/airborne/test/peripherals/test_ami601.c
===================================================================
--- paparazzi3/trunk/sw/airborne/test/peripherals/test_ami601.c 2010-10-23 
21:11:54 UTC (rev 6213)
+++ paparazzi3/trunk/sw/airborne/test/peripherals/test_ami601.c 2010-10-23 
21:12:06 UTC (rev 6214)
@@ -32,7 +32,7 @@
 #include "downlink.h"
 
 #include "i2c.h"
-#include "booz/peripherals/booz_ami601.h"
+#include "booz/peripherals/ami601.h"
 #include "math/pprz_algebra_int.h"
 
 #include "interrupt_hw.h"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]