Skip to content

Commit

Permalink
[vms_ecu] Updated board config and added test module
Browse files Browse the repository at this point in the history
  • Loading branch information
podhrmic committed Mar 19, 2017
1 parent 476b426 commit f87debe
Show file tree
Hide file tree
Showing 8 changed files with 467 additions and 66 deletions.
2 changes: 1 addition & 1 deletion conf/airframes/AGGIEAIR/aggieair_conf.xml
Expand Up @@ -29,7 +29,7 @@
telemetry="telemetry/AGGIEAIR/aggieair_fixedwing.xml"
flight_plan="flight_plans/basic.xml"
settings="settings/fixedwing_basic.xml"
settings_modules="modules/nav_basic_fw.xml modules/guidance_basic_fw.xml modules/stabilization_attitude_fw.xml modules/ahrs_float_mlkf.xml modules/imu_common.xml modules/gps.xml"
settings_modules="modules/vms_ecu_demo.xml modules/nav_basic_fw.xml modules/guidance_basic_fw.xml modules/stabilization_attitude_fw.xml modules/ahrs_float_mlkf.xml modules/imu_common.xml modules/gps.xml"
gui_color="#00009e93ffff"
/>
<aircraft
Expand Down
1 change: 1 addition & 0 deletions conf/airframes/AGGIEAIR/aggieair_ecu_example.xml
Expand Up @@ -33,6 +33,7 @@ Viking Motorsports ECU example

<modules>
<module name="sys_mon"/>
<module name="vms_ecu_demo"/>
</modules>

<!-- commands section -->
Expand Down
17 changes: 14 additions & 3 deletions conf/conf_tests.xml
Expand Up @@ -67,7 +67,7 @@
/>
<aircraft
name="Iris"
ac_id="67"
ac_id="44"
airframe="airframes/TUDELFT/tudelft_iris_indi.xml"
radio="radios/FrSky3dr.xml"
telemetry="telemetry/default_rotorcraft_slow.xml"
Expand All @@ -78,7 +78,7 @@
/>
<aircraft
name="Iris_chibios"
ac_id="66"
ac_id="45"
airframe="airframes/AGGIEAIR/aggieair_iris_indi.xml"
radio="radios/AGGIEAIR/aggieair_FrSky3dr.xml"
telemetry="telemetry/AGGIEAIR/aggieair_iris.xml"
Expand Down Expand Up @@ -265,7 +265,7 @@
/>
<aircraft
name="Quad_Lia_chibios"
ac_id="68"
ac_id="46"
airframe="airframes/AGGIEAIR/aggieair_ark_quad_lia.xml"
radio="radios/AGGIEAIR/aggieair_taranis.xml"
telemetry="telemetry/AGGIEAIR/aggieair_rotorcraft.xml"
Expand Down Expand Up @@ -373,6 +373,17 @@
settings_modules="modules/gps.xml modules/nav_basic_fw.xml modules/guidance_basic_fw.xml modules/stabilization_attitude_fw.xml modules/ahrs_float_dcm.xml modules/imu_common.xml"
gui_color="blue"
/>
<aircraft
name="VMS_ECU"
ac_id="47"
airframe="airframes/AGGIEAIR/aggieair_ecu_example.xml"
radio="radios/AGGIEAIR/aggieair_taranis.xml"
telemetry="telemetry/AGGIEAIR/aggieair_fixedwing.xml"
flight_plan="flight_plans/basic.xml"
settings="settings/fixedwing_basic.xml"
settings_modules="modules/vms_ecu_demo.xml modules/nav_basic_fw.xml modules/guidance_basic_fw.xml modules/stabilization_attitude_fw.xml modules/ahrs_float_mlkf.xml modules/imu_common.xml modules/gps.xml"
gui_color="#00009e93ffff"
/>
<aircraft
name="Yapa2_XSens"
ac_id="29"
Expand Down
10 changes: 10 additions & 0 deletions conf/firmwares/subsystems/shared/baro_board.makefile
Expand Up @@ -256,6 +256,16 @@ else ifeq ($(BOARD), chimera)
BARO_BOARD_SRCS += peripherals/ms5611_i2c.c
BARO_BOARD_SRCS += boards/baro_board_ms5611_i2c.c

