diff --git a/Doxyfile b/Doxyfile index e0b045a019..f8cc20f752 100644 --- a/Doxyfile +++ b/Doxyfile @@ -1462,6 +1462,9 @@ PREDEFINED = USE_GPS \ USE_IMU \ USE_MAGNETOMETER \ USE_BAROMETER \ + SPI_MASTER \ + SPI_SLAVE \ + USE_SPI0 USE_SPI1 USE_SPI2 \ RADIO_CONTROL \ GUIDANCE_V_C \ __attribute__(x)= diff --git a/doc/manual/style.dox b/doc/manual/style.dox index 09de324ca6..ae52adeedc 100644 --- a/doc/manual/style.dox +++ b/doc/manual/style.dox @@ -91,7 +91,7 @@ switch( state ) @endcode @section stylecpp Preprocessor directives -- For conditional compilation use @c #if instead of @c #ifdef. +- For conditional compilation use @c \#if instead of @c \#ifdef. Someone might write code like: @code #ifdef USE_FOO @@ -102,7 +102,7 @@ Someone else might compile the code with turned-off foo info like: @verbatim gcc stuff.c -DUSE_FOO=0 @endverbatim -So use @c #if not @c #ifdef to turn a feature on or off. This works fine, and does the right thing, even if USE_FOO is not defined at all (!) +So use @c \#if not @c \#ifdef to turn a feature on or off. This works fine, and does the right thing, even if USE_FOO is not defined at all (!) @code #if USE_FOO bar(); diff --git a/sw/airborne/arch/lpc21/interrupt_hw.h b/sw/airborne/arch/lpc21/interrupt_hw.h index 70007f2b43..532930a33d 100644 --- a/sw/airborne/arch/lpc21/interrupt_hw.h +++ b/sw/airborne/arch/lpc21/interrupt_hw.h @@ -19,12 +19,20 @@ * Boston, MA 02111-1307, USA. * */ -/** \file interrupt_hw.h - * \brief ARM Low level interrupt handling + +/** + * @file arch/lpc21/interrupt_hw.h + * @ingroup lpc21_arch * + * ARM Low level interrupt handling. */ +#ifndef INTERRUPT_HW_H +#define INTERRUPT_HW_H + #include "armVIC.h" #define int_enable() enableIRQ() #define int_disable() disableIRQ() + +#endif /* INTERRUPT_HW_H */ diff --git a/sw/airborne/arch/lpc21/mcu_arch.c b/sw/airborne/arch/lpc21/mcu_arch.c index ab66aaa72f..cae484595e 100644 --- a/sw/airborne/arch/lpc21/mcu_arch.c +++ b/sw/airborne/arch/lpc21/mcu_arch.c @@ -1,6 +1,4 @@ /* - * Paparazzi lpc21 arch dependant microcontroller initialisation function - * * Copyright (C) 2010 The Paparazzi team * * This file is part of Paparazzi. @@ -22,6 +20,12 @@ * */ +/** + * @file arch/lpc21/mcu_arch.c + * @brief lpc21 arch dependant microcontroller initialisation functions. + * @ingroup lpc21_arch + */ + #include "mcu.h" diff --git a/sw/airborne/arch/lpc21/mcu_arch.h b/sw/airborne/arch/lpc21/mcu_arch.h index a677d396c2..896b1efa86 100644 --- a/sw/airborne/arch/lpc21/mcu_arch.h +++ b/sw/airborne/arch/lpc21/mcu_arch.h @@ -1,6 +1,4 @@ /* - * Paparazzi lpc21 arch dependant microcontroller initialisation functions - * * Copyright (C) 2010 The Paparazzi team * * This file is part of Paparazzi. @@ -22,6 +20,13 @@ * */ +/** + * @file arch/lpc21/mcu_arch.h + * @brief lpc21 arch dependant microcontroller initialisation functions. + * @defgroup lpc21_arch LPC21 architecture + * @ingroup lpc21_arch + */ + #ifndef LPC21_MCU_ARCH_H #define LPC21_MCU_ARCH_H diff --git a/sw/airborne/arch/lpc21/mcu_periph/adc_arch.c b/sw/airborne/arch/lpc21/mcu_periph/adc_arch.c index aea431e678..8faed22706 100644 --- a/sw/airborne/arch/lpc21/mcu_periph/adc_arch.c +++ b/sw/airborne/arch/lpc21/mcu_periph/adc_arch.c @@ -20,6 +20,13 @@ * */ +/** + * @file arch/lpc21/mcu_periph/adc_arch.c + * @ingroup lpc21_arch + * + * Handling of ADC hardware for lpc21xx. + */ + #include "mcu_periph/adc.h" #include "LPC21xx.h" diff --git a/sw/airborne/arch/lpc21/mcu_periph/adc_arch.h b/sw/airborne/arch/lpc21/mcu_periph/adc_arch.h index 2e9a687bc1..3da68c2f33 100644 --- a/sw/airborne/arch/lpc21/mcu_periph/adc_arch.h +++ b/sw/airborne/arch/lpc21/mcu_periph/adc_arch.h @@ -20,12 +20,19 @@ * */ -#ifndef ADC_HW_H -#define ADC_HW_H +/** + * @file arch/lpc21/mcu_periph/adc_arch.h + * @ingroup lpc21_arch + * + * Handling of ADC hardware for lpc21xx. + */ + +#ifndef ADC_ARCH_H +#define ADC_ARCH_H #include BOARD_CONFIG #define AdcBank0(x) (x) #define AdcBank1(x) (x+NB_ADC) -#endif /* ADC_HW_H */ +#endif /* ADC_ARCH_H */ diff --git a/sw/airborne/arch/lpc21/mcu_periph/dac_arch.c b/sw/airborne/arch/lpc21/mcu_periph/dac_arch.c index 3955ad27a1..31f2b6969e 100644 --- a/sw/airborne/arch/lpc21/mcu_periph/dac_arch.c +++ b/sw/airborne/arch/lpc21/mcu_periph/dac_arch.c @@ -1,3 +1,32 @@ +/* + * Copyright (C) 2008 Pascal Brisset, Antoine Drouin + * + * 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. + * + */ + +/** + * @file arch/lpc21/mcu_periph/dac_arch.c + * @ingroup lpc21_arch + * + * Handling of DAC hardware for lpc21xx. + */ + #include "mcu_periph/dac.h" /* turn on DAC pins */ diff --git a/sw/airborne/arch/lpc21/mcu_periph/dac_arch.h b/sw/airborne/arch/lpc21/mcu_periph/dac_arch.h index e27b929e34..d808712f34 100644 --- a/sw/airborne/arch/lpc21/mcu_periph/dac_arch.h +++ b/sw/airborne/arch/lpc21/mcu_periph/dac_arch.h @@ -1,3 +1,32 @@ +/* + * Copyright (C) 2008 Pascal Brisset, Antoine Drouin + * + * 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. + * + */ + +/** + * @file arch/lpc21/mcu_periph/dac_arch.h + * @ingroup lpc21_arch + * + * Handling of DAC hardware for lpc21xx. + */ + #ifndef LPC21_MCU_PERIPH_DAC_ARCH_H #define LPC21_MCU_PERIPH_DAC_ARCH_H diff --git a/sw/airborne/arch/lpc21/mcu_periph/i2c_arch.c b/sw/airborne/arch/lpc21/mcu_periph/i2c_arch.c index 9f38b5a2c1..67c5b14138 100644 --- a/sw/airborne/arch/lpc21/mcu_periph/i2c_arch.c +++ b/sw/airborne/arch/lpc21/mcu_periph/i2c_arch.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 The Paparazzi Team + * Copyright (C) 2010-2012 The Paparazzi Team * * This file is part of paparazzi. * @@ -20,6 +20,13 @@ * */ +/** + * @file arch/lpc21/mcu_periph/i2c_arch.c + * @ingroup lpc21_arch + * + * Handling of I2C hardware for LPC21xx. + */ + #include "mcu_periph/i2c.h" #include "std.h" diff --git a/sw/airborne/arch/lpc21/mcu_periph/i2c_arch.h b/sw/airborne/arch/lpc21/mcu_periph/i2c_arch.h index 9bfe3cf39d..7560ac694a 100644 --- a/sw/airborne/arch/lpc21/mcu_periph/i2c_arch.h +++ b/sw/airborne/arch/lpc21/mcu_periph/i2c_arch.h @@ -1,5 +1,34 @@ -#ifndef I2C_HW_H -#define I2C_HW_H +/* + * Copyright (C) 2010-2012 The Paparazzi Team + * + * 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. + * + */ + +/** + * @file arch/lpc21/mcu_periph/i2c_arch.h + * @ingroup lpc21_arch + * + * Handling of I2C hardware for LPC21xx. + */ + +#ifndef I2C_ARCH_H +#define I2C_ARCH_H #include "LPC21xx.h" @@ -31,4 +60,4 @@ extern void i2c1_hw_init(void); #endif /* USE_I2C1 */ -#endif /* I2C_HW_H */ +#endif /* I2C_ARCH_H */ diff --git a/sw/airborne/arch/lpc21/mcu_periph/pwm_input_arch.c b/sw/airborne/arch/lpc21/mcu_periph/pwm_input_arch.c index 37af6366f9..cbf9e3c5e5 100644 --- a/sw/airborne/arch/lpc21/mcu_periph/pwm_input_arch.c +++ b/sw/airborne/arch/lpc21/mcu_periph/pwm_input_arch.c @@ -1,5 +1,4 @@ -/* $Id$ - * +/* * Copyright (C) 2011 The Paparazzi Team * * This file is part of paparazzi. @@ -21,8 +20,11 @@ * */ -/** \brief handling of arm7 PWM input using a timer with capture +/** + * @file arch/lpc21/mcu_periph/pwm_input_arch.c + * @ingroup lpc21_arch * + * handling of arm7 PWM input using a timer with capture. */ #include "mcu_periph/pwm_input_arch.h" @@ -147,4 +149,4 @@ void pwm_input_isr2(void) #endif //ACTIVE_LOW } } -#endif //USE_PWM_INPUT2 \ No newline at end of file +#endif //USE_PWM_INPUT2 diff --git a/sw/airborne/arch/lpc21/mcu_periph/pwm_input_arch.h b/sw/airborne/arch/lpc21/mcu_periph/pwm_input_arch.h index 1ba9302a72..31e176daf5 100644 --- a/sw/airborne/arch/lpc21/mcu_periph/pwm_input_arch.h +++ b/sw/airborne/arch/lpc21/mcu_periph/pwm_input_arch.h @@ -1,5 +1,4 @@ -/* $Id$ - * +/* * Copyright (C) 2011 The Paparazzi Team * * This file is part of paparazzi. @@ -21,8 +20,11 @@ * */ -/** \brief handling of arm7 PWM input using a timer with capture +/** + * @file arch/lpc21/mcu_periph/pwm_input_arch.h + * @ingroup lpc21_arch * + * handling of arm7 PWM input using a timer with capture. */ #ifndef PWM_INPUT_ARCH_H @@ -48,4 +50,4 @@ extern void pwm_input_isr2(void); #define PWM_INPUT_ISR_2() pwm_input_isr2() #endif //USE_PWM_INPUT2 -#endif /* PWM_INPUT_ARCH_H */ \ No newline at end of file +#endif /* PWM_INPUT_ARCH_H */ diff --git a/sw/airborne/arch/lpc21/mcu_periph/spi_arch.c b/sw/airborne/arch/lpc21/mcu_periph/spi_arch.c index d7b5f4a15f..2e47efe951 100644 --- a/sw/airborne/arch/lpc21/mcu_periph/spi_arch.c +++ b/sw/airborne/arch/lpc21/mcu_periph/spi_arch.c @@ -22,8 +22,12 @@ /** * @file arch/lpc21/mcu_periph/spi_arch.c + * @ingroup lpc21_arch + * * Handling of SPI hardware for lpc21xx. * for now only SPI1 ( aka SSP ) + * + * TODO current implementation only works for SPI1 (SSP) */ #include "mcu_periph/spi.h" @@ -34,13 +38,10 @@ #include "armVIC.h" #include BOARD_CONFIG -// FIXME -// current implementation only works for SPI1 (SSP) - -/** Slave selection functions and macros. - * +/** @name Slave selection + * Slave selection functions and macros. */ - +///@{ #define SPI_SELECT_SLAVE_IO__(port, reg) IO ## port ## reg #define SPI_SELECT_SLAVE_IO_(port, reg) SPI_SELECT_SLAVE_IO__(port, reg) @@ -85,10 +86,12 @@ __attribute__ ((always_inline)) static inline void SpiSlaveUnselect(uint8_t slav break; } } +///@} -/** Spi clock polarity and phase functions +/** @name SPI clock + * Spi clock polarity and phase functions. */ - +///@{ __attribute__ ((always_inline)) static inline void SpiSetCPOL(struct spi_periph* p) { SetBit(((sspRegs_t *)(p->reg_addr))->cr0, CPOL); } @@ -104,10 +107,14 @@ __attribute__ ((always_inline)) static inline void SpiSetCPHA(struct spi_periph* __attribute__ ((always_inline)) static inline void SpiClearCPHA(struct spi_periph* p) { ClearBit(((sspRegs_t *)(p->reg_addr))->cr0, CPHA); } +///@} -/** Spi data size functions + +/** + * Set the SPI data size to 8 or 16bit. + * @param p SPI peripheral to set + * @param dss data size */ - __attribute__ ((always_inline)) static inline void SpiSetDataSize(struct spi_periph* p, enum SPIDataSizeSelect dss) { switch (dss) { default: @@ -120,9 +127,11 @@ __attribute__ ((always_inline)) static inline void SpiSetDataSize(struct spi_per } } -/** Spi control functions - */ +/** @name SPI control + * Spi control functions. + */ +///@{ __attribute__ ((always_inline)) static inline void SpiEnable(struct spi_periph* p) { SetBit(((sspRegs_t *)(p->reg_addr))->cr1, SSE); } @@ -167,6 +176,7 @@ __attribute__ ((always_inline)) static inline void SpiRead(struct spi_periph* p, *c = ((sspRegs_t *)(p->reg_addr))->dr; } + __attribute__ ((always_inline)) static inline void SpiTransmit(struct spi_periph* p, struct spi_transaction* t) { // when all byte are sent, continue until tx_idx reach input_length // needed when input_length is bigger than output_length @@ -344,6 +354,7 @@ __attribute__ ((always_inline)) static inline void SpiSlaveAutomaton(struct spi_ } } +///@} /* SSP (SPI1) pins (UM10120_1.pdf page 76) P0.17 SCK PINSEL1 2 << 2 @@ -397,17 +408,17 @@ void spi0_arch_init(void) { #if USE_SPI1 /* SSPCR0 settings */ -#define MASTER_SSP_DSS 0x07 << 0 /* data size : 8 bits */ -#define MASTER_SSP_FRF 0x00 << 4 /* frame format : SPI */ -#define MASTER_SSP_CPOL 0x00 << 6 /* clock polarity : SCK idles low */ -#define MASTER_SSP_CPHA 0x00 << 7 /* clock phase : data captured on first clock transition */ -#define MASTER_SSP_SCR 0x0F << 8 /* serial clock rate : divide by 16 */ +#define MASTER_SSP_DSS 0x07 << 0 ///< data size : 8 bits +#define MASTER_SSP_FRF 0x00 << 4 ///< frame format : SPI +#define MASTER_SSP_CPOL 0x00 << 6 ///< clock polarity : SCK idles low +#define MASTER_SSP_CPHA 0x00 << 7 ///< clock phase : data captured on first clock transition +#define MASTER_SSP_SCR 0x0F << 8 ///< serial clock rate : divide by 16 /* SSPCR1 settings */ -#define MASTER_SSP_LBM 0x00 << 0 /* loopback mode : disabled */ -#define MASTER_SSP_SSE 0x00 << 1 /* SSP enable : disabled */ -#define MASTER_SSP_MS 0x00 << 2 /* master slave mode : master */ -#define MASTER_SSP_SOD 0x00 << 3 /* slave output disable : don't care when master */ +#define MASTER_SSP_LBM 0x00 << 0 ///< loopback mode : disabled +#define MASTER_SSP_SSE 0x00 << 1 ///< SSP enable : disabled +#define MASTER_SSP_MS 0x00 << 2 ///< master slave mode : master +#define MASTER_SSP_SOD 0x00 << 3 ///< slave output disable : don't care when master /** Clock prescaler. * SPI clock rate = PCLK / (CPSR*(SCR+1)) @@ -547,7 +558,7 @@ bool_t spi_resume(struct spi_periph* p, uint8_t slave) { return FALSE; } -#endif /** SPI_MASTER */ +#endif /* SPI_MASTER */ /* @@ -630,7 +641,7 @@ void spi1_slave_arch_init(void) { #endif -/* Register one (and only one) transaction to use spi as slave */ +/** Register one (and only one) transaction to use spi as slave */ bool_t spi_slave_register(struct spi_periph* p, struct spi_transaction* t) { if (p->trans_insert_idx >= 1) { diff --git a/sw/airborne/arch/lpc21/mcu_periph/spi_arch.h b/sw/airborne/arch/lpc21/mcu_periph/spi_arch.h index 50750a70f9..278d1d5607 100644 --- a/sw/airborne/arch/lpc21/mcu_periph/spi_arch.h +++ b/sw/airborne/arch/lpc21/mcu_periph/spi_arch.h @@ -22,6 +22,8 @@ /** * @file arch/lpc21/mcu_periph/spi_arch.h + * @ingroup lpc21_arch + * * Handling of SPI hardware for lpc21xx. * for now only SPI1 ( aka SSP ) */ diff --git a/sw/airborne/arch/lpc21/mcu_periph/spi_slave_hs_arch.c b/sw/airborne/arch/lpc21/mcu_periph/spi_slave_hs_arch.c index a1f82b2ede..865c952698 100644 --- a/sw/airborne/arch/lpc21/mcu_periph/spi_slave_hs_arch.c +++ b/sw/airborne/arch/lpc21/mcu_periph/spi_slave_hs_arch.c @@ -19,6 +19,13 @@ * Boston, MA 02111-1307, USA. */ +/** + * @file arch/lpc21/mcu_periph/spi_slave_hs_arch.c + * @ingroup lpc21_arch + * + * Highspeed SPI Slave Interface. + */ + #include "spi_slave_hs_arch.h" #include "mcu_periph/spi.h" diff --git a/sw/airborne/arch/lpc21/mcu_periph/spi_slave_hs_arch.h b/sw/airborne/arch/lpc21/mcu_periph/spi_slave_hs_arch.h index a5a1577ed5..8a57f5563e 100644 --- a/sw/airborne/arch/lpc21/mcu_periph/spi_slave_hs_arch.h +++ b/sw/airborne/arch/lpc21/mcu_periph/spi_slave_hs_arch.h @@ -19,17 +19,18 @@ * Boston, MA 02111-1307, USA. */ +/** + * @file arch/lpc21/mcu_periph/spi_slave_hs_arch.h + * @ingroup lpc21_arch + * + * Highspeed SPI Slave Interface. + * SS on P0.20 + * Circular Buffer + */ + #ifndef SPI_SLAVE_HS_ARCH_H #define SPI_SLAVE_HS_ARCH_H -/* - - Highspeed SPI Slave Interface - SS on P0.20 - Circular Buffer - -*/ - #include "std.h" diff --git a/sw/airborne/arch/lpc21/mcu_periph/sys_time_arch.c b/sw/airborne/arch/lpc21/mcu_periph/sys_time_arch.c index 1c41a460a3..e2424f4498 100644 --- a/sw/airborne/arch/lpc21/mcu_periph/sys_time_arch.c +++ b/sw/airborne/arch/lpc21/mcu_periph/sys_time_arch.c @@ -22,8 +22,9 @@ /** * @file arch/lpc21/mcu_periph/sys_time_arch.c - * @brief LPC21xx timing functions. + * @ingroup lpc21_arch * + * LPC21xx timing functions. */ #include "mcu_periph/sys_time.h" diff --git a/sw/airborne/arch/lpc21/mcu_periph/sys_time_arch.h b/sw/airborne/arch/lpc21/mcu_periph/sys_time_arch.h index d24777df39..f2a64fcd91 100644 --- a/sw/airborne/arch/lpc21/mcu_periph/sys_time_arch.h +++ b/sw/airborne/arch/lpc21/mcu_periph/sys_time_arch.h @@ -23,8 +23,9 @@ /** * @file arch/lpc21/mcu_periph/sys_time_arch.h - * @brief LPC21xx timing functions. + * @ingroup lpc21_arch * + * LPC21xx timing functions. */ #ifndef SYS_TIME_ARCH_H diff --git a/sw/airborne/arch/lpc21/mcu_periph/uart_arch.c b/sw/airborne/arch/lpc21/mcu_periph/uart_arch.c index 4b36f1c8a5..f1d7b5e89c 100644 --- a/sw/airborne/arch/lpc21/mcu_periph/uart_arch.c +++ b/sw/airborne/arch/lpc21/mcu_periph/uart_arch.c @@ -20,10 +20,14 @@ * */ -/* - * Brief LPC21 uart code +/** + * @file arch/lpc21/mcu_periph/uart_arch.c + * @ingroup lpc21_arch + * + * Handling of UART hardware for lpc21xx. */ + #include "mcu_periph/uart.h" #include "armVIC.h" diff --git a/sw/airborne/arch/lpc21/mcu_periph/uart_arch.h b/sw/airborne/arch/lpc21/mcu_periph/uart_arch.h index 3cf7c4fcba..c4ae2e4804 100644 --- a/sw/airborne/arch/lpc21/mcu_periph/uart_arch.h +++ b/sw/airborne/arch/lpc21/mcu_periph/uart_arch.h @@ -20,6 +20,13 @@ * */ +/** + * @file arch/lpc21/mcu_periph/uart_arch.h + * @ingroup lpc21_arch + * + * Handling of UART hardware for lpc21xx. + */ + #ifndef LPC21_UART_ARCH_H #define LPC21_UART_ARCH_H diff --git a/sw/airborne/arch/lpc21/subsystems/actuators/servos_ppm_hw.c b/sw/airborne/arch/lpc21/subsystems/actuators/servos_ppm_hw.c index 599d02b7fa..3a2d444ce9 100644 --- a/sw/airborne/arch/lpc21/subsystems/actuators/servos_ppm_hw.c +++ b/sw/airborne/arch/lpc21/subsystems/actuators/servos_ppm_hw.c @@ -19,11 +19,15 @@ * Boston, MA 02111-1307, USA. * */ -/** \file servos_ppm_out.c - * \Efficient driving of MAT0.1 (SERVO_CLOCK_PIN) using TIMER0 to produce PPM - * \ for a R/C receiver which has a microcontroller to drive the servos - * \(not a 4015 or 4017 decade counter chip). + +/** + * @file arch/lpc21/subsystems/actuators/servos_ppm_hw.c + * + * Efficient driving of MAT0.1 (SERVO_CLOCK_PIN) using TIMER0 to produce PPM + * for a R/C receiver which has a microcontroller to drive the servos + * (not a 4015 or 4017 decade counter chip). */ + #include "subsystems/actuators.h" #include "paparazzi.h" #include "generated/airframe.h" diff --git a/sw/airborne/arch/lpc21/subsystems/actuators/servos_ppm_hw.h b/sw/airborne/arch/lpc21/subsystems/actuators/servos_ppm_hw.h index 78eaa90ab1..d7a41316b5 100644 --- a/sw/airborne/arch/lpc21/subsystems/actuators/servos_ppm_hw.h +++ b/sw/airborne/arch/lpc21/subsystems/actuators/servos_ppm_hw.h @@ -19,11 +19,15 @@ * Boston, MA 02111-1307, USA. * */ -/** \file servos_ppm_out.h - * \Efficient driving of the MAT0.1 pin (SERVO_CLOCK_PIN) using TIMER0 to produce - * \PPM for a R/C receiver which has a microcontroller to drive the servos - * \(not a 4015 or 4017 decade counter chip). + +/** + * @file arch/lpc21/subsystems/actuators/servos_ppm_hw.h + * + * Efficient driving of MAT0.1 (SERVO_CLOCK_PIN) using TIMER0 to produce PPM + * for a R/C receiver which has a microcontroller to drive the servos + * (not a 4015 or 4017 decade counter chip). */ + #ifndef SERVOS_PPM_HW_H #define SERVOS_PPM_HW_H diff --git a/sw/airborne/arch/sim/mcu_periph/adc_arch.c b/sw/airborne/arch/sim/mcu_periph/adc_arch.c index 0a21926066..21108582a1 100644 --- a/sw/airborne/arch/sim/mcu_periph/adc_arch.c +++ b/sw/airborne/arch/sim/mcu_periph/adc_arch.c @@ -1,3 +1,29 @@ +/* + * Copyright (C) 2012 The Paparazzi Team + * + * 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. + */ + +/** + * @file arch/sim/mcu_periph/adc_arch.c + * Dummy functions for handling of ADC hardware in sim. + */ + #include "mcu_periph/adc.h" void adc_buf_channel(uint8_t adc_channel __attribute__ ((unused)), diff --git a/sw/airborne/arch/sim/mcu_periph/adc_arch.h b/sw/airborne/arch/sim/mcu_periph/adc_arch.h index ec8b67e644..813e13b326 100644 --- a/sw/airborne/arch/sim/mcu_periph/adc_arch.h +++ b/sw/airborne/arch/sim/mcu_periph/adc_arch.h @@ -1,8 +1,34 @@ -#ifndef ADC_HW_H -#define ADC_HW_H +/* + * Copyright (C) 2012 The Paparazzi Team + * + * 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. + */ + +/** + * @file arch/sim/mcu_periph/adc_arch.h + * Dummy header for handling of ADC hardware in sim. + */ + +#ifndef ADC_ARCH_H +#define ADC_ARCH_H /* Dummy definitions */ #define AdcBank1(x) x #define AdcBank0(x) x -#endif /* ADC_HW_H */ +#endif /* ADC_ARCH_H */ diff --git a/sw/airborne/arch/sim/mcu_periph/i2c_arch.c b/sw/airborne/arch/sim/mcu_periph/i2c_arch.c index 0145ff112a..b76342acab 100644 --- a/sw/airborne/arch/sim/mcu_periph/i2c_arch.c +++ b/sw/airborne/arch/sim/mcu_periph/i2c_arch.c @@ -1,3 +1,29 @@ +/* + * Copyright (C) 2012 The Paparazzi Team + * + * 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. + */ + +/** + * @file arch/sim/mcu_periph/i2c_arch.c + * Dummy functions for handling of I2C hardware in sim. + */ + #include "mcu_periph/i2c.h" diff --git a/sw/airborne/arch/sim/mcu_periph/i2c_arch.h b/sw/airborne/arch/sim/mcu_periph/i2c_arch.h index 03e1a07ec7..394e714363 100644 --- a/sw/airborne/arch/sim/mcu_periph/i2c_arch.h +++ b/sw/airborne/arch/sim/mcu_periph/i2c_arch.h @@ -1,3 +1,30 @@ +/* + * Copyright (C) 2012 The Paparazzi Team + * + * 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. + */ + +/** + * @file arch/sim/mcu_periph/i2c_arch.h + * Dummy header for handling of I2C hardware in sim. + */ + + #ifndef SIM_MCU_PERIPH_I2C_ARCH_H #define SIM_MCU_PERIPH_I2C_ARCH_H diff --git a/sw/airborne/arch/sim/mcu_periph/spi_arch.c b/sw/airborne/arch/sim/mcu_periph/spi_arch.c index 606116122c..ac32e542b4 100644 --- a/sw/airborne/arch/sim/mcu_periph/spi_arch.c +++ b/sw/airborne/arch/sim/mcu_periph/spi_arch.c @@ -19,6 +19,11 @@ * Boston, MA 02111-1307, USA. */ +/** + * @file arch/sim/mcu_periph/spi_arch.c + * Dummy functions for handling of SPI hardware in sim. + */ + #include "mcu_periph/spi.h" diff --git a/sw/airborne/arch/sim/mcu_periph/spi_arch.h b/sw/airborne/arch/sim/mcu_periph/spi_arch.h index 1239421482..6027432b4d 100644 --- a/sw/airborne/arch/sim/mcu_periph/spi_arch.h +++ b/sw/airborne/arch/sim/mcu_periph/spi_arch.h @@ -19,7 +19,9 @@ * Boston, MA 02111-1307, USA. */ -/** Dummy functions for handling of SPI hardware in sim. +/** + * @file arch/sim/mcu_periph/spi_arch.h + * Dummy header for handling of SPI hardware in sim. */ #ifndef SPI_ARCH_H diff --git a/sw/airborne/arch/sim/mcu_periph/sys_time_arch.c b/sw/airborne/arch/sim/mcu_periph/sys_time_arch.c index 83ccbdfe27..3f3f152915 100644 --- a/sw/airborne/arch/sim/mcu_periph/sys_time_arch.c +++ b/sw/airborne/arch/sim/mcu_periph/sys_time_arch.c @@ -20,6 +20,11 @@ * Boston, MA 02111-1307, USA. */ +/** + * @file arch/sim/mcu_periph/sys_time_arch.c + * Handling of sys_time in sim. + */ + #include "mcu_periph/sys_time.h" diff --git a/sw/airborne/arch/sim/mcu_periph/sys_time_arch.h b/sw/airborne/arch/sim/mcu_periph/sys_time_arch.h index da431f45bb..74e8e5693e 100644 --- a/sw/airborne/arch/sim/mcu_periph/sys_time_arch.h +++ b/sw/airborne/arch/sim/mcu_periph/sys_time_arch.h @@ -22,7 +22,7 @@ */ /** @file arch/sim/mcu_periph/sys_time_arch.h - * Simulator timing functions + * Simulator timing functions. */ #ifndef SYS_TIME_ARCH_H diff --git a/sw/airborne/arch/sim/mcu_periph/uart_arch.h b/sw/airborne/arch/sim/mcu_periph/uart_arch.h index b1bcd0a89f..453ff0bf88 100644 --- a/sw/airborne/arch/sim/mcu_periph/uart_arch.h +++ b/sw/airborne/arch/sim/mcu_periph/uart_arch.h @@ -1,3 +1,29 @@ +/* + * Copyright (C) 2012 The Paparazzi Team + * + * 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. + */ + +/** + * @file arch/sim/mcu_periph/uart_arch.h + * Dummy header for handling of UART hardware in sim. + */ + #include #include #include diff --git a/sw/airborne/arch/stm32/interrupt_hw.h b/sw/airborne/arch/stm32/interrupt_hw.h index 834f093a10..3181877c32 100644 --- a/sw/airborne/arch/stm32/interrupt_hw.h +++ b/sw/airborne/arch/stm32/interrupt_hw.h @@ -19,9 +19,13 @@ * Boston, MA 02111-1307, USA. * */ -/** \file interrupt_hw.h - * \brief STM32 Low level interrupt handling - * Empty for now, just to match what we have on LPC + +/** + * @file arch/stm32/interrupt_hw.h + * @ingroup stm32_arch + * + * STM32 Low level interrupt handling. + * Empty for now, just to match what we have on LPC */ #ifndef INTERRUPT_HW_H diff --git a/sw/airborne/arch/stm32/mcu_arch.c b/sw/airborne/arch/stm32/mcu_arch.c index e59f2cb077..d00f586598 100644 --- a/sw/airborne/arch/stm32/mcu_arch.c +++ b/sw/airborne/arch/stm32/mcu_arch.c @@ -1,7 +1,5 @@ /* - * Paparazzi stm32 arch dependant microcontroller initialisation function - * - * Copyright (C) 2010 The Paparazzi team + * Copyright (C) 2010-2012 The Paparazzi team * * This file is part of Paparazzi. * @@ -22,6 +20,12 @@ * */ +/** + * @file arch/stm32/mcu_arch.c + * @brief stm32 arch dependant microcontroller initialisation functions. + * @ingroup stm32_arch + */ + #include "mcu.h" #include BOARD_CONFIG diff --git a/sw/airborne/arch/stm32/mcu_arch.h b/sw/airborne/arch/stm32/mcu_arch.h index b8110a16cc..ac710be691 100644 --- a/sw/airborne/arch/stm32/mcu_arch.h +++ b/sw/airborne/arch/stm32/mcu_arch.h @@ -1,7 +1,5 @@ /* - * Paparazzi stm32 arch dependant microcontroller initialisation function - * - * Copyright (C) 2010 The Paparazzi team + * Copyright (C) 2010-2012 The Paparazzi team * * This file is part of Paparazzi. * @@ -22,6 +20,13 @@ * */ +/** + * @file arch/stm32/mcu_arch.h + * @brief stm32 arch dependant microcontroller initialisation functions. + * @defgroup stm32_arch STM32 architecture + * @ingroup stm32_arch + */ + #ifndef STM32_MCU_ARCH_H #define STM32_MCU_ARCH_H diff --git a/sw/airborne/arch/stm32/mcu_periph/adc_arch.c b/sw/airborne/arch/stm32/mcu_periph/adc_arch.c index 1af5b12f20..816b6e1d0d 100644 --- a/sw/airborne/arch/stm32/mcu_periph/adc_arch.c +++ b/sw/airborne/arch/stm32/mcu_periph/adc_arch.c @@ -1,6 +1,5 @@ /* - * - * Copyright (C) 2010 The Paparazzi Team + * Copyright (C) 2010-2012 The Paparazzi Team * * This file is part of paparazzi. * @@ -22,9 +21,10 @@ */ /** + * @file arch/stm32/mcu_periph/adc_arch.c + * @ingroup stm32_arch * - * This is the driver for the analog to digital converters - * on STM32 + * Driver for the analog to digital converters on STM32. * * Usage: * Define flags for ADCs to use and their channels: diff --git a/sw/airborne/arch/stm32/mcu_periph/adc_arch.h b/sw/airborne/arch/stm32/mcu_periph/adc_arch.h index 284c9935cb..6e5782053b 100644 --- a/sw/airborne/arch/stm32/mcu_periph/adc_arch.h +++ b/sw/airborne/arch/stm32/mcu_periph/adc_arch.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Paparazzi team + * Copyright (C) 2010-2012 Paparazzi team * * This file is part of Paparazzi. * @@ -20,8 +20,15 @@ * */ -#ifndef ADC_HW_H -#define ADC_HW_H +/** + * @file arch/stm32/mcu_periph/adc_arch.h + * @ingroup stm32_arch + * + * Driver for the analog to digital converters on STM32. + */ + +#ifndef ADC_ARCH_H +#define ADC_ARCH_H /* * Architecture dependant ADC functions for STM32 @@ -81,4 +88,4 @@ enum adc2_channels { #define AdcBank0(x) (x) #define AdcBank1(x) (x+NB_ADC) -#endif /* ADC_HW_H */ +#endif /* ADC_ARCH_H */ diff --git a/sw/airborne/arch/stm32/mcu_periph/can_arch.c b/sw/airborne/arch/stm32/mcu_periph/can_arch.c index 9d41ce3a0e..2cc3afd0b3 100644 --- a/sw/airborne/arch/stm32/mcu_periph/can_arch.c +++ b/sw/airborne/arch/stm32/mcu_periph/can_arch.c @@ -20,6 +20,13 @@ * */ +/** + * @file arch/stm32/mcu_periph/can_arch.c + * @ingroup stm32_arch + * + * Handling of CAN hardware for STM32. + */ + #include #include diff --git a/sw/airborne/arch/stm32/mcu_periph/can_arch.h b/sw/airborne/arch/stm32/mcu_periph/can_arch.h index 8d97bea9d1..f6a902c379 100644 --- a/sw/airborne/arch/stm32/mcu_periph/can_arch.h +++ b/sw/airborne/arch/stm32/mcu_periph/can_arch.h @@ -20,6 +20,13 @@ * */ +/** + * @file arch/stm32/mcu_periph/can_arch.h + * @ingroup stm32_arch + * + * Handling of CAN hardware for STM32. + */ + #ifndef MCU_PERIPH_STM32_CAN_ARCH_H #define MCU_PERIPH_STM32_CAN_ARCH_H diff --git a/sw/airborne/arch/stm32/mcu_periph/gpio_arch.h b/sw/airborne/arch/stm32/mcu_periph/gpio_arch.h index 44910f8bdc..c2dc9d4060 100644 --- a/sw/airborne/arch/stm32/mcu_periph/gpio_arch.h +++ b/sw/airborne/arch/stm32/mcu_periph/gpio_arch.h @@ -1,3 +1,32 @@ +/* + * Copyright (C) 2012 Piotr Esden-Tempski + * + * 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. + * + */ + +/** + * @file arch/stm32/mcu_periph/gpio_arch.h + * @ingroup stm32_arch + * + * Handling of GPIOs for STM32. + */ + #ifndef MY_GPIO_ARCH_H #define MY_GPIO_ARCH_H diff --git a/sw/airborne/arch/stm32/mcu_periph/i2c_arch.c b/sw/airborne/arch/stm32/mcu_periph/i2c_arch.c index 9a96ea6038..363645184f 100644 --- a/sw/airborne/arch/stm32/mcu_periph/i2c_arch.c +++ b/sw/airborne/arch/stm32/mcu_periph/i2c_arch.c @@ -1,3 +1,31 @@ +/* + * Copyright (C) 2009-2012 The Paparazzi Team + * + * 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. + * + */ + +/** + * @file arch/stm32/mcu_periph/i2c_arch.c + * @ingroup stm32_arch + * Handling of I2C hardware for STM32. + */ + #include "mcu_periph/i2c.h" #include diff --git a/sw/airborne/arch/stm32/mcu_periph/i2c_arch.h b/sw/airborne/arch/stm32/mcu_periph/i2c_arch.h index 053296f93a..c62a718944 100644 --- a/sw/airborne/arch/stm32/mcu_periph/i2c_arch.h +++ b/sw/airborne/arch/stm32/mcu_periph/i2c_arch.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Antoine Drouin + * Copyright (C) 2009-2012 The Paparazzi Team * * This file is part of paparazzi. * @@ -19,8 +19,11 @@ * Boston, MA 02111-1307, USA. */ -/* - * Hardware level I2C handling +/** + * @file arch/stm32/mcu_periph/i2c_arch.h + * @ingroup stm32_arch + * + * Hardware level I2C handling for the STM32. */ #ifndef I2C_HW_H diff --git a/sw/airborne/arch/stm32/mcu_periph/spi_arch.c b/sw/airborne/arch/stm32/mcu_periph/spi_arch.c index d415febabb..c925d1e71d 100644 --- a/sw/airborne/arch/stm32/mcu_periph/spi_arch.c +++ b/sw/airborne/arch/stm32/mcu_periph/spi_arch.c @@ -22,6 +22,7 @@ /** * @file arch/stm32/mcu_periph/spi_arch.c + * @ingroup stm32_arch * * Handling of SPI hardware for STM32. * SPI Master code. @@ -55,8 +56,10 @@ static void spi_rw(struct spi_periph* p, struct spi_transaction * _trans); static void process_rx_dma_interrupt( struct spi_periph *spi ); static void process_tx_dma_interrupt( struct spi_periph *spi ); -// This structure keeps track of specific ID's for each SPI bus, -// which allows for more code reuse. +/** + * This structure keeps track of specific ID's for each SPI bus, + * which allows for more code reuse. + */ struct spi_periph_dma { u32 spi; u32 spidr; @@ -181,18 +184,18 @@ static inline void SpiSlaveSelect(uint8_t slave) } } +/// Enable DMA rx channel interrupt static void spi_arch_int_enable( struct spi_periph *spi ) { - // Enable DMA rx channel interrupt nvic_set_priority( ((struct spi_periph_dma *)spi->init_struct)->nvic_irq, 0); nvic_enable_irq( ((struct spi_periph_dma *)spi->init_struct)->nvic_irq ); } +/// Disable DMA rx channel interrupt static void spi_arch_int_disable( struct spi_periph *spi ) { - // Disable DMA rx channel interrupt nvic_disable_irq( ((struct spi_periph_dma *)spi->init_struct)->nvic_irq ); } -/** +/* * These functions map the publically available "spi" structures to * specific pins on this processor */ @@ -633,7 +636,7 @@ bool_t spi_resume(struct spi_periph* p, uint8_t slave) { #ifdef USE_SPI1 -// receive transferred over DMA +/// receive transferred over DMA void dma1_channel2_isr(void) { struct spi_transaction *trans = spi1.trans[spi1.trans_extract_idx]; @@ -652,7 +655,7 @@ void dma1_channel2_isr(void) process_rx_dma_interrupt( &spi1 ); } -// transmit transferred over DMA +/// transmit transferred over DMA void dma1_channel3_isr(void) { struct spi_transaction *trans = spi1.trans[spi1.trans_extract_idx]; @@ -676,7 +679,7 @@ void dma1_channel3_isr(void) #endif #ifdef USE_SPI2 -// receive transferred over DMA +/// receive transferred over DMA void dma1_channel4_isr(void) { struct spi_transaction *trans = spi2.trans[spi2.trans_extract_idx]; @@ -695,7 +698,7 @@ void dma1_channel4_isr(void) process_rx_dma_interrupt( &spi2 ); } -// transmit transferred over DMA +/// transmit transferred over DMA void dma1_channel5_isr(void) { struct spi_transaction *trans = spi2.trans[spi2.trans_extract_idx]; @@ -718,7 +721,7 @@ void dma1_channel5_isr(void) #endif #if USE_SPI0 -// receive transferred over DMA +/// receive transferred over DMA void dma2_channel1_isr(void) { struct spi_transaction *trans = spi0.trans[spi0.trans_extract_idx]; @@ -737,7 +740,7 @@ void dma2_channel1_isr(void) process_rx_dma_interrupt( &spi0 ); } -// transmit transferred over DMA +/// transmit transferred over DMA void dma2_channel2_isr(void) { struct spi_transaction *trans = spi0.trans[spi0.trans_extract_idx]; @@ -760,7 +763,7 @@ void dma2_channel2_isr(void) #endif -// Processing done after rx completes. +/// Processing done after rx completes. void process_rx_dma_interrupt( struct spi_periph *spi ) { struct spi_periph_dma *dma = spi->init_struct; struct spi_transaction *trans = spi->trans[spi->trans_extract_idx]; @@ -789,7 +792,7 @@ void process_rx_dma_interrupt( struct spi_periph *spi ) { spi_rw(spi, spi->trans[spi->trans_extract_idx]); } -// Processing done after tx completes +/// Processing done after tx completes void process_tx_dma_interrupt( struct spi_periph *spi ) { struct spi_periph_dma *dma = spi->init_struct; struct spi_transaction *trans = spi->trans[spi->trans_extract_idx]; diff --git a/sw/airborne/arch/stm32/mcu_periph/spi_arch.h b/sw/airborne/arch/stm32/mcu_periph/spi_arch.h index b449287e29..11b7ba79c7 100644 --- a/sw/airborne/arch/stm32/mcu_periph/spi_arch.h +++ b/sw/airborne/arch/stm32/mcu_periph/spi_arch.h @@ -22,6 +22,8 @@ /** * @file arch/stm32/mcu_periph/spi_arch.h + * @ingroup stm32_arch + * * Handling of SPI hardware for STM32. */ diff --git a/sw/airborne/arch/stm32/mcu_periph/sys_time_arch.c b/sw/airborne/arch/stm32/mcu_periph/sys_time_arch.c index 7b2b35ce40..7799aee488 100644 --- a/sw/airborne/arch/stm32/mcu_periph/sys_time_arch.c +++ b/sw/airborne/arch/stm32/mcu_periph/sys_time_arch.c @@ -1,5 +1,4 @@ /* - * * Copyright (C) 2009-2011 The Paparazzi Team * * This file is part of paparazzi. @@ -22,7 +21,9 @@ /** * @file arch/stm32/mcu_periph/sys_time_arch.c - * @brief STM32 timing functions. + * @ingroup stm32_arch + * + * STM32 timing functions. * */ @@ -34,12 +35,12 @@ #include "led.h" #endif +/** Initialize SysTick. + * Generate SysTick interrupt every SYS_TIME_RESOLUTION_CPU_TICKS + * The timer interrupt is activated on the transition from 1 to 0, + * therefore it activates every n+1 clock ticks. + */ void sys_time_arch_init( void ) { - - /* Generate SysTick interrupt every SYS_TIME_RESOLUTION_CPU_TICKS - * The timer interrupt is activated on the transition from 1 to 0, - * therefore it activates every n+1 clock ticks. - */ systick_set_clocksource(STK_CTRL_CLKSOURCE_AHB); systick_set_reload(SYS_TIME_RESOLUTION_CPU_TICKS-1); diff --git a/sw/airborne/arch/stm32/mcu_periph/sys_time_arch.h b/sw/airborne/arch/stm32/mcu_periph/sys_time_arch.h index 205cb6aeed..e0b4a7779a 100644 --- a/sw/airborne/arch/stm32/mcu_periph/sys_time_arch.h +++ b/sw/airborne/arch/stm32/mcu_periph/sys_time_arch.h @@ -23,7 +23,9 @@ /** * @file arch/stm32/mcu_periph/sys_time_arch.h - * @brief STM32 timing functions. + * @ingroup stm32_arch + * + * STM32 timing functions. * */ @@ -55,8 +57,9 @@ extern void sys_tick_handler(void); #define SysTimeTimerStop(_t) { _t = ( GET_CUR_TIME_USEC() - (_t)); } -/** Busy wait, in microseconds */ -// FIXME: directly use the SysTick->VAL here +/** Busy wait in microseconds. + * FIXME: directly use the SysTick->VAL here + */ static inline void sys_time_usleep(uint32_t us) { uint32_t end = GET_CUR_TIME_USEC() + us; while ((uint32_t)GET_CUR_TIME_USEC() < end); diff --git a/sw/airborne/arch/stm32/mcu_periph/uart_arch.c b/sw/airborne/arch/stm32/mcu_periph/uart_arch.c index d5fb64b391..262f93759d 100644 --- a/sw/airborne/arch/stm32/mcu_periph/uart_arch.c +++ b/sw/airborne/arch/stm32/mcu_periph/uart_arch.c @@ -19,6 +19,13 @@ * Boston, MA 02111-1307, USA. */ +/** + * @file arch/stm32/mcu_periph/uart_arch.c + * @ingroup stm32_arch + * + * Handling of UART hardware for STM32. + */ + #include "mcu_periph/uart.h" #include diff --git a/sw/airborne/arch/stm32/mcu_periph/uart_arch.h b/sw/airborne/arch/stm32/mcu_periph/uart_arch.h index 6278ffbd36..8b1f5210ce 100644 --- a/sw/airborne/arch/stm32/mcu_periph/uart_arch.h +++ b/sw/airborne/arch/stm32/mcu_periph/uart_arch.h @@ -19,9 +19,11 @@ * Boston, MA 02111-1307, USA. */ -/* - *\brief STM32 usart functions +/** + * @file arch/stm32/mcu_periph/uart_arch.h + * @ingroup stm32_arch * + * Handling of UART hardware for STM32. */ #ifndef STM32_UART_ARCH_H diff --git a/sw/airborne/arch/stm32/subsystems/radio_control/ppm_arch.c b/sw/airborne/arch/stm32/subsystems/radio_control/ppm_arch.c index da0e7d20d2..a780a2720c 100644 --- a/sw/airborne/arch/stm32/subsystems/radio_control/ppm_arch.c +++ b/sw/airborne/arch/stm32/subsystems/radio_control/ppm_arch.c @@ -19,6 +19,14 @@ * Boston, MA 02111-1307, USA. */ +/** + * @file arch/stm32/subsystems/radio_control/ppm_arch.c + * @ingroup stm32_arch + * + * STM32 ppm decoder. + * + */ + #include "subsystems/radio_control.h" #include "subsystems/radio_control/ppm.h" diff --git a/sw/airborne/arch/stm32/subsystems/radio_control/ppm_arch.h b/sw/airborne/arch/stm32/subsystems/radio_control/ppm_arch.h index 379aea1f74..2a4812bc77 100644 --- a/sw/airborne/arch/stm32/subsystems/radio_control/ppm_arch.h +++ b/sw/airborne/arch/stm32/subsystems/radio_control/ppm_arch.h @@ -19,8 +19,11 @@ * Boston, MA 02111-1307, USA. */ -/** \file booz_radio_control_ppm_hw.h - * \brief STM32 ppm decoder +/** + * @file arch/stm32/subsystems/radio_control/ppm_arch.h + * @ingroup stm32_arch + * + * STM32 ppm decoder. * */ diff --git a/sw/airborne/firmwares/fixedwing/autopilot.c b/sw/airborne/firmwares/fixedwing/autopilot.c index 347cc80dbf..d99ea82668 100644 --- a/sw/airborne/firmwares/fixedwing/autopilot.c +++ b/sw/airborne/firmwares/fixedwing/autopilot.c @@ -20,8 +20,10 @@ * */ -/** \file autopilot.c - * \brief Autopilot inititalization +/** + * @file firmwares/fixedwing/autopilot.c + * + * Autopilot inititalization. * */ diff --git a/sw/airborne/firmwares/fixedwing/autopilot.h b/sw/airborne/firmwares/fixedwing/autopilot.h index 65c9b3495b..a1c7bcaf46 100644 --- a/sw/airborne/firmwares/fixedwing/autopilot.h +++ b/sw/airborne/firmwares/fixedwing/autopilot.h @@ -20,8 +20,10 @@ * */ -/** \file autopilot.h - * \brief Autopilot modes +/** + * @file firmwares/fixedwing/autopilot.h + * + * Autopilot modes. * */ diff --git a/sw/airborne/firmwares/fixedwing/datalink.c b/sw/airborne/firmwares/fixedwing/datalink.c index 33a4c49a02..4add833c84 100644 --- a/sw/airborne/firmwares/fixedwing/datalink.c +++ b/sw/airborne/firmwares/fixedwing/datalink.c @@ -19,10 +19,13 @@ * Boston, MA 02111-1307, USA. * */ -/** \file datalink.c - * \brief Handling of messages coming from ground and other A/Cs + +/** + * @file firmwares/fixedwing/datalink.c + * Handling of messages coming from ground and other A/Cs. * */ + #define DATALINK_C #define MODULES_DATALINK_C diff --git a/sw/airborne/firmwares/fixedwing/main.c b/sw/airborne/firmwares/fixedwing/main.c index 88c0ba8bd7..9e913382d5 100644 --- a/sw/airborne/firmwares/fixedwing/main.c +++ b/sw/airborne/firmwares/fixedwing/main.c @@ -21,7 +21,7 @@ */ /** - * @file main.c + * @file firmwares/fixedwing/main.c * Main loop used both on single and dual MCU configuration. */ diff --git a/sw/airborne/firmwares/rotorcraft/autopilot.c b/sw/airborne/firmwares/rotorcraft/autopilot.c index fd8b4c7524..6dca82bf66 100644 --- a/sw/airborne/firmwares/rotorcraft/autopilot.c +++ b/sw/airborne/firmwares/rotorcraft/autopilot.c @@ -19,6 +19,13 @@ * Boston, MA 02111-1307, USA. */ +/** + * @file firmwares/rotorcraft/autopilot.c + * + * Autopilot. + * + */ + #include "firmwares/rotorcraft/autopilot.h" #include "subsystems/radio_control.h" diff --git a/sw/airborne/firmwares/rotorcraft/autopilot.h b/sw/airborne/firmwares/rotorcraft/autopilot.h index 9ad782dea9..5323c9188b 100644 --- a/sw/airborne/firmwares/rotorcraft/autopilot.h +++ b/sw/airborne/firmwares/rotorcraft/autopilot.h @@ -19,6 +19,13 @@ * Boston, MA 02111-1307, USA. */ +/** + * @file firmwares/rotorcraft/autopilot.h + * + * Autopilot modes. + * + */ + #ifndef AUTOPILOT_H #define AUTOPILOT_H diff --git a/sw/airborne/firmwares/rotorcraft/autopilot_arming_switch.h b/sw/airborne/firmwares/rotorcraft/autopilot_arming_switch.h index e9250f488c..afc889cc64 100644 --- a/sw/airborne/firmwares/rotorcraft/autopilot_arming_switch.h +++ b/sw/airborne/firmwares/rotorcraft/autopilot_arming_switch.h @@ -19,6 +19,13 @@ * Boston, MA 02111-1307, USA. */ +/** + * @file firmwares/rotorcraft/autopilot_arming_switch.h + * + * Arm the motors using a switch. + * + */ + #ifndef AUTOPILOT_ARMING_SWITCH_H #define AUTOPILOT_ARMING_SWITCH_H diff --git a/sw/airborne/firmwares/rotorcraft/autopilot_arming_throttle.h b/sw/airborne/firmwares/rotorcraft/autopilot_arming_throttle.h index eedfd2d742..f987854b8b 100644 --- a/sw/airborne/firmwares/rotorcraft/autopilot_arming_throttle.h +++ b/sw/airborne/firmwares/rotorcraft/autopilot_arming_throttle.h @@ -19,6 +19,13 @@ * Boston, MA 02111-1307, USA. */ +/** + * @file firmwares/rotorcraft/autopilot_arming_throttle.h + * + * Automatically arm the motors when applying throttle. + * + */ + #ifndef AUTOPILOT_ARMING_THROTTLE_H #define AUTOPILOT_ARMING_THROTTLE_H diff --git a/sw/airborne/firmwares/rotorcraft/autopilot_arming_yaw.h b/sw/airborne/firmwares/rotorcraft/autopilot_arming_yaw.h index bfd47f0a1d..6bd134b534 100644 --- a/sw/airborne/firmwares/rotorcraft/autopilot_arming_yaw.h +++ b/sw/airborne/firmwares/rotorcraft/autopilot_arming_yaw.h @@ -19,6 +19,13 @@ * Boston, MA 02111-1307, USA. */ +/** + * @file firmwares/rotorcraft/autopilot_arming_yaw.h + * + * Arm the motors by with max yaw stick. + * + */ + #ifndef AUTOPILOT_ARMING_YAW_H #define AUTOPILOT_ARMING_YAW_H diff --git a/sw/airborne/firmwares/rotorcraft/autopilot_rc_helpers.h b/sw/airborne/firmwares/rotorcraft/autopilot_rc_helpers.h index fcb99bf910..842a6f3ed7 100644 --- a/sw/airborne/firmwares/rotorcraft/autopilot_rc_helpers.h +++ b/sw/airborne/firmwares/rotorcraft/autopilot_rc_helpers.h @@ -19,6 +19,12 @@ * Boston, MA 02111-1307, USA. */ +/** + * @file firmwares/rotorcraft/autopilot_rc_helpers.h + * + * Some helper functions to check RC sticks. + */ + #ifndef AUTOPILOT_RC_HELPERS_H #define AUTOPILOT_RC_HELPERS_H diff --git a/sw/airborne/firmwares/rotorcraft/datalink.c b/sw/airborne/firmwares/rotorcraft/datalink.c index 66cb341738..0a3e15b476 100644 --- a/sw/airborne/firmwares/rotorcraft/datalink.c +++ b/sw/airborne/firmwares/rotorcraft/datalink.c @@ -19,6 +19,12 @@ * Boston, MA 02111-1307, USA. */ +/** + * @file firmwares/rotorcraft/datalink.c + * Handling of messages coming from ground and other A/Cs. + * + */ + #define DATALINK_C #define MODULES_DATALINK_C diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.c b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.c index 25910134d8..0c2ebc0ac7 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.c +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.c @@ -19,7 +19,7 @@ * Boston, MA 02111-1307, USA. */ -/** @file firmware/rotorcraft/guidance/guidance_h.c +/** @file firmwares/rotorcraft/guidance/guidance_h.c * Horizontal guidance for rotorcrafts. * */ diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.h b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.h index 7bd8bfee43..f24ea8c350 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.h +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.h @@ -19,7 +19,7 @@ * Boston, MA 02111-1307, USA. */ -/** @file firmware/rotorcraft/guidance/guidance_h.h +/** @file firmwares/rotorcraft/guidance/guidance_h.h * Horizontal guidance for rotorcrafts. * */ diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h_ref.h b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h_ref.h index 93d944cf99..e3cfa1fa5c 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h_ref.h +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h_ref.h @@ -19,7 +19,7 @@ * Boston, MA 02111-1307, USA. */ -/** @file firmware/rotorcraft/guidance/guidance_h_ref.h +/** @file firmwares/rotorcraft/guidance/guidance_h_ref.h * Reference generation for horizontal guidance. * */ diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v_adpt.h b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v_adpt.h index 788fd8c535..e2207ef84f 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v_adpt.h +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v_adpt.h @@ -19,7 +19,7 @@ * Boston, MA 02111-1307, USA. */ -/** @file guidance_v_adapt.h +/** @file firmwares/rotorcraft/guidance/guidance_v_adpt.h * Adaptation bloc of the vertical guidance. * * This is a dimension one kalman filter estimating diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v_ref.h b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v_ref.h index 695d6f1a23..6a19764159 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v_ref.h +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v_ref.h @@ -19,7 +19,7 @@ * Boston, MA 02111-1307, USA. */ -/** @file firwmares/rotorcraft/guidance/guidance_v_ref.h +/** @file firmwares/rotorcraft/guidance/guidance_v_ref.h * Reference generation for vertical guidance. * */ diff --git a/sw/airborne/firmwares/rotorcraft/main.c b/sw/airborne/firmwares/rotorcraft/main.c index 615c96a106..60bffe7cbd 100644 --- a/sw/airborne/firmwares/rotorcraft/main.c +++ b/sw/airborne/firmwares/rotorcraft/main.c @@ -20,6 +20,12 @@ * */ +/** + * @file firmwares/rotorcraft/main.c + * + * Rotorcraft main loop. + */ + #define MODULES_C #include diff --git a/sw/airborne/firmwares/rotorcraft/main.h b/sw/airborne/firmwares/rotorcraft/main.h index 0fefceb904..7f5486c615 100644 --- a/sw/airborne/firmwares/rotorcraft/main.h +++ b/sw/airborne/firmwares/rotorcraft/main.h @@ -19,6 +19,12 @@ * Boston, MA 02111-1307, USA. */ +/** + * @file firmwares/rotorcraft/main.h + * + * Rotorcraft main loop. + */ + #ifndef MAIN_H #define MAIN_H diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_float.c b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_float.c index a7be2e6bd3..b8e0b41330 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_float.c +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_float.c @@ -19,8 +19,11 @@ * Boston, MA 02111-1307, USA. */ -/** \file stabilization_attitude_ref_float.c - * \brief Booz attitude reference generation (quaternion float version) +/** + * @file firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_float.c + * + * Rotorcraft attitude reference generation. + * (quaternion float version) * */ diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_float.h b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_float.h index 5243d007ac..f4df2351d1 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_float.h +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_float.h @@ -18,6 +18,15 @@ * the Free Software Foundation, 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ + +/** + * @file firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_float.h + * + * Rotorcraft attitude reference generation. + * (quaternion float version) + * + */ + #ifndef STABILIZATION_ATTITUDE_FLOAT_REF_QUAT_FLOAT_H #define STABILIZATION_ATTITUDE_FLOAT_REF_QUAT_FLOAT_H diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_int.c b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_int.c index bbb7aa7876..e948896ffe 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_int.c +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_int.c @@ -19,8 +19,11 @@ * Boston, MA 02111-1307, USA. */ -/** @file stabilization_attitude_ref_int.c - * Rotorcraft attitude reference generation (quaternion int version) +/** + * @file firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_int.c + * + * Rotorcraft attitude reference generation. + * (quaternion int version) * */ diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_int.h b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_int.h index 34d4c44f8f..a99a8044b9 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_int.h +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_int.h @@ -18,6 +18,15 @@ * the Free Software Foundation, 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ + +/** + * @file firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_int.h + * + * Rotorcraft attitude reference generation. + * (quaternion int version) + * + */ + #ifndef STABILIZATION_ATTITUDE_INT_REF_QUAT_INT_H #define STABILIZATION_ATTITUDE_INT_REF_QUAT_INT_H diff --git a/sw/airborne/math/pprz_orientation_conversion.c b/sw/airborne/math/pprz_orientation_conversion.c index f072901b51..4d63d8903a 100644 --- a/sw/airborne/math/pprz_orientation_conversion.c +++ b/sw/airborne/math/pprz_orientation_conversion.c @@ -20,7 +20,7 @@ */ /** - * @file pprz_orientation_conversion.h + * @file math/pprz_orientation_conversion.h * * Generic orientation representation and conversion. * diff --git a/sw/airborne/math/pprz_orientation_conversion.h b/sw/airborne/math/pprz_orientation_conversion.h index 18677a1737..40c4c63ada 100644 --- a/sw/airborne/math/pprz_orientation_conversion.h +++ b/sw/airborne/math/pprz_orientation_conversion.h @@ -20,7 +20,7 @@ */ /** - * @file pprz_orienation_conversion.h + * @file math/pprz_orienation_conversion.h * Generic orientation representation and conversions. * * This file contains the functions to automatically convert between diff --git a/sw/airborne/mcu.c b/sw/airborne/mcu.c index 540f753c46..7c53ff9641 100644 --- a/sw/airborne/mcu.c +++ b/sw/airborne/mcu.c @@ -1,7 +1,5 @@ /* - * Paparazzi microcontroller initialisation function - * - * Copyright (C) 2010 The Paparazzi team + * Copyright (C) 2010-2012 The Paparazzi team * * This file is part of Paparazzi. * @@ -22,6 +20,11 @@ * */ +/** + * @file mcu.c + * @brief Arch independent mcu ( Micro Controller Unit ) utilities. + */ + #include "mcu.h" #ifdef PERIPHERALS_AUTO_INIT diff --git a/sw/airborne/mcu.h b/sw/airborne/mcu.h index e4fdaf5aee..8c576be29d 100644 --- a/sw/airborne/mcu.h +++ b/sw/airborne/mcu.h @@ -1,7 +1,5 @@ /* - * Paparazzi microcontroller functions - * - * Copyright (C) 2010 The Paparazzi team + * Copyright (C) 2010-2012 The Paparazzi team * * This file is part of Paparazzi. * @@ -22,8 +20,9 @@ * */ -/** \file mcu.h - * \brief arch independent mcu ( Micro Controller Unit ) utilities +/** + * @file mcu.h + * @brief Arch independent mcu ( Micro Controller Unit ) utilities. */ #ifndef MCU_H @@ -32,13 +31,19 @@ #include -/* - * Microcontroller initialisation +/** + * @defgroup mcu_periph MCU Peripherals + * @{ + */ + +/** + * Microcontroller peripherals initialization. * This function is responisble for setting up the microcontroller * after Reset. */ extern void mcu_init(void); +/** @}*/ #endif /* MCU_H */ diff --git a/sw/airborne/mcu_periph/i2c.c b/sw/airborne/mcu_periph/i2c.c index 0249105d36..8bc6368709 100644 --- a/sw/airborne/mcu_periph/i2c.c +++ b/sw/airborne/mcu_periph/i2c.c @@ -1,3 +1,30 @@ +/* + * Copyright (C) 2010-2012 The Paparazzi Team + * + * 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. + * + */ + +/** + * @file mcu_periph/i2c.c + * Architecture independent I2C (Inter-Integrated Circuit Bus) API. + */ + #include "mcu_periph/i2c.h" #ifdef USE_I2C0 @@ -35,7 +62,7 @@ void i2c2_init(void) { #endif /* USE_I2C2 */ -void i2c_init(struct i2c_periph* p) { +void i2c_init(struct i2c_periph* p) { p->trans_insert_idx = 0; p->trans_extract_idx = 0; p->status = I2CIdle; diff --git a/sw/airborne/mcu_periph/i2c.h b/sw/airborne/mcu_periph/i2c.h index b0df164c10..7c03b4f10e 100644 --- a/sw/airborne/mcu_periph/i2c.h +++ b/sw/airborne/mcu_periph/i2c.h @@ -1,3 +1,32 @@ +/* + * Copyright (C) 2010-2012 The Paparazzi Team + * + * 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. + * + */ + +/** + * @file mcu_periph/i2c.h + * Architecture independent I2C (Inter-Integrated Circuit Bus) API. + * + * Also see the @ref i2c "I2C interface" page. + */ + #ifndef MCU_PERIPH_I2C_H #define MCU_PERIPH_I2C_H @@ -5,6 +34,13 @@ #include "mcu_periph/i2c_arch.h" +/** + * @addtogroup mcu_periph + * @{ + * @defgroup i2c I2C Interface + * @{ + */ + enum I2CTransactionType { I2CTransTx, I2CTransRx, @@ -161,5 +197,7 @@ extern void i2c_event(void); i2c_submit(&(_p),&(_t)); \ } +/** @}*/ +/** @}*/ #endif /* I2C_H */ diff --git a/sw/airborne/mcu_periph/spi.c b/sw/airborne/mcu_periph/spi.c index ad6184104d..f3a9c60d6d 100644 --- a/sw/airborne/mcu_periph/spi.c +++ b/sw/airborne/mcu_periph/spi.c @@ -22,6 +22,7 @@ /** * @file mcu_periph/spi.c + * * Architecture independent SPI (Serial Peripheral Interface) API. */ diff --git a/sw/airborne/mcu_periph/spi.h b/sw/airborne/mcu_periph/spi.h index 18f52cdfc0..d1bd51005a 100644 --- a/sw/airborne/mcu_periph/spi.h +++ b/sw/airborne/mcu_periph/spi.h @@ -22,10 +22,12 @@ /** * @file mcu_periph/spi.h + * * Architecture independent SPI (Serial Peripheral Interface) API. + * + * Also see the @ref spi "SPI interface" page. */ - #ifndef SPI_H #define SPI_H @@ -33,6 +35,13 @@ #include "mcu_periph/spi_arch.h" +/** + * @addtogroup mcu_periph + * @{ + * @defgroup spi SPI Interface + * @{ + */ + // FIXME how to use this properly ? enum SPIMode { SPIMaster, @@ -255,7 +264,7 @@ extern bool_t spi_lock(struct spi_periph* p, uint8_t slave); * Only the slave that locks the fifo can unlock it. * @param p spi peripheral to be used * @param slave slave id - * @resume true if correctly unlocked + * @return true if correctly unlocked */ extern bool_t spi_resume(struct spi_periph* p, uint8_t slave); @@ -322,4 +331,7 @@ extern bool_t spi_slave_wait(struct spi_periph* p); #endif /* SPI_SLAVE */ +/** @}*/ +/** @}*/ + #endif /* SPI_H */ diff --git a/sw/airborne/modules/cartography/photogrammetry_calculator.h b/sw/airborne/modules/cartography/photogrammetry_calculator.h index a6db909bdf..36bbf00e0a 100644 --- a/sw/airborne/modules/cartography/photogrammetry_calculator.h +++ b/sw/airborne/modules/cartography/photogrammetry_calculator.h @@ -20,10 +20,11 @@ * */ -/** \file photogrammetry_calculator.h +/** @file modules/cartography/photogrammetry_calculator.h Add to airframe file: +@verbatim
@@ -40,17 +41,18 @@ Add to airframe file: +@endverbatim Add to flightplan or airframe file: - - - --> +@endverbatim Add to flightplan - +@verbatim
#define PHOTOGRAMMETRY_SWEEP_ANGLE 53 // Degrees from the North #define PHOTOGRAMMETRY_OVERLAP 50 // 1-99 Procent @@ -66,7 +68,7 @@ Add to flightplan - +@endverbatim */ diff --git a/sw/airborne/modules/digital_cam/led_cam_ctrl.h b/sw/airborne/modules/digital_cam/led_cam_ctrl.h index 0283e6261c..37eb0a7f17 100644 --- a/sw/airborne/modules/digital_cam/led_cam_ctrl.h +++ b/sw/airborne/modules/digital_cam/led_cam_ctrl.h @@ -21,8 +21,8 @@ */ -/** \file led_cam_ctrl.h - * \brief Digital Camera Control +/** @file modules/digital_cam/led_cam_ctrl.h + * @brief Digital Camera Control * * Provides the control of the shutter and the zoom of a digital camera * through standard binary IOs of the board. @@ -30,13 +30,17 @@ * Configuration: * Since the API of led.h is used, connected pins must be defined as led * numbers (usually in the airframe file): + * @verbatim * * * * + * @endverbatim * Related bank and pin must also be defined: + * @verbatim * * + * @endverbatim * The required initialization (dc_init()) and periodic (4Hz) process * */ diff --git a/sw/airborne/modules/digital_cam/servo_cam_ctrl.h b/sw/airborne/modules/digital_cam/servo_cam_ctrl.h index 9d8da3a922..99caa82862 100644 --- a/sw/airborne/modules/digital_cam/servo_cam_ctrl.h +++ b/sw/airborne/modules/digital_cam/servo_cam_ctrl.h @@ -21,8 +21,8 @@ */ -/** \file servo_cam_ctrl.h - * \brief Digital Camera Control +/** @file modules/digital_cam/servo_cam_ctrl.h + * @brief Digital Camera Control * * Provides the control of the shutter and the zoom of a digital camera * through standard binary IOs of the board. @@ -30,13 +30,17 @@ * Configuration: * Since the API of led.h is used, connected pins must be defined as led * numbers (usually in the airframe file): + * @verbatim * * * * + * @endverbatim * Related bank and pin must also be defined: + * @verbatim * * + * @endverbatim * The required initialization (dc_init()) and periodic (4Hz) process * */ diff --git a/sw/airborne/modules/sensors/baro_board_module.h b/sw/airborne/modules/sensors/baro_board_module.h index 9a81a9fafe..3ea1e5682a 100644 --- a/sw/airborne/modules/sensors/baro_board_module.h +++ b/sw/airborne/modules/sensors/baro_board_module.h @@ -20,7 +20,7 @@ */ /** - * @file baro_board_module.h + * @file modules/sensors/baro_board_module.h * * Wrapper for the board specific barometer. */ @@ -35,7 +35,9 @@ * in your airframe file when configuring baro_board module * ex: * for module baro_ets + * @verbatim * + * @endverbatim */ #ifndef BARO_ABS_EVENT #define BARO_ABS_EVENT NoBaro diff --git a/sw/airborne/subsystems/navigation/OSAMNav.c b/sw/airborne/subsystems/navigation/OSAMNav.c index abf28882d0..404b94a7df 100644 --- a/sw/airborne/subsystems/navigation/OSAMNav.c +++ b/sw/airborne/subsystems/navigation/OSAMNav.c @@ -1,3 +1,29 @@ +/* + * Copyright (C) 2008-2012 The Paparazzi Team + * + * 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. + */ + +/** + * @file subsystems/navigation/OSAMNav.c + * + */ + #include "subsystems/navigation/OSAMNav.h" #include "subsystems/nav.h" @@ -142,13 +168,14 @@ launch the plane. After initialized, the plane will follow a line drawn by the p position of the bungee (given in the arguments). Once the plane crosses the throttle line, which is perpendicular to the line the plane is following, and intersects the position of the bungee (plus or minus a fixed distance (TakeOff_Distance in airframe file) from the bungee just in case the bungee doesn't release directly above the bungee) the prop will come on. The plane will then continue to follow the line until it has reached a specific height (defined in as Takeoff_Height in airframe file) above the bungee waypoint and speed (defined as Takeoff_Speed in the airframe file). - +@verbatim
+@endverbatim */ #ifndef Takeoff_Distance @@ -853,16 +880,16 @@ bool_t VerticalRaster(uint8_t l1, uint8_t l2, float radius, float AltSweep) { } /************** SkidLanding **********************************************/ -/* +/** Landing Routine - +@verbatim
- +@endverbatim */ #ifndef Landing_AFHeight @@ -1159,9 +1186,7 @@ void TranslateAndRotateFromWorld(struct Point2D *p, float Zrot, float transX, fl p->y = -temp*sin(Zrot)+p->y*cos(Zrot); } -/* -Rotates point round z by -Zrot then translates so (0,0) becomes (transX,transY) -*/ +/// Rotates point round z by -Zrot then translates so (0,0) becomes (transX,transY) void RotateAndTranslateToWorld(struct Point2D *p, float Zrot, float transX, float transY) { float temp = p->x; diff --git a/sw/airborne/subsystems/navigation/OSAMNav.h b/sw/airborne/subsystems/navigation/OSAMNav.h index 4cb346a288..c40ae6ccfa 100644 --- a/sw/airborne/subsystems/navigation/OSAMNav.h +++ b/sw/airborne/subsystems/navigation/OSAMNav.h @@ -1,3 +1,29 @@ +/* + * Copyright (C) 2008-2012 The Paparazzi Team + * + * 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. + */ + +/** + * @file subsystems/navigation/OSAMNav.h + * + */ + #ifndef OSAMNav_H #define OSAMNav_H