diff --git a/conf/autopilot/rotorcraft.makefile b/conf/autopilot/rotorcraft.makefile index 58d2468a6e..07274c0b94 100644 --- a/conf/autopilot/rotorcraft.makefile +++ b/conf/autopilot/rotorcraft.makefile @@ -92,7 +92,7 @@ endif # # Telemetry/Datalink # -ap.srcs += $(SRC_ARCH)/uart_hw.c +ap.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c ap.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport ap.CFLAGS += -DDOWNLINK_DEVICE=$(MODEM_PORT) ap.srcs += $(SRC_FIRMWARE)/telemetry.c \ diff --git a/conf/autopilot/subsystems/fixedwing/autopilot.makefile b/conf/autopilot/subsystems/fixedwing/autopilot.makefile index 7bf9f40dc4..ddb5b7a617 100644 --- a/conf/autopilot/subsystems/fixedwing/autopilot.makefile +++ b/conf/autopilot/subsystems/fixedwing/autopilot.makefile @@ -130,7 +130,7 @@ ns_srcs += $(SRC_ARCH)/sys_time_hw.c # UARTS # -ns_srcs += $(SRC_ARCH)/uart_hw.c +ns_srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c # # ANALOG diff --git a/sw/airborne/arch/avr/uart_hw.c b/sw/airborne/arch/avr/mcu_periph/uart_arch.c similarity index 99% rename from sw/airborne/arch/avr/uart_hw.c rename to sw/airborne/arch/avr/mcu_periph/uart_arch.c index b1c8aac337..29ec68e656 100644 --- a/sw/airborne/arch/avr/uart_hw.c +++ b/sw/airborne/arch/avr/mcu_periph/uart_arch.c @@ -26,7 +26,7 @@ * \brief avr uart low level functions * */ -#include "uart.h" +#include "mcu_periph/uart.h" #include "sys_time.h" #define B2400 2400UL diff --git a/sw/airborne/arch/avr/uart_hw.h b/sw/airborne/arch/avr/uart_hw.h deleted file mode 100644 index e8ca0c1af7..0000000000 --- a/sw/airborne/arch/avr/uart_hw.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2005 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 uart_hw.h - * \brief avr uart low level headers - * - */ - -#ifndef UART_HW_H -#define UART_HW_H - -#include -#if (__GNUC__ == 3) -#include -#endif -#include -#include "std.h" - - -/************************************************************************/ -#if defined (__AVR_ATmega8__) - -#define ReceiveUart(cb) \ - SIGNAL( SIG_UART_RECV ) { \ - uint8_t c = UDR; \ - cb(c); \ -} - -#endif /* (__AVR_ATmega8__) */ - - -/************************************************************************/ -#if defined (__AVR_ATmega128__) - -extern uint8_t tx_buf0[256]; /** For debugging purpose */ - -extern void uart0_init_tx(void); -extern void uart0_init_rx(void); -extern void uart1_init(void); - -extern void uart0_transmit(const uint8_t); -extern void uart1_transmit(const uint8_t); - -#define UART0_RX_BUFFER_SIZE 32 // UART0 receive buffer size -#define UART1_RX_BUFFER_SIZE 32 // UART1 receive buffer size -#define UART0_RX_BUFFER_SIZE_MASK 0x1f -#define UART1_RX_BUFFER_SIZE_MASK 0x1f - -#ifdef UART0_RX_BUFFER_SIZE_MASK -#define Uart0RxBufferNext(_x) ((_x+1)&UART0_RX_BUFFER_SIZE_MASK) -#else -#define Uart0RxBufferNext(_x) ((_x+1)%UART0_RX_BUFFER_SIZE) -#endif - -#ifdef UART1_RX_BUFFER_SIZE_MASK -#define Uart1RxBufferNext(_x) ((_x+1)&UART1_RX_BUFFER_SIZE_MASK) -#else -#define Uart1RxBufferNext(_x) ((_x+1)%UART1_RX_BUFFER_SIZE) -#endif - - -extern uint16_t uart0_rx_insert_idx, uart0_rx_extract_idx; -extern uint8_t uart0_rx_buffer[UART0_RX_BUFFER_SIZE]; - -#define Uart0ChAvailable() (uart0_rx_insert_idx != uart0_rx_extract_idx) - -#define Uart0Getch() ({\ - uint8_t ret = uart0_rx_buffer[uart0_rx_extract_idx]; \ - uart0_rx_extract_idx = Uart0RxBufferNext(uart0_rx_extract_idx); \ - ret; \ -}) - - -extern uint16_t uart1_rx_insert_idx, uart1_rx_extract_idx; -extern uint8_t uart1_rx_buffer[UART1_RX_BUFFER_SIZE]; - -#define Uart1ChAvailable() (uart1_rx_insert_idx != uart1_rx_extract_idx) - -#define Uart1Getch() ({\ - uint8_t ret = uart1_rx_buffer[uart1_rx_extract_idx]; \ - uart1_rx_extract_idx = Uart1RxBufferNext(uart1_rx_extract_idx); \ - ret; \ -}) - -#endif /* (__AVR_ATmega128__) */ - -#endif /* UART_HW_H */ diff --git a/sw/airborne/arch/lpc21/uart_hw.c b/sw/airborne/arch/lpc21/mcu_periph/uart_arch.c similarity index 99% rename from sw/airborne/arch/lpc21/uart_hw.c rename to sw/airborne/arch/lpc21/mcu_periph/uart_arch.c index 722dbf411e..55d8df8c52 100644 --- a/sw/airborne/arch/lpc21/uart_hw.c +++ b/sw/airborne/arch/lpc21/mcu_periph/uart_arch.c @@ -1,7 +1,7 @@ /* * $Id$ * - * Copyright (C) 2008 Pascal Brisset, Antoine Drouin + * Copyright (C) 2008-2010 The Paparazzi Team * * This file is part of paparazzi. * @@ -26,7 +26,7 @@ * Brief LPC21 uart code */ -#include "uart.h" +#include "mcu_periph/uart.h" #include "armVIC.h" #ifdef USE_UART0 diff --git a/sw/airborne/arch/lpc21/uart_hw.h b/sw/airborne/arch/lpc21/mcu_periph/uart_arch.h similarity index 97% rename from sw/airborne/arch/lpc21/uart_hw.h rename to sw/airborne/arch/lpc21/mcu_periph/uart_arch.h index 06ac5ff7f0..fbc1c6c991 100644 --- a/sw/airborne/arch/lpc21/uart_hw.h +++ b/sw/airborne/arch/lpc21/mcu_periph/uart_arch.h @@ -22,8 +22,8 @@ * */ -#ifndef UART_HW_H -#define UART_HW_H +#ifndef LPC21_UART_ARCH_H +#define LPC21_UART_ARCH_H #include "types.h" #include "LPC21xx.h" @@ -93,4 +93,4 @@ extern void uart0_init_param( uint16_t baud, uint8_t mode, uint8_t fmode); extern uint8_t uart0_tx_running; extern uint8_t uart1_tx_running; -#endif /* UART_HW_H */ +#endif /* LPC21_UART_ARCH_H */ diff --git a/sw/airborne/arch/lpc21/subsystems/radio_control/spektrum_arch.h b/sw/airborne/arch/lpc21/subsystems/radio_control/spektrum_arch.h index f8ebd1d4e7..616354e976 100644 --- a/sw/airborne/arch/lpc21/subsystems/radio_control/spektrum_arch.h +++ b/sw/airborne/arch/lpc21/subsystems/radio_control/spektrum_arch.h @@ -26,7 +26,7 @@ #define RADIO_CONTROL_SPEKTRUM_ARCH_H #include "std.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include RADIO_CONTROL_SPEKTRUM_MODEL_H diff --git a/sw/airborne/arch/lpc21/usb_tunnel.c b/sw/airborne/arch/lpc21/usb_tunnel.c index 869caeabd3..d5140ddc0f 100644 --- a/sw/airborne/arch/lpc21/usb_tunnel.c +++ b/sw/airborne/arch/lpc21/usb_tunnel.c @@ -31,12 +31,10 @@ */ #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" -#include "interrupt_hw.h" -#include "uart_hw.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "usb_serial.h" /* minimum LED blink on time 10Hz = 100ms */ @@ -46,21 +44,11 @@ int main( void ) { unsigned char inc; unsigned int rx_time=0, tx_time=0; - hw_init(); + mcu_init(); sys_time_init(); led_init(); VCOM_allow_linecoding(1); -#ifdef USE_UART0 - Uart0Init(); -#else -#ifdef USE_UART1 - Uart1Init(); -#else -#error no serial port defined -#endif -#endif - #ifdef USE_USB_SERIAL VCOM_init(); #endif diff --git a/sw/airborne/arch/sim/uart_hw.h b/sw/airborne/arch/sim/uart_hw.h deleted file mode 100644 index b1bcd0a89f..0000000000 --- a/sw/airborne/arch/sim/uart_hw.h +++ /dev/null @@ -1,40 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#define STDINOUT_BUFFER_SIZE 256 -#define FD_STDIN 0 - -extern char stdinout_buffer[STDINOUT_BUFFER_SIZE]; -extern uint8_t stdinout_rx_insert_idx; -extern uint8_t stdinout_rx_extract_idx; - - -static inline bool StdInOutChAvailable(void) { - struct timeval tv; - fd_set fds; - tv.tv_sec = 0; - tv.tv_usec = 0; - FD_ZERO(&fds); - FD_SET(FD_STDIN, &fds); - select(1, &fds, NULL, NULL, &tv); - if (FD_ISSET(FD_STDIN, &fds)) { - char tmp_buf[STDINOUT_BUFFER_SIZE]; - uint8_t n = read(FD_STDIN, tmp_buf, STDINOUT_BUFFER_SIZE); - unsigned int i; - for(i = 0; i < n; i++) { - stdinout_buffer[stdinout_rx_insert_idx] = tmp_buf[i]; - stdinout_rx_insert_idx++; /* Auto overflow */ - } - } - return (stdinout_rx_insert_idx != stdinout_rx_extract_idx); -} - -#define StdInOutTransmit(_char) putchar(_char) -#define StdInOutGetch() ({ \ - assert(stdinout_rx_insert_idx != stdinout_rx_extract_idx); \ - stdinout_buffer[stdinout_rx_extract_idx++]; \ -}) diff --git a/sw/airborne/arch/stm32/uart_hw.c b/sw/airborne/arch/stm32/mcu_periph/uart_arch.c similarity index 99% rename from sw/airborne/arch/stm32/uart_hw.c rename to sw/airborne/arch/stm32/mcu_periph/uart_arch.c index f1c1fd4743..3edce0c1d1 100644 --- a/sw/airborne/arch/stm32/uart_hw.c +++ b/sw/airborne/arch/stm32/mcu_periph/uart_arch.c @@ -21,7 +21,7 @@ * Boston, MA 02111-1307, USA. */ -#include "uart.h" +#include "mcu_periph/uart.h" #include #include @@ -282,9 +282,6 @@ volatile uint16_t uart3_tx_insert_idx, uart3_tx_extract_idx; volatile bool_t uart3_tx_running; uint8_t uart3_tx_buffer[UART3_TX_BUFFER_SIZE]; -#include "led.h" - - void uart3_init( void ) { /* init RCC */ diff --git a/sw/airborne/arch/stm32/uart_hw.h b/sw/airborne/arch/stm32/mcu_periph/uart_arch.h similarity index 97% rename from sw/airborne/arch/stm32/uart_hw.h rename to sw/airborne/arch/stm32/mcu_periph/uart_arch.h index 8679622711..e281700dba 100644 --- a/sw/airborne/arch/stm32/uart_hw.h +++ b/sw/airborne/arch/stm32/mcu_periph/uart_arch.h @@ -1,7 +1,7 @@ /* * $Id$ * - * Copyright (C) 2009 Antoine Drouin + * Copyright (C) 2009-2010 The Paparazzi Team * * This file is part of paparazzi. * @@ -26,8 +26,8 @@ * */ -#ifndef UART_HW_H -#define UART_HW_H +#ifndef STM32_UART_ARCH_H +#define STM32_UART_ARCH_H #include "std.h" @@ -183,4 +183,4 @@ extern uint8_t uart3_tx_buffer[UART3_TX_BUFFER_SIZE]; void uart_init( void ); -#endif /* UART_HW_H */ +#endif /* STM32_UART_ARCH_H */ diff --git a/sw/airborne/arch/stm32/stm32_vector_table.c b/sw/airborne/arch/stm32/stm32_vector_table.c index 40b187d87f..2848301865 100644 --- a/sw/airborne/arch/stm32/stm32_vector_table.c +++ b/sw/airborne/arch/stm32/stm32_vector_table.c @@ -1,7 +1,7 @@ /* * $Id$ * - * Copyright (C) 2010 Antoine Drouin + * Copyright (C) 2010 The Paparazzi Team * * This file is part of Paparazzi. * @@ -35,28 +35,28 @@ #endif #if defined USE_UART1 || OVERRIDE_UART1_IRQ_HANDLER -#include "uart.h" +#include "mcu_periph/uart.h" #define USART1_IRQ_HANDLER usart1_irq_handler #else #define USART1_IRQ_HANDLER null_handler #endif #if defined USE_UART2 || OVERRIDE_UART2_IRQ_HANDLER -#include "uart.h" +#include "mcu_periph/uart.h" #define USART2_IRQ_HANDLER usart2_irq_handler #else #define USART2_IRQ_HANDLER null_handler #endif #if defined USE_UART3 || OVERRIDE_UART3_IRQ_HANDLER -#include "uart.h" +#include "mcu_periph/uart.h" #define USART3_IRQ_HANDLER usart3_irq_handler #else #define USART3_IRQ_HANDLER null_handler #endif #if defined USE_UART5 || OVERRIDE_UART5_IRQ_HANDLER -#include "uart.h" +#include "mcu_periph/uart.h" #define USART5_IRQ_HANDLER usart5_irq_handler #else #define USART5_IRQ_HANDLER null_handler diff --git a/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.c b/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.c index 316122ebe4..91b609b63d 100644 --- a/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.c +++ b/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.c @@ -27,10 +27,9 @@ #include #include #include -#include "uart.h" #include "subsystems/radio_control.h" #include "subsystems/radio_control/spektrum_arch.h" -#include "firmwares/rotorcraft/autopilot.h" +#include "mcu_periph/uart.h" #define SPEKTRUM_CHANNELS_PER_FRAME 7 diff --git a/sw/airborne/booz/arch/sim/booz2_unsimulated_peripherals.c b/sw/airborne/booz/arch/sim/booz2_unsimulated_peripherals.c index 93912efe1d..7ea2315a03 100644 --- a/sw/airborne/booz/arch/sim/booz2_unsimulated_peripherals.c +++ b/sw/airborne/booz/arch/sim/booz2_unsimulated_peripherals.c @@ -21,7 +21,7 @@ * Boston, MA 02111-1307, USA. */ -#include "uart.h" +#include "mcu_periph/uart.h" #include "i2c.h" void uart0_init( void ) {} diff --git a/sw/airborne/booz/booz2_datalink.c b/sw/airborne/booz/booz2_datalink.c index 2fae20a594..adb77a1825 100644 --- a/sw/airborne/booz/booz2_datalink.c +++ b/sw/airborne/booz/booz2_datalink.c @@ -32,7 +32,7 @@ #include "downlink.h" #include "messages.h" #include "dl_protocol.h" -#include "uart.h" +#include "mcu_periph/uart.h" #ifdef BOOZ_FMS_TYPE #include "booz_fms.h" diff --git a/sw/airborne/booz/booz_gps.h b/sw/airborne/booz/booz_gps.h index addeb62043..7d30611baf 100644 --- a/sw/airborne/booz/booz_gps.h +++ b/sw/airborne/booz/booz_gps.h @@ -26,7 +26,7 @@ #include "std.h" #include "math/pprz_geodetic_int.h" -#include "uart.h" +#include "mcu_periph/uart.h" struct Booz_gps_state { struct EcefCoor_i ecef_pos; /* pos ECEF in cm */ diff --git a/sw/airborne/csc/csc_adc.c b/sw/airborne/csc/csc_adc.c index be8f0197cf..2e85db12de 100644 --- a/sw/airborne/csc/csc_adc.c +++ b/sw/airborne/csc/csc_adc.c @@ -1,7 +1,7 @@ #include "csc_adc.h" #include "csc_ap_link.h" #include -#include "uart.h" +#include "mcu_periph/uart.h" #include "print.h" #include "LPC21xx.h" diff --git a/sw/airborne/csc/csc_main.c b/sw/airborne/csc/csc_main.c index 1bae760ee7..90474cd2fc 100644 --- a/sw/airborne/csc/csc_main.c +++ b/sw/airborne/csc/csc_main.c @@ -28,11 +28,11 @@ #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" #include "interrupt_hw.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "csc_telemetry.h" #include "generated/periodic.h" #include "downlink.h" @@ -66,7 +66,7 @@ struct NedCoor_i booz_ins_gps_speed_cm_s_ned; static void csc_main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); led_init(); @@ -100,7 +100,7 @@ static void csc_main_init( void ) { #ifdef USE_CSC_THROTTLE csc_throttle_init(); #endif - int_enable(); + mcu_int_enable(); } diff --git a/sw/airborne/csc/csc_throttle.c b/sw/airborne/csc/csc_throttle.c index 20cbfcb3cf..008a269fe4 100644 --- a/sw/airborne/csc/csc_throttle.c +++ b/sw/airborne/csc/csc_throttle.c @@ -31,7 +31,7 @@ //#include "downlink.h" //#include "messages.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "csc_ap_link.h" //#include "print.h" //#include "com_stats.h" diff --git a/sw/airborne/datalink.c b/sw/airborne/datalink.c index 86aa3b7c62..e505ed096b 100644 --- a/sw/airborne/datalink.c +++ b/sw/airborne/datalink.c @@ -64,7 +64,7 @@ #ifndef DOWNLINK_DEVICE #define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE #endif -#include "uart.h" +#include "mcu_periph/uart.h" #include "downlink.h" #include "ap_downlink.h" diff --git a/sw/airborne/estimator.c b/sw/airborne/estimator.c index 589f558238..787c0e1f4e 100644 --- a/sw/airborne/estimator.c +++ b/sw/airborne/estimator.c @@ -30,7 +30,7 @@ #include #include "estimator.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "ap_downlink.h" #include "gps.h" #include "nav.h" diff --git a/sw/airborne/fbw_downlink.h b/sw/airborne/fbw_downlink.h index d4280f8e4d..aeca720421 100644 --- a/sw/airborne/fbw_downlink.h +++ b/sw/airborne/fbw_downlink.h @@ -42,7 +42,7 @@ #include "commands.h" #include "actuators.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "firmwares/fixedwing/main_fbw.h" #include "subsystems/radio_control.h" #include "inter_mcu.h" diff --git a/sw/airborne/firmwares/fixedwing/main_fbw.c b/sw/airborne/firmwares/fixedwing/main_fbw.c index 92a9e53135..e9ead4b447 100644 --- a/sw/airborne/firmwares/fixedwing/main_fbw.c +++ b/sw/airborne/firmwares/fixedwing/main_fbw.c @@ -37,7 +37,6 @@ #include "mcu.h" #include "led.h" -#include "uart.h" #include "spi.h" #include "adc.h" diff --git a/sw/airborne/firmwares/logger/main_logger.c b/sw/airborne/firmwares/logger/main_logger.c index 8f5adf2df1..69a104dde1 100644 --- a/sw/airborne/firmwares/logger/main_logger.c +++ b/sw/airborne/firmwares/logger/main_logger.c @@ -78,12 +78,10 @@ */ #include "std.h" -#include "init_hw.h" +#include "mcu.h" +#include "mcu_periph/uart.h" #include "sys_time.h" #include "led.h" -#include "interrupt_hw.h" -#include "uart_hw.h" -#include "uart.h" #include "usb_msc_hw.h" @@ -513,17 +511,10 @@ int main(void) } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); led_init(); -#ifdef USE_UART0 - Uart0Init(); -#endif -#ifdef USE_UART1 - Uart1Init(); -#endif - #ifdef USE_MAX11040 max11040_init_ssp(); max11040_init(); diff --git a/sw/airborne/firmwares/motor_bench/main_motor_bench.c b/sw/airborne/firmwares/motor_bench/main_motor_bench.c index 152fc6f1d3..8c45c24e10 100644 --- a/sw/airborne/firmwares/motor_bench/main_motor_bench.c +++ b/sw/airborne/firmwares/motor_bench/main_motor_bench.c @@ -1,9 +1,8 @@ #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" -#include "interrupt_hw.h" #include "mb_tacho.h" #include "mb_servo.h" #include "i2c.h" @@ -13,7 +12,7 @@ #include "mb_scale.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" @@ -42,7 +41,7 @@ int main( void ) { static inline void main_init( void ) { - hw_init(); + mcu_init(); led_init(); sys_time_init(); mb_tacho_init(); @@ -62,7 +61,7 @@ static inline void main_init( void ) { uart0_init(); mb_mode_init(); - int_enable(); + mcu_int_enable(); } static inline void main_periodic_task( void ) { diff --git a/sw/airborne/firmwares/rotorcraft/navigation.c b/sw/airborne/firmwares/rotorcraft/navigation.c index b742b5da7a..463927fe1e 100644 --- a/sw/airborne/firmwares/rotorcraft/navigation.c +++ b/sw/airborne/firmwares/rotorcraft/navigation.c @@ -306,7 +306,7 @@ void nav_periodic_task() { #include "downlink.h" #include "messages.h" -#include "uart.h" +#include "mcu_periph/uart.h" void nav_move_waypoint(uint8_t wp_id, struct EnuCoor_i * new_pos) { if (wp_id < nb_waypoint) { INT32_VECT3_COPY(waypoints[wp_id],(*new_pos)); diff --git a/sw/airborne/firmwares/rotorcraft/telemetry.h b/sw/airborne/firmwares/rotorcraft/telemetry.h index fddcc79b98..f6ea7583b5 100644 --- a/sw/airborne/firmwares/rotorcraft/telemetry.h +++ b/sw/airborne/firmwares/rotorcraft/telemetry.h @@ -26,7 +26,7 @@ #include "std.h" #include "messages.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "downlink.h" diff --git a/sw/airborne/firmwares/setup/setup_actuators.c b/sw/airborne/firmwares/setup/setup_actuators.c index 9c8afa4f32..7404d02b18 100644 --- a/sw/airborne/firmwares/setup/setup_actuators.c +++ b/sw/airborne/firmwares/setup/setup_actuators.c @@ -1,6 +1,5 @@ #include "std.h" -#include "init_hw.h" -#include "interrupt_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" #include "firmwares/fixedwing/actuators.h" @@ -8,7 +7,7 @@ #include "generated/airframe.h" #define DATALINK_C #include "datalink.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "pprz_transport.h" #include "firmwares/fixedwing/main_fbw.h" #include "downlink.h" @@ -48,7 +47,7 @@ void dl_parse_msg( void ) { #define PprzUartInit() Link(Init()) void init_fbw( void ) { - hw_init(); + mcu_init(); sys_time_init(); led_init(); @@ -63,7 +62,7 @@ void init_fbw( void ) { // SetServo(SERVO_GAZ, SERVO_GAZ_MIN); - int_enable(); + mcu_int_enable(); } void periodic_task_fbw(void) { diff --git a/sw/airborne/firmwares/tutorial/main_demo3.c b/sw/airborne/firmwares/tutorial/main_demo3.c index e1b2689e34..29ae419e12 100644 --- a/sw/airborne/firmwares/tutorial/main_demo3.c +++ b/sw/airborne/firmwares/tutorial/main_demo3.c @@ -1,10 +1,9 @@ #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" -#include "interrupt_hw.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "print.h" static inline void main_init( void ); diff --git a/sw/airborne/firmwares/tutorial/main_demo4.c b/sw/airborne/firmwares/tutorial/main_demo4.c index 1eb1e97e85..83352b5faf 100644 --- a/sw/airborne/firmwares/tutorial/main_demo4.c +++ b/sw/airborne/firmwares/tutorial/main_demo4.c @@ -1,9 +1,8 @@ #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" -#include "interrupt_hw.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" @@ -21,11 +20,11 @@ int main( void ) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); led_init(); uart0_init_tx(); - int_enable(); + mcu_int_enable(); } static inline void main_periodic_task( void ) { diff --git a/sw/airborne/firmwares/tutorial/main_demo5.c b/sw/airborne/firmwares/tutorial/main_demo5.c index 138fe63b0d..5cb2b2c430 100644 --- a/sw/airborne/firmwares/tutorial/main_demo5.c +++ b/sw/airborne/firmwares/tutorial/main_demo5.c @@ -1,9 +1,8 @@ #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" -#include "interrupt_hw.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" @@ -25,11 +24,11 @@ int main( void ) { } static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); led_init(); uart0_init_tx(); - int_enable(); + mcu_int_enable(); } static inline void main_periodic_task( void ) { diff --git a/sw/airborne/gps.h b/sw/airborne/gps.h index 06ffadced9..b6c28317b8 100644 --- a/sw/airborne/gps.h +++ b/sw/airborne/gps.h @@ -106,7 +106,7 @@ struct svinfo { extern struct svinfo gps_svinfos[GPS_NB_CHANNELS]; #ifndef SITL -#include "uart.h" +#include "mcu_periph/uart.h" #define __GpsLink(dev, _x) dev##_x #define _GpsLink(dev, _x) __GpsLink(dev, _x) @@ -128,7 +128,7 @@ extern struct svinfo gps_svinfos[GPS_NB_CHANNELS]; #define GpsToggleLed() {} #endif -#if defined(GPS) || defined(USE_GPS_XSENS) || defined(SITL) +#if defined(USE_GPS) || defined(USE_GPS_XSENS) || defined(SITL) # define GpsTimeoutError (cpu_time_sec - last_gps_msg_t > FAILSAFE_DELAY_WITHOUT_GPS) #else # define GpsTimeoutError 1 diff --git a/sw/airborne/gps_nmea.c b/sw/airborne/gps_nmea.c index a8b787551b..fe23a7f33e 100644 --- a/sw/airborne/gps_nmea.c +++ b/sw/airborne/gps_nmea.c @@ -43,9 +43,8 @@ #include "generated/flight_plan.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "gps.h" -//include "gps_ubx.h" #include "nav.h" #include "latlong.h" @@ -98,8 +97,6 @@ void ubxsend_cfg_rst(uint16_t bbr , uint8_t reset_mode) { #ifdef GPS_CONFIGURE /* GPS dynamic configuration */ -#include "uart.h" - void gps_configure_uart ( void ) { //UbxSend_CFG_PRT(0x01, 0x0, 0x0, 0x000008D0, GPS_BAUD, UBX_PROTO_MASK, UBX_PROTO_MASK, 0x0, 0x0); //while (GpsUartRunning) ; /* FIXME */ diff --git a/sw/airborne/gps_ubx.c b/sw/airborne/gps_ubx.c index 5a3a5e4192..f08507db48 100644 --- a/sw/airborne/gps_ubx.c +++ b/sw/airborne/gps_ubx.c @@ -35,10 +35,10 @@ #include //for baudrate #include "fms_serial_port.h" -#endif +#endif /* FMS_PERIODIC_FREQ */ #include "generated/flight_plan.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "gps.h" #include "gps_ubx.h" #include "nav.h" @@ -152,7 +152,6 @@ void gps_init( void ) { #ifdef GPS_CONFIGURE /* GPS dynamic configuration */ -#include "uart.h" #ifndef GPS_PORT_ID #define GPS_PORT_ID GPS_PORT_UART1 diff --git a/sw/airborne/gps_xsens.c b/sw/airborne/gps_xsens.c index 3aae822ad6..077d2353af 100644 --- a/sw/airborne/gps_xsens.c +++ b/sw/airborne/gps_xsens.c @@ -33,7 +33,7 @@ #include "sys_time.h" #include "generated/airframe.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/lisa/lisa_stm_gps_passthrough_main.c b/sw/airborne/lisa/lisa_stm_gps_passthrough_main.c index a8fc59c643..5a115a0c74 100644 --- a/sw/airborne/lisa/lisa_stm_gps_passthrough_main.c +++ b/sw/airborne/lisa/lisa_stm_gps_passthrough_main.c @@ -27,7 +27,7 @@ #include "lisa/lisa_overo_link.h" #include "lisa/lisa_spistream.h" #include "generated/airframe.h" -#include "uart.h" +#include "mcu_periph/uart.h" static inline void main_init(void); static inline void main_periodic(void); diff --git a/sw/airborne/lisa/test/hs_gyro.c b/sw/airborne/lisa/test/hs_gyro.c index c95e033358..e82e1dd4be 100644 --- a/sw/airborne/lisa/test/hs_gyro.c +++ b/sw/airborne/lisa/test/hs_gyro.c @@ -24,16 +24,15 @@ #include #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" #include "subsystems/imu.h" -#include "interrupt_hw.h" #ifndef MEASURED_SENSOR #define MEASURED_SENSOR gyro_unscaled.p @@ -60,11 +59,11 @@ int main( void ) { static inline void main_init( void ) { - hw_init(); + mcu_init(); sys_time_init(); imu_init(); - int_enable(); + mcu_int_enable(); } static inline void main_periodic_task( void ) { diff --git a/sw/airborne/lisa/test/lisa_tunnel.c b/sw/airborne/lisa/test/lisa_tunnel.c index e35a86630d..1a7bec287a 100644 --- a/sw/airborne/lisa/test/lisa_tunnel.c +++ b/sw/airborne/lisa/test/lisa_tunnel.c @@ -24,10 +24,10 @@ #include #include "std.h" -#include "init_hw.h" +#include "mcu.h" +#include "mcu_periph/uart.h" #include "sys_time.h" #include "led.h" -#include "uart.h" static inline void main_init( void ); static inline void main_periodic_task( void ); diff --git a/sw/airborne/lisa/test/test_board.c b/sw/airborne/lisa/test/test_board.c index efb4088ff1..292fb22bca 100644 --- a/sw/airborne/lisa/test/test_board.c +++ b/sw/airborne/lisa/test/test_board.c @@ -29,11 +29,11 @@ #include "test_board.h" #include "std.h" -#include "init_hw.h" +#include "mcu.h" +#include "mcu_periph/uart.h" #include "sys_time.h" #include "downlink.h" #include "led.h" -#include "uart.h" #include "datalink.h" #include "generated/settings.h" diff --git a/sw/airborne/lisa/test_servos.c b/sw/airborne/lisa/test_servos.c index d095c00319..4bf9235b67 100644 --- a/sw/airborne/lisa/test_servos.c +++ b/sw/airborne/lisa/test_servos.c @@ -50,6 +50,8 @@ static inline void main_periodic( void ) { static float foo = 0.; foo += 0.0025; int32_t bar = 1500 + 500. * sin(foo); + // int32_t bar = 1450; + // int32_t bar = 1950; actuators_pwm_values[0] = bar; actuators_pwm_values[1] = bar; actuators_pwm_values[2] = bar; diff --git a/sw/airborne/mcu.c b/sw/airborne/mcu.c index 42fd01d03c..e329ca1e15 100644 --- a/sw/airborne/mcu.c +++ b/sw/airborne/mcu.c @@ -34,7 +34,7 @@ #endif #endif #if defined USE_UART0 || defined USE_UART1 || defined USE_UART2 || defined USE_UART3 || defined USE_UART4 || defined USE_UART5 -#include "uart.h" +#include "mcu_periph/uart.h" #endif #if defined USE_I2C1 || defined USE_I2C2 #include "i2c.h" diff --git a/sw/airborne/uart.h b/sw/airborne/mcu_periph/uart.h similarity index 94% rename from sw/airborne/uart.h rename to sw/airborne/mcu_periph/uart.h index 03e043ae5f..32bc3588d2 100644 --- a/sw/airborne/uart.h +++ b/sw/airborne/mcu_periph/uart.h @@ -1,7 +1,7 @@ /* * Paparazzi $Id$ * - * Copyright (C) 2006 Pascal Brisset, Antoine Drouin + * Copyright (C) 2010 The Paparazzi Team * * This file is part of paparazzi. * @@ -22,15 +22,15 @@ * */ -/** \file uart.h +/** \file mcu_periph/uart.h * \brief arch independant UART (Universal Asynchronous Receiver/Transmitter) API * */ -#ifndef UART_H -#define UART_H +#ifndef MCU_PERIPH_UART_H +#define MCU_PERIPH_UART_H -#include "uart_hw.h" +#include "mcu_periph/uart_arch.h" #include "std.h" @@ -121,4 +121,4 @@ extern bool_t uart3_check_free_space( uint8_t len); #endif /* USE_UART3 */ -#endif /* UART_H */ +#endif /* MCU_PERIPH_UART_H */ diff --git a/sw/airborne/modules/MPPT/MPPT.c b/sw/airborne/modules/MPPT/MPPT.c index 389f997e9f..953bed6e64 100644 --- a/sw/airborne/modules/MPPT/MPPT.c +++ b/sw/airborne/modules/MPPT/MPPT.c @@ -53,7 +53,7 @@ struct i2c_transaction mppt_trans; #ifndef DOWNLINK_DEVICE #define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE #endif -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/modules/adcs/adc_generic.c b/sw/airborne/modules/adcs/adc_generic.c index d7e8f26f52..5af66cd317 100644 --- a/sw/airborne/modules/adcs/adc_generic.c +++ b/sw/airborne/modules/adcs/adc_generic.c @@ -1,6 +1,6 @@ #include "adc_generic.h" #include "adc.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" #include BOARD_CONFIG diff --git a/sw/airborne/modules/adcs/max11040.c b/sw/airborne/modules/adcs/max11040.c index 6ef76fd7e2..0cafe4993e 100644 --- a/sw/airborne/modules/adcs/max11040.c +++ b/sw/airborne/modules/adcs/max11040.c @@ -28,7 +28,7 @@ */ #include "led.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" #include "max11040.h" diff --git a/sw/airborne/modules/cam_control/cam_track.h b/sw/airborne/modules/cam_control/cam_track.h index 873e0324bf..0cfc6e6644 100644 --- a/sw/airborne/modules/cam_control/cam_track.h +++ b/sw/airborne/modules/cam_control/cam_track.h @@ -45,7 +45,7 @@ extern volatile uint8_t cam_msg_received; extern void parse_cam_msg( void ); extern void parse_cam_buffer( uint8_t ); -#include "uart.h" +#include "mcu_periph/uart.h" #define __CamLink(dev, _x) dev##_x #define _CamLink(dev, _x) __CamLink(dev, _x) diff --git a/sw/airborne/modules/core/extra_pprz_dl.c b/sw/airborne/modules/core/extra_pprz_dl.c index 231287f7d3..3e36b305e1 100644 --- a/sw/airborne/modules/core/extra_pprz_dl.c +++ b/sw/airborne/modules/core/extra_pprz_dl.c @@ -25,7 +25,7 @@ #include #include "extra_pprz_dl.h" -#include "uart.h" +#include "mcu_periph/uart.h" volatile bool_t extra_pprz_msg_received = FALSE; uint8_t extra_pprz_ovrn, extra_pprz_error; diff --git a/sw/airborne/modules/core/sys_mon.c b/sw/airborne/modules/core/sys_mon.c index 6999c6f6a1..35517029d9 100644 --- a/sw/airborne/modules/core/sys_mon.c +++ b/sw/airborne/modules/core/sys_mon.c @@ -57,7 +57,7 @@ void init_sysmon(void) { sum_n_event = 0; } -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #ifndef DOWNLINK_DEVICE #define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE diff --git a/sw/airborne/modules/digital_cam/atmega_i2c_cam_ctrl.c b/sw/airborne/modules/digital_cam/atmega_i2c_cam_ctrl.c index 645cbe1294..769dae7f1b 100644 --- a/sw/airborne/modules/digital_cam/atmega_i2c_cam_ctrl.c +++ b/sw/airborne/modules/digital_cam/atmega_i2c_cam_ctrl.c @@ -36,7 +36,7 @@ #ifndef DOWNLINK_DEVICE #define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE #endif -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" #include "estimator.h" diff --git a/sw/airborne/modules/digital_cam/dc.c b/sw/airborne/modules/digital_cam/dc.c index 29543af74a..99543a6f56 100644 --- a/sw/airborne/modules/digital_cam/dc.c +++ b/sw/airborne/modules/digital_cam/dc.c @@ -38,7 +38,7 @@ uint16_t dc_photo_nr = 0; #ifndef DOWNLINK_DEVICE #define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE #endif -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" #include "estimator.h" diff --git a/sw/airborne/modules/digital_cam/sim_i2c_cam_ctrl.c b/sw/airborne/modules/digital_cam/sim_i2c_cam_ctrl.c index c682e4ae37..12c3eeb5e4 100644 --- a/sw/airborne/modules/digital_cam/sim_i2c_cam_ctrl.c +++ b/sw/airborne/modules/digital_cam/sim_i2c_cam_ctrl.c @@ -33,7 +33,7 @@ #ifndef DOWNLINK_DEVICE #define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE #endif -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" #include "estimator.h" diff --git a/sw/airborne/modules/enose/enose.c b/sw/airborne/modules/enose/enose.c index c3e816bb92..9619e05e74 100644 --- a/sw/airborne/modules/enose/enose.c +++ b/sw/airborne/modules/enose/enose.c @@ -47,7 +47,7 @@ void enose_set_heat(uint8_t no_sensor, uint8_t value) { #ifndef DOWNLINK_DEVICE #define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE #endif -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/modules/gsm/gsm.c b/sw/airborne/modules/gsm/gsm.c index 7d4d4e26d5..301f13bb81 100644 --- a/sw/airborne/modules/gsm/gsm.c +++ b/sw/airborne/modules/gsm/gsm.c @@ -58,7 +58,7 @@ Receiving: #include #include "gsm.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "std.h" #ifdef USE_USB_SERIAL #include "usb_serial.h" @@ -66,7 +66,7 @@ Receiving: #ifndef DOWNLINK_DEVICE #define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE #endif -#include "uart.h" +#include "mcu_periph/uart.h" #include "downlink.h" #include "ap_downlink.h" #include "gps.h" diff --git a/sw/airborne/modules/ins/fw_ins_vn100.c b/sw/airborne/modules/ins/fw_ins_vn100.c index 06002880c2..5ec9cf2c62 100644 --- a/sw/airborne/modules/ins/fw_ins_vn100.c +++ b/sw/airborne/modules/ins/fw_ins_vn100.c @@ -92,7 +92,7 @@ void ins_periodic_task( void ) { } -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/modules/ins/ins_arduimu.c b/sw/airborne/modules/ins/ins_arduimu.c index 68db855b0d..05e5e63bf7 100644 --- a/sw/airborne/modules/ins/ins_arduimu.c +++ b/sw/airborne/modules/ins/ins_arduimu.c @@ -30,7 +30,7 @@ int32_t GPS_Data[14]; #define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE #endif -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/modules/ins/ins_module.h b/sw/airborne/modules/ins/ins_module.h index 0f2575d241..7c707d011e 100644 --- a/sw/airborne/modules/ins/ins_module.h +++ b/sw/airborne/modules/ins/ins_module.h @@ -71,7 +71,7 @@ void parse_ins_msg( void ); void parse_ins_buffer( uint8_t ); #ifndef SITL -#include "uart.h" +#include "mcu_periph/uart.h" #define __InsLink(dev, _x) dev##_x #define _InsLink(dev, _x) __InsLink(dev, _x) diff --git a/sw/airborne/modules/ins/ins_vn100.c b/sw/airborne/modules/ins/ins_vn100.c index ba36debbdd..d0670ca565 100644 --- a/sw/airborne/modules/ins/ins_vn100.c +++ b/sw/airborne/modules/ins/ins_vn100.c @@ -176,7 +176,7 @@ void parse_ins_msg( void ) { } -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/modules/max3100/max3100_hw.c b/sw/airborne/modules/max3100/max3100_hw.c index 00158e6f1a..af85b690cb 100644 --- a/sw/airborne/modules/max3100/max3100_hw.c +++ b/sw/airborne/modules/max3100/max3100_hw.c @@ -27,7 +27,7 @@ #include "max3100_hw.h" #include "ap_downlink.h" -#include "uart.h" +#include "mcu_periph/uart.h" uint8_t volatile max3100_status; diff --git a/sw/airborne/modules/meteo/dust_gp2y.c b/sw/airborne/modules/meteo/dust_gp2y.c index ad1be858c2..939082595b 100644 --- a/sw/airborne/modules/meteo/dust_gp2y.c +++ b/sw/airborne/modules/meteo/dust_gp2y.c @@ -33,7 +33,7 @@ #include "dust_gp2y.h" #include "i2c.h" #include "sys_time.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/modules/meteo/humid_dpicco.c b/sw/airborne/modules/meteo/humid_dpicco.c index 99bbb9f97b..216fb4deaa 100644 --- a/sw/airborne/modules/meteo/humid_dpicco.c +++ b/sw/airborne/modules/meteo/humid_dpicco.c @@ -9,7 +9,7 @@ #include "i2c.h" #include "led.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/modules/meteo/humid_hih.c b/sw/airborne/modules/meteo/humid_hih.c index d07eb9fba4..e40fc5724b 100644 --- a/sw/airborne/modules/meteo/humid_hih.c +++ b/sw/airborne/modules/meteo/humid_hih.c @@ -32,7 +32,7 @@ #include "humid_hih.h" #include "temp_tmp102.h" #include "adc.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/modules/meteo/humid_sht.c b/sw/airborne/modules/meteo/humid_sht.c index 6dd38cd44d..6b9128a40e 100644 --- a/sw/airborne/modules/meteo/humid_sht.c +++ b/sw/airborne/modules/meteo/humid_sht.c @@ -8,7 +8,7 @@ #include "std.h" #include "LPC21xx.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" #include "humid_sht.h" diff --git a/sw/airborne/modules/meteo/humid_sht_i2c.c b/sw/airborne/modules/meteo/humid_sht_i2c.c index a1554d64bd..8f1762943b 100644 --- a/sw/airborne/modules/meteo/humid_sht_i2c.c +++ b/sw/airborne/modules/meteo/humid_sht_i2c.c @@ -31,7 +31,7 @@ #include "humid_sht_i2c.h" #include "i2c.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/modules/meteo/ir_mlx.c b/sw/airborne/modules/meteo/ir_mlx.c index c1f02a9e3b..4524fc5784 100644 --- a/sw/airborne/modules/meteo/ir_mlx.c +++ b/sw/airborne/modules/meteo/ir_mlx.c @@ -34,7 +34,7 @@ #include "sys_time.h" #include "i2c.h" #include "led.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/modules/meteo/light_temt.c b/sw/airborne/modules/meteo/light_temt.c index 0a8d9fd7af..580fe11df6 100644 --- a/sw/airborne/modules/meteo/light_temt.c +++ b/sw/airborne/modules/meteo/light_temt.c @@ -31,7 +31,7 @@ #include "light_temt.h" #include "adc.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/modules/meteo/temp_lm75.c b/sw/airborne/modules/meteo/temp_lm75.c index 0690536f4c..6dc81a3c00 100644 --- a/sw/airborne/modules/meteo/temp_lm75.c +++ b/sw/airborne/modules/meteo/temp_lm75.c @@ -33,7 +33,7 @@ #include "i2c.h" #include "led.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/modules/meteo/temp_temod.c b/sw/airborne/modules/meteo/temp_temod.c index 6d34906f38..1d6bfb593b 100644 --- a/sw/airborne/modules/meteo/temp_temod.c +++ b/sw/airborne/modules/meteo/temp_temod.c @@ -31,7 +31,7 @@ #include "temp_temod.h" #include "i2c.h" #include "led.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/modules/meteo/temp_tmp102.c b/sw/airborne/modules/meteo/temp_tmp102.c index b0acba7ec7..f84965d25c 100644 --- a/sw/airborne/modules/meteo/temp_tmp102.c +++ b/sw/airborne/modules/meteo/temp_tmp102.c @@ -33,7 +33,7 @@ #include "i2c.h" #include "led.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/modules/meteo/wind_gfi.c b/sw/airborne/modules/meteo/wind_gfi.c index 32c8f6b415..a6d049acbc 100644 --- a/sw/airborne/modules/meteo/wind_gfi.c +++ b/sw/airborne/modules/meteo/wind_gfi.c @@ -33,7 +33,7 @@ #include "i2c.h" #include "led.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/modules/meteo/windturbine.c b/sw/airborne/modules/meteo/windturbine.c index c482cb9cda..5e356d5536 100644 --- a/sw/airborne/modules/meteo/windturbine.c +++ b/sw/airborne/modules/meteo/windturbine.c @@ -38,7 +38,7 @@ #define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE #endif -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/modules/sensors/airspeed_ets.c b/sw/airborne/modules/sensors/airspeed_ets.c index e00164cb96..feff4b06b1 100644 --- a/sw/airborne/modules/sensors/airspeed_ets.c +++ b/sw/airborne/modules/sensors/airspeed_ets.c @@ -37,7 +37,7 @@ #include "sensors/airspeed_ets.h" #include "estimator.h" #include "i2c.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" #include diff --git a/sw/airborne/modules/sensors/alt_srf08.c b/sw/airborne/modules/sensors/alt_srf08.c index fca3474dda..8d4579fc35 100644 --- a/sw/airborne/modules/sensors/alt_srf08.c +++ b/sw/airborne/modules/sensors/alt_srf08.c @@ -29,7 +29,7 @@ #include "i2c.h" #include "alt_srf08.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" #include "led.h" diff --git a/sw/airborne/modules/sensors/baro_MS5534A.c b/sw/airborne/modules/sensors/baro_MS5534A.c index d44dde9dc9..5d931dec48 100644 --- a/sw/airborne/modules/sensors/baro_MS5534A.c +++ b/sw/airborne/modules/sensors/baro_MS5534A.c @@ -30,7 +30,7 @@ #include "baro_MS5534A.h" #include "spi.h" -#include "uart.h" +#include "mcu_periph/uart.h" #ifndef BARO_NO_DOWNLINK #include "ap_downlink.h" #endif diff --git a/sw/airborne/modules/sensors/baro_bmp.c b/sw/airborne/modules/sensors/baro_bmp.c index 34860b1ca0..c45804adbf 100644 --- a/sw/airborne/modules/sensors/baro_bmp.c +++ b/sw/airborne/modules/sensors/baro_bmp.c @@ -34,7 +34,7 @@ #include "sys_time.h" #include "i2c.h" #include "led.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/modules/sensors/baro_scp.c b/sw/airborne/modules/sensors/baro_scp.c index 80808ee28e..1698a77f3e 100644 --- a/sw/airborne/modules/sensors/baro_scp.c +++ b/sw/airborne/modules/sensors/baro_scp.c @@ -4,7 +4,7 @@ #include "led.h" #include "interrupt_hw.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/modules/sensors/baro_scp_i2c.c b/sw/airborne/modules/sensors/baro_scp_i2c.c index f45f89abd0..f5023f73d9 100644 --- a/sw/airborne/modules/sensors/baro_scp_i2c.c +++ b/sw/airborne/modules/sensors/baro_scp_i2c.c @@ -10,7 +10,7 @@ #include "sys_time.h" #include "i2c.h" #include "led.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/modules/sensors/mag_micromag_fw.c b/sw/airborne/modules/sensors/mag_micromag_fw.c index a1544a698a..663845e00a 100644 --- a/sw/airborne/modules/sensors/mag_micromag_fw.c +++ b/sw/airborne/modules/sensors/mag_micromag_fw.c @@ -1,7 +1,7 @@ #include "mag_micromag_fw.h" #include "sensors/mag_micromag_fw_hw.h" #include "led.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/modules/sensors/trigger_ext.c b/sw/airborne/modules/sensors/trigger_ext.c index 74205b8e76..635ff50df6 100644 --- a/sw/airborne/modules/sensors/trigger_ext.c +++ b/sw/airborne/modules/sensors/trigger_ext.c @@ -34,7 +34,7 @@ #include "modules/sensors/trig_ext_hw.h" #include "gps.h" #include "sys_time.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/obsolete/3dmg.h b/sw/airborne/obsolete/3dmg.h new file mode 100644 index 0000000000..d5a8ca8310 --- /dev/null +++ b/sw/airborne/obsolete/3dmg.h @@ -0,0 +1,15 @@ +#ifndef _3DMG_H +#define _3DMG_H + +#include +#include "std.h" + +void _3dmg_capture_gyro_bias ( void ); +void _3dmg_set_continuous_mode ( void ); +void _3dmg_capture_neutral ( void ); + +extern volatile bool_t _3dmg_data_ready; +extern int16_t _3dmg_roll, _3dmg_pitch, _3dmg_yaw; +extern int16_t _3dmg_roll_dot, _3dmg_pitch_dot, _3dmg_yaw_dot; + +#endif /* _3DMG_H */ diff --git a/sw/airborne/pprz_debug.h b/sw/airborne/pprz_debug.h index 966a004c19..79d764b26f 100644 --- a/sw/airborne/pprz_debug.h +++ b/sw/airborne/pprz_debug.h @@ -31,7 +31,7 @@ #ifdef PPRZ_DEBUG #include "std.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/pprz_transport.c b/sw/airborne/pprz_transport.c index 7985e6decd..90b4a93e06 100644 --- a/sw/airborne/pprz_transport.c +++ b/sw/airborne/pprz_transport.c @@ -24,7 +24,7 @@ #include #include "pprz_transport.h" -#include "uart.h" +#include "mcu_periph/uart.h" uint8_t ck_a, ck_b; volatile bool_t pprz_msg_received = FALSE; diff --git a/sw/airborne/print.h b/sw/airborne/print.h index 6b1dbc95d9..949e14c258 100644 --- a/sw/airborne/print.h +++ b/sw/airborne/print.h @@ -25,7 +25,7 @@ #ifndef PRINT_H #define PRINT_H -#include "uart.h" +#include "mcu_periph/uart.h" #include "usb_serial.h" #define _PrintString(out_fun, s) { \ diff --git a/sw/airborne/sd_card/main.c b/sw/airborne/sd_card/main.c index 5be480f5f7..b8f400b780 100644 --- a/sw/airborne/sd_card/main.c +++ b/sw/airborne/sd_card/main.c @@ -1,9 +1,8 @@ #include "std.h" -#include "init_hw.h" +#include "mcu.h" #include "sys_time.h" #include "led.h" -#include "interrupt_hw.h" -#include "uart.h" +#include "mcu_periph/uart.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/subsystems/radio_control/joby.h b/sw/airborne/subsystems/radio_control/joby.h index b7640e7991..2b57661e9c 100644 --- a/sw/airborne/subsystems/radio_control/joby.h +++ b/sw/airborne/subsystems/radio_control/joby.h @@ -26,7 +26,7 @@ #define RADIO_CONTROL_JOBY_H #include "std.h" -#include "uart.h" +#include "mcu_periph/uart.h" #define RC_JOBY_MAGIC_START 13999