else ifeq ($(BOARD), vms_ecu)
BARO_BOARD_CFLAGS += -DBARO_BOARD=BARO_MS5611_SPI
include $(CFG_SHARED)/spi_master.makefile
BARO_BOARD_CFLAGS += -DUSE_SPI2 -DUSE_SPI_SLAVE3
BARO_BOARD_CFLAGS += -DBB_MS5611_SPI_DEV=spi2
BARO_BOARD_CFLAGS += -DBB_MS5611_SLAVE_IDX=SPI_SLAVE3
BARO_BOARD_SRCS += peripherals/ms5611.c
BARO_BOARD_SRCS += peripherals/ms5611_spi.c
BARO_BOARD_SRCS += boards/baro_board_ms5611_spi.c

endif # check board

BARO_LED ?= none
Expand Down
44 changes: 44 additions & 0 deletions conf/modules/vms_ecu_demo.xml
@@ -0,0 +1,44 @@
<!DOCTYPE module SYSTEM "module.dtd">

<module name="vms_ecu_demo" dir="fsae_electric">
<doc>
<description>
A simple module for Viking Motorsports Engine Control Unit demonstration,
showing it usability for Formula SAE student competition.
More info at https://wiki.paparazziuav.org/wiki/VMS_ECU
</description>

<section name="ECU">
<!-- optionally define parameters here -->
</section>
</doc>

<settings>
<dl_settings>
<dl_settings NAME="ECU">
<dl_setting min="0" max="1" step="1" values="FALSE|TRUE" var="ams_status" type="bool" shortname="AMS_EN" module="modules/fsae_electric/vms_ecu_demo"/>
<dl_setting min="0" max="1" step="1" values="FALSE|TRUE" var="pwr_ready" type="bool" shortname="PWR_READY" module="modules/fsae_electric/vms_ecu_demo"/>
<dl_setting min="0" max="1" step="1" values="FALSE|TRUE" var="pwr_stdby" type="bool" shortname="PWR_STDBY" module="modules/fsae_electric/vms_ecu_demo"/>
<dl_setting min="0" max="1" step="1" values="FALSE|TRUE" var="rtds" type="bool" shortname="RTDS" module="modules/fsae_electric/vms_ecu_demo"/>
<dl_setting min="0" max="4095" step="1" var="dac_1" type="uint16" shortname="DAC_1" module="modules/fsae_electric/vms_ecu_demo" handler="UpdateDac1"/>
<dl_setting min="0" max="4095" step="1" var="dac_2" type="uint16" shortname="DAC_2" module="modules/fsae_electric/vms_ecu_demo" handler="UpdateDac2"/>
</dl_settings>
</dl_settings>
</settings>

<header>
<file name="vms_ecu_demo.h"/>
</header>
<init fun="vms_ecu_demo_init()"/>
<periodic fun="vms_ecu_demo_periodic()" freq="10."/>
<makefile>
<file name="vms_ecu_demo.c"/>
<define name="USE_DAC1" value="1" />
<define name="USE_DAC2" value="1" />

<define name="USE_CAN1" value="1" />
<define name="USE_CAN2" value="1" />

</makefile>
</module>

81 changes: 19 additions & 62 deletions sw/airborne/boards/vms_ecu/chibios/v1.0/board.h
Expand Up @@ -1074,50 +1074,7 @@
/*
* LEDs
*/
/* 1 red, on PA8 */
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_GPIO GPIOA
#define LED_1_GPIO_PIN 8
#define LED_1_GPIO_ON gpio_clear
#define LED_1_GPIO_OFF gpio_set

