<airframe name="DEMO">

  <makefile>

ARCH=lpc21

FLASH_MODE = IAP


#
# simple emtpy demo
#
demo1.ARCHDIR = $(ARCH)

demo1.CFLAGS += -DBOARD_CONFIG=\"conf_demo.h\"
demo1.srcs = main_demo1.c

#
# hardware init ( pll ), system time and LEDs
#
demo2.ARCHDIR = $(ARCH)

demo2.CFLAGS += -DBOARD_CONFIG=\"conf_demo.h\"
demo2.srcs = main_demo2.c

demo2.CFLAGS += -DPERIODIC_FREQUENCY='100.' -DUSE_SYS_TIME
demo2.srcs += mcu_periph/sys_time.c $(SRC_ARCH)/mcu_periph/sys_time_arch.c

demo2.CFLAGS += -DUSE_LED

#
# UART (interrupts) and formated ascii printing
#
demo3.ARCHDIR = $(ARCH)

demo3.CFLAGS += -DBOARD_CONFIG=\"conf_demo.h\"
demo3.srcs = main_demo3.c

demo3.CFLAGS += -DPERIODIC_FREQUENCY='10.' -DUSE_SYS_TIME
demo3.srcs += mcu_periph/sys_time.c $(SRC_ARCH)/mcu_periph/sys_time_arch.c

demo3.CFLAGS += -DUSE_LED

demo3.srcs += $(SRC_ARCH)/armVIC.c

demo3.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B38400
demo3.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c

#
# DOWNLINK : send formated messages according to messages.xml description
# requires "link" to run on the other side of the serial link
#
demo4.ARCHDIR = $(ARCH)

demo4.CFLAGS += -DBOARD_CONFIG=\"conf_demo.h\"
demo4.srcs = main_demo4.c

demo4.CFLAGS += -DPERIODIC_FREQUENCY='100.' -DUSE_SYS_TIME
demo4.srcs += mcu_periph/sys_time.c $(SRC_ARCH)/mcu_periph/sys_time_arch.c

demo4.CFLAGS += -DUSE_LED

demo4.srcs += $(SRC_ARCH)/armVIC.c

demo4.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B38400
demo4.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c

demo4.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart0
demo4.srcs += subsystems/datalink/downlink.c subsystems/datalink/pprz_transport.c

#
# DATALINK : receives datalink messages. demonstrates the "settings" service
# which lets you adjust variables described in the settings.xml file
# IvySendMsg("1ME RAW_DATALINK 144 SETTING;0;0;%d", foo_value);
#
demo5.ARCHDIR = $(ARCH)

demo5.CFLAGS += -DBOARD_CONFIG=\"conf_demo.h\"
demo5.srcs = main_demo5.c

demo5.CFLAGS += -DPERIODIC_FREQUENCY='100.' -DUSE_SYS_TIME
demo5.srcs += mcu_periph/sys_time.c $(SRC_ARCH)/mcu_periph/sys_time_arch.c

demo5.CFLAGS += -DUSE_LED

demo5.srcs += $(SRC_ARCH)/armVIC.c

demo5.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B38400
demo5.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c

demo5.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart0
demo5.srcs += subsystems/datalink/downlink.c subsystems/datalink/pprz_transport.c

demo5.CFLAGS += -DDATALINK=PPRZ -DPPRZ_UART=Uart0


#
# Serial link over USB
#
demo6.ARCHDIR = $(ARCH)

demo6.CFLAGS += -DBOARD_CONFIG=\"conf_demo.h\"
demo6.srcs = main_demo6.c

demo6.CFLAGS += -DPERIODIC_FREQUENCY='100.'
demo6.srcs += mcu_periph/sys_time.c $(SRC_ARCH)/mcu_periph/sys_time_arch.c

demo6.CFLAGS += -DUSE_LED

demo6.srcs += $(SRC_ARCH)/armVIC.c

demo6.CFLAGS += -DUSE_USB_SERIAL
#demo6.LDFLAGS += -L$(SRC_ARCH)/lpcusb -lusbstack
demo6.srcs += $(SRC_ARCH)/lpcusb/usbhw_lpc.c $(SRC_ARCH)/lpcusb/usbcontrol.c $(SRC_ARCH)/lpcusb/usbstdreq.c $(SRC_ARCH)/lpcusb/usbinit.c
demo6.srcs += $(SRC_ARCH)/usb_ser_hw.c

demo6.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=UsbS
demo6.srcs += subsystems/datalink/downlink.c subsystems/datalink/pprz_transport.c

//demo6.CFLAGS += -DDATALINK=PPRZ -DPPRZ_UART=Uart0



#
#
#
test_spk.ARCHDIR = $(ARCH)

test_spk.CFLAGS += -DBOARD_CONFIG=\"booz2_board_usb.h\"
test_spk.srcs = main_test_spk.c

test_spk.CFLAGS += -DPERIODIC_FREQUENCY='512.'
test_spk.srcs += mcu_periph/sys_time.c $(SRC_ARCH)/mcu_periph/sys_time_arch.c

test_spk.CFLAGS += -DUSE_LED

test_spk.srcs += $(SRC_ARCH)/armVIC.c

test_spk.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DUSE_USB_SERIAL
test_spk.CFLAGS += -DDOWNLINK_DEVICE=UsbS -DPPRZ_UART=UsbS -DDATALINK=PPRZ
test_spk.srcs += subsystems/datalink/downlink.c $(SRC_ARCH)/usb_ser_hw.c subsystems/datalink/pprz_transport.c
test_spk.srcs += $(SRC_ARCH)/lpcusb/usbhw_lpc.c $(SRC_ARCH)/lpcusb/usbcontrol.c
test_spk.srcs += $(SRC_ARCH)/lpcusb/usbstdreq.c $(SRC_ARCH)/lpcusb/usbinit.c

test_spk.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B115200
test_spk.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c

  </makefile>

</airframe>
