diff --git a/conf/firmwares/subsystems/fixedwing/i2c.makefile b/conf/firmwares/subsystems/fixedwing/i2c.makefile
deleted file mode 100644
index bf238a4267..0000000000
--- a/conf/firmwares/subsystems/fixedwing/i2c.makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-#generic i2c driver
-$(error The i2c subsystem does not have to be specified explicitly anymore, it is always included now. Remove the line from the firmware section of your airframe file!)
diff --git a/conf/firmwares/subsystems/fixedwing/spi_slave_hs.makefile b/conf/firmwares/subsystems/fixedwing/spi_slave_hs.makefile
deleted file mode 100644
index af019ea9a3..0000000000
--- a/conf/firmwares/subsystems/fixedwing/spi_slave_hs.makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Hey Emacs, this is a -*- makefile -*-
-
-#generic spi driver
-$(TARGET).CFLAGS += -DUSE_SPI -DSPI_SLAVE_HS
-
-ifeq ($(TARGET), sim)
-else
-
-$(TARGET).srcs += mcu_periph/spi.c $(SRC_ARCH)/mcu_periph/spi_slave_hs_arch.c
-
-endif
diff --git a/conf/modules/adc.xml b/conf/modules/adc.xml
new file mode 100644
index 0000000000..3d6a9c63e8
--- /dev/null
+++ b/conf/modules/adc.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+ General ADC driver
+ To activate a specific ADC input, define flag USE_ADC_X where X is your ADC input number
+
+
+
+
+
+
+
+
+
diff --git a/conf/modules/ahrs_chimu_spi.xml b/conf/modules/ahrs_chimu_spi.xml
index f420b5d478..9c171b2aa0 100644
--- a/conf/modules/ahrs_chimu_spi.xml
+++ b/conf/modules/ahrs_chimu_spi.xml
@@ -6,6 +6,7 @@
+
@@ -21,8 +22,5 @@
-
- include $(CFG_FIXEDWING)/spi_slave_hs.makefile
-
diff --git a/conf/modules/dac.xml b/conf/modules/dac.xml
new file mode 100644
index 0000000000..a495c8f5dd
--- /dev/null
+++ b/conf/modules/dac.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+ General DAC driver
+ To activate a specific DAC input, define flag USE_DACX where X is your DAC input number
+
+
+
+
+
+
+
+
+
diff --git a/conf/modules/i2c.xml b/conf/modules/i2c.xml
new file mode 100644
index 0000000000..b6c0b59fc3
--- /dev/null
+++ b/conf/modules/i2c.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+ General I2C driver
+ To activate a specific I2C peripheral, define flag USE_I2CX where X is your I2C peripheral number
+
+
+
+
+
+
+
+
+
diff --git a/conf/modules/mcu.xml b/conf/modules/mcu.xml
new file mode 100644
index 0000000000..40113f8bef
--- /dev/null
+++ b/conf/modules/mcu.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+ Automatic initialization module for all MCU peripherals
+ Also includes GPIO and LED drivers
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/conf/modules/module.dtd b/conf/modules/module.dtd
index 82a4fe172d..83b8ab6fde 100644
--- a/conf/modules/module.dtd
+++ b/conf/modules/module.dtd
@@ -92,7 +92,8 @@ cond CDATA #IMPLIED>
+value CDATA #REQUIRED
+cond CDATA #IMPLIED>
+
+
+
+
+ General SPI driver (master mode)
+ To activate a specific SPI peripheral, define flag USE_SPIX where X is your SPI peripheral number
+
+
+
+
+
+
+
+
+
+
+
diff --git a/conf/modules/spi_slave_hs.xml b/conf/modules/spi_slave_hs.xml
new file mode 100644
index 0000000000..4659f044ff
--- /dev/null
+++ b/conf/modules/spi_slave_hs.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+ General SPI driver (high speed slave mode)
+ Only for fixedwing and boards based on LPC21
+
+
+
+
+
+
+
+
+
+
+
diff --git a/conf/modules/sys_time.xml b/conf/modules/sys_time.xml
new file mode 100644
index 0000000000..57a78f94c4
--- /dev/null
+++ b/conf/modules/sys_time.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+ Sys-time peripheral
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/conf/modules/uart.xml b/conf/modules/uart.xml
new file mode 100644
index 0000000000..f8cda0b882
--- /dev/null
+++ b/conf/modules/uart.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+ General UART driver
+ To activate a specific UART peripheral, define flag USE_UARTX where X is your UART peripheral number
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/conf/modules/udp.xml b/conf/modules/udp.xml
new file mode 100644
index 0000000000..6a70fead1e
--- /dev/null
+++ b/conf/modules/udp.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+ General UDP driver
+ To activate a specific UDP peripheral, define flag USE_UDPX where X is your UDP peripheral number
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sw/tools/generators/gen_aircraft.ml b/sw/tools/generators/gen_aircraft.ml
index 551120c0ef..7a85e85167 100644
--- a/sw/tools/generators/gen_aircraft.ml
+++ b/sw/tools/generators/gen_aircraft.ml
@@ -88,6 +88,16 @@ let include_xml2mk = fun f ?(target="$(TARGET)") ?(vpath=None) xml ->
fprintf f "%s\n%s\nendif\n" cond flag
with Xml.No_attribute _ -> fprintf f "%s\n" flag
+let flag_xml2mk = fun f ?(target="$(TARGET)") xml ->
+ let name = Xml.attrib xml "name"
+ and value = Xml.attrib xml "value" in
+ let flag = sprintf "%s.%s += -%s" target name value in
+ try
+ (* TODO: add condition in xml syntax ? *)
+ let cond = Xml.attrib xml "cond" in
+ fprintf f "%s\n%s\nendif\n" cond flag
+ with Xml.No_attribute _ -> fprintf f "%s\n" flag
+
let define_xml2mk = fun f ?(target="$(TARGET)") xml ->
let name = Xml.attrib xml "name"
and value = try Some (Xml.attrib xml "value") with _ -> None in
@@ -185,10 +195,7 @@ let module_xml2mk = fun f target firmware m ->
match Compat.bytes_lowercase (Xml.tag field) with
| "define" -> define_xml2mk f ~target field
| "include" -> include_xml2mk f ~target ~vpath:m.vpath field
- | "flag" ->
- let value = Xml.attrib field "value"
- and name = Xml.attrib field "name" in
- fprintf f "%s.%s += -%s\n" target name value
+ | "flag" -> flag_xml2mk f ~target field
| "file" -> file_xml2mk f dir_name target field
| "file_arch" -> file_xml2mk f ~arch:true dir_name target field
| "raw" -> raw_xml2mk f name field