/* 2 green, shared with JTAG_TRST */
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_GPIO GPIOB
#define LED_2_GPIO_PIN 4
#define LED_2_GPIO_ON gpio_clear
#define LED_2_GPIO_OFF gpio_set

/* 3 green, shared with ADC12 (ADC_6 on connector ANALOG2) */
#ifndef USE_LED_3
#define USE_LED_3 1
#endif
#define LED_3_GPIO GPIOC
#define LED_3_GPIO_PIN 2
#define LED_3_GPIO_ON gpio_clear
#define LED_3_GPIO_OFF gpio_set

/* 4 red, shared with ADC15 (ADC_4 on connector ANALOG2) */
#ifndef USE_LED_4
#define USE_LED_4 1
#endif
#define LED_4_GPIO GPIOC
#define LED_4_GPIO_PIN 5
#define LED_4_GPIO_ON gpio_clear
#define LED_4_GPIO_OFF gpio_set

/* 5 green, on PC15 */
#ifndef USE_LED_5
#define USE_LED_5 0
#endif
#define LED_5_GPIO GPIOC
#define LED_5_GPIO_PIN 15
#define LED_5_GPIO_ON gpio_set
#define LED_5_GPIO_OFF gpio_clear
// no LEDS here

/*
* ADCs
Expand Down Expand Up @@ -1199,6 +1156,7 @@

/*
* PWM defines
* no PWM outputs used
*/
#ifndef USE_PWM0
#define USE_PWM0 1
Expand Down Expand Up @@ -1263,6 +1221,7 @@

/**
* PPM radio defines
* no ppm inputs used
*/
#define RC_PPM_TICKS_PER_USEC 6
#define PPM_TIMER_FREQUENCY 6000000
Expand All @@ -1271,6 +1230,7 @@

/**
* I2C defines
* No I2C devices used
*/
#define I2C1_CLOCK_SPEED 400000
#define I2C1_CFG_DEF { \
Expand All @@ -1289,29 +1249,26 @@
/**
* SPI Config
*/
#define SPI1_GPIO_AF GPIO_AF5
#define SPI1_GPIO_PORT_MISO GPIOA
#define SPI1_GPIO_MISO GPIO6
#define SPI1_GPIO_PORT_MOSI GPIOA
#define SPI1_GPIO_MOSI GPIO7
#define SPI1_GPIO_PORT_SCK GPIOA
#define SPI1_GPIO_SCK GPIO5

// SLAVE0 on SPI connector
// SLAVE0 - unconnected
#define SPI_SELECT_SLAVE0_PORT GPIOB
#define SPI_SELECT_SLAVE0_PIN 9
// SLAVE1 on AUX1
// SLAVE1 - unconnected
#define SPI_SELECT_SLAVE1_PORT GPIOB
#define SPI_SELECT_SLAVE1_PIN 1
// SLAVE2 on AUX2
#define SPI_SELECT_SLAVE2_PORT GPIOC
#define SPI_SELECT_SLAVE2_PIN 5
// SLAVE3 on AUX3
#define SPI_SELECT_SLAVE3_PORT GPIOC
#define SPI_SELECT_SLAVE3_PIN 4
// SLAVE4 on AUX4
// SLAVE2 is ASPIRIN MPU600 CS
#define SPI_SELECT_SLAVE2_PORT GPIOB
#define SPI_SELECT_SLAVE2_PIN 12
// SLAVE3 is BARO_CS
#define SPI_SELECT_SLAVE3_PORT GPIOE
#define SPI_SELECT_SLAVE3_PIN 3
// SLAVE4 - unconnected
#define SPI_SELECT_SLAVE4_PORT GPIOB
#define SPI_SELECT_SLAVE4_PIN 5
#define SPI_SELECT_SLAVE4_PIN 2

/**
* SD card
* TODO: add defines for SD log
*/

/**
* Baro
Expand Down

0 comments on commit f87debe

Please sign in to comment.