diff --git a/conf/airframes/microjet8.xml b/conf/airframes/microjet8.xml new file mode 100644 index 0000000000..cd77d0b251 --- /dev/null +++ b/conf/airframes/microjet8.xml @@ -0,0 +1,249 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + +
+ + +
+ +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ +
+ + + + +
+ +
+ + + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ + +
+ + + +
+ +
+ + +
+ +
+ + + + + +
+ +
+ + + +
+ +
+ + + + + + + + +
+ +
+ + + + + + + + +
+ +
+ + + + + +
+ + + + +include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile + + + +FLASH_MODE=IAP + +ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny_0_99.h\" -DLED -DTIME_LED=1 +ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c + +ap.srcs += commands.c + +ap.CFLAGS += -DACTUATORS=\"servos_4015_MAT_hw.h\" -DSERVOS_4015_MAT +ap.srcs += $(SRC_ARCH)/servos_4015_MAT_hw.c actuators.c + +ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA +ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c + +ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600 +ap.srcs += downlink.c pprz_transport.c $(SRC_ARCH)/uart_hw.c datalink.c + +ap.CFLAGS += -DINTER_MCU +ap.srcs += inter_mcu.c + +ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_4 -DUSE_ADC_5 -DUSE_ADC_6 +ap.srcs += $(SRC_ARCH)/adc_hw.c + + +ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B19200 + +ap.srcs += gps_ubx.c gps.c + + +ap.CFLAGS += -DINFRARED +ap.srcs += infrared.c estimator.c + +ap.CFLAGS += -DNAV +ap.srcs += nav.c pid.c + +ap.CFLAGS += -DGYRO -DIDG300 -DPID_RATE_LOOP +ap.srcs += gyro.c + + +# Harware In The Loop + +#ap.CFLAGS += -DHITL + +test.CFLAGS += -DFBW -DCONFIG=\"tiny.h\" -DLED -DTIME_LED=1 -DACTUATORS=\"servos_4015_hw.h\" -DSERVOS_4015 -DUSE_UART0 -DUART0_BAUD=B9600 -DDATALINK=PPRZ -DPPRZ_UART=Uart0 +test.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c setup_actuators.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/servos_4015_hw.c main.c + +#tunel.CFLAGS += -DFBW -DCONFIG=\"tiny.h\" -DLED -DTIME_LED=1 +tunnel.srcs += $(SRC_ARCH)/uart_tunnel.c + +# config for SITL simulation +include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile +sim.CFLAGS += -DCONFIG=\"tiny.h\" + + +
diff --git a/conf/autopilot/tiny_0_99.h b/conf/autopilot/tiny_0_99.h new file mode 100644 index 0000000000..372c5bc8e2 --- /dev/null +++ b/conf/autopilot/tiny_0_99.h @@ -0,0 +1,125 @@ +#ifndef CONFIG_TINY_H +#define CONFIG_TINY_H + +#ifdef SITL +/* Dummy definitions: adc are unused anyway */ +#define AdcBank0(x) (x) +#define AdcBank1(x) (x) +#endif /* SITL */ + +/* Master oscillator freq. */ +#define FOSC (12000000) + +/* PLL multiplier */ +#define PLL_MUL (5) + +/* CPU clock freq. */ +#define CCLK (FOSC * PLL_MUL) + +/* Peripheral bus speed mask 0x00->4, 0x01-> 1, 0x02 -> 2 */ +#define PBSD_BITS 0x00 +#define PBSD_VAL 4 + +/* Peripheral bus clock freq. */ +#define PCLK (CCLK / PBSD_VAL) + +#define LED_1_BANK 1 +#define LED_1_PIN 28 + +#define LED_2_BANK 1 +#define LED_2_PIN 19 + +/* P0.5 aka MAT0.1 */ +#define SERVO_CLOCK_PIN 5 +#define SERVO_CLOCK_PINSEL PINSEL0 +#define SERVO_CLOCK_PINSEL_VAL 0x02 +#define SERVO_CLOCK_PINSEL_BIT 10 +/* p1.23 */ +#define SERVO_DATA_PIN 20 +/* p1.24 */ +#define SERVO_RESET_PIN 29 + +/* PPM : rc rx on P0.6*/ +#define PPM_PINSEL PINSEL0 +#define PPM_PINSEL_VAL 0x02 +#define PPM_PINSEL_BIT 12 + +/* ADC */ + +#define ADC_0 AdcBank0(3) +#ifdef USE_ADC_0 +#ifndef USE_AD0 +#define USE_AD0 +#endif +#define USE_AD0_3 +#endif + +#define ADC_1 AdcBank0(2) +#ifdef USE_ADC_1 +#ifndef USE_AD0 +#define USE_AD0 +#endif +#define USE_AD0_2 +#endif + + +#define ADC_2 AdcBank0(1) +#ifdef USE_ADC_2 +#ifndef USE_AD0 +#define USE_AD0 +#endif +#define USE_AD0_1 +#endif + +#define ADC_3 AdcBank0(4) +#ifdef USE_ADC_3 +#ifndef USE_AD0 +#define USE_AD0 +#endif +#define USE_AD0_4 +#endif + +#define ADC_4 AdcBank1(7) +#ifdef USE_ADC_4 +#ifndef USE_AD1 +#define USE_AD1 +#endif +#define USE_AD1_7 +#endif + +#define ADC_5 AdcBank1(3) +#ifdef USE_ADC_4 +#ifndef USE_AD1 +#define USE_AD1 +#endif +#define USE_AD1_3 +#endif + +#define ADC_6 AdcBank1(4) +#ifdef USE_ADC_4 +#ifndef USE_AD1 +#define USE_AD1 +#endif +#define USE_AD1_4 +#endif + +#define ADC_7 AdcBank1(5) +#ifdef USE_ADC_4 +#ifndef USE_AD1 +#define USE_AD1 +#endif +#define USE_AD1_5 +#endif + +#define ADC_CHANNEL_VSUPPLY AdcBank1(6) +#ifndef USE_AD1 +#define USE_AD1 +#endif +#define USE_AD1_6 + + +#ifndef VoltageOfAdc +#define VoltageOfAdc(adc) (0.01787109375*adc) +#endif + +#endif /* CONFIG_TINY_H */