Paparazzi UAS
v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
|
Viking Motorsports Engine Control Unit demo module see https://wiki.paparazziuav.org/wiki/VMS_ECU for more details. More...
#include "modules/fsae_electric/vms_ecu_demo.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
#include "mcu_periph/gpio.h"
#include "ch.h"
#include "hal.h"
#include "generated/airframe.h"
#include <BOARD_CONFIG>
Go to the source code of this file.
Data Structures | |
struct | can_instance |
Macros | |
#define | ADC_BIT_RES 12 |
#define | ADC_VREF 3300.0 |
#define | ADC_VREF_MULT ADC_VREF/(1<<ADC_BIT_RES) |
#define | ADC_VGAIN 1.5 |
#define | DAC_BUFFER_SIZE 1 |
Functions | |
static | THD_WORKING_AREA (can_rx1_wa, 256) |
static | THD_WORKING_AREA (can_rx2_wa, 256) |
static | THD_FUNCTION (can_rx, p) |
static | THD_WORKING_AREA (can_tx_wa, 256) |
static | THD_FUNCTION (can_tx, p) |
void | vms_ecu_demo_init (void) |
void | vms_ecu_demo_periodic (void) |
void | vms_ecu_demo_downlink (void) |
void | vms_ecu_demo_UpdateDac1 (uint16_t val) |
Reset sweep number. More... | |
void | vms_ecu_demo_UpdateDac2 (uint16_t val) |
Variables | |
float | ain_1 |
float | ain_2 |
float | ain_3 |
float | ain_4 |
struct adc_buf | adc_buf_1 |
struct adc_buf | adc_buf_2 |
struct adc_buf | adc_buf_3 |
struct adc_buf | adc_buf_4 |
uint16_t | dac_1 |
uint16_t | dac_2 |
static const DACConfig | dac1cfg1 |
static const DACConfig | dac1cfg2 |
dacsample_t | dac_ref1 |
dacsample_t | dac_ref2 |
bool | ams_status |
bool | pwr_ready |
bool | pwr_stdby |
bool | rtds |
uint8_t | stg_in |
uint8_t | stb_in |
static const struct can_instance | can1 = {&CAND1, 11} |
static const struct can_instance | can2 = {&CAND2, 12} |
static const CANConfig | cancfg_lb |
static const CANConfig | cancfg |
Viking Motorsports Engine Control Unit demo module see https://wiki.paparazziuav.org/wiki/VMS_ECU for more details.
Definition in file vms_ecu_demo.c.
struct can_instance |
Definition at line 110 of file vms_ecu_demo.c.
Data Fields | ||
---|---|---|
CANDriver * | canp | |
uint32_t | led |
#define ADC_BIT_RES 12 |
Definition at line 47 of file vms_ecu_demo.c.
#define ADC_VGAIN 1.5 |
Definition at line 57 of file vms_ecu_demo.c.
Referenced by vms_ecu_demo_periodic().
#define ADC_VREF 3300.0 |
Definition at line 51 of file vms_ecu_demo.c.
#define ADC_VREF_MULT ADC_VREF/(1<<ADC_BIT_RES) |
Definition at line 54 of file vms_ecu_demo.c.
Referenced by vms_ecu_demo_periodic().
#define DAC_BUFFER_SIZE 1 |
Definition at line 59 of file vms_ecu_demo.c.
|
static |
Definition at line 144 of file vms_ecu_demo.c.
References can_instance::canp, GPIOD, can_instance::led, and p.
|
static |
Definition at line 170 of file vms_ecu_demo.c.
References p.
|
static |
|
static |
|
static |
void vms_ecu_demo_downlink | ( | void | ) |
Definition at line 315 of file vms_ecu_demo.c.
References ain_1, ain_2, ain_3, ain_4, DefaultChannel, DefaultDevice, stb_in, and stg_in.
void vms_ecu_demo_init | ( | void | ) |
Definition at line 190 of file vms_ecu_demo.c.
References ADC_1, ADC_2, ADC_3, ADC_4, adc_buf_1, adc_buf_2, adc_buf_3, adc_buf_4, adc_buf_channel(), ain_1, ain_2, ain_3, ain_4, ams_status, cancfg, dac1cfg1, dac1cfg2, dac_1, dac_2, dac_ref1, dac_ref2, DEFAULT_AV_NB_SAMPLE, GPIOA, pwr_ready, pwr_stdby, rtds, stb_in, and stg_in.
void vms_ecu_demo_periodic | ( | void | ) |
Definition at line 248 of file vms_ecu_demo.c.
References adc_buf_1, adc_buf_2, adc_buf_3, adc_buf_4, ADC_VGAIN, ADC_VREF_MULT, ain_1, ain_2, ain_3, ain_4, ams_status, adc_buf::av_nb_sample, gpio_clear(), gpio_set(), GPIOD, GPIOE, pwr_ready, pwr_stdby, rtds, stb_in, stg_in, and adc_buf::sum.
void vms_ecu_demo_UpdateDac1 | ( | uint16_t | val | ) |
Reset sweep number.
Definition at line 326 of file vms_ecu_demo.c.
void vms_ecu_demo_UpdateDac2 | ( | uint16_t | val | ) |
Definition at line 332 of file vms_ecu_demo.c.
struct adc_buf adc_buf_1 |
Definition at line 66 of file vms_ecu_demo.c.
Referenced by vms_ecu_demo_init(), and vms_ecu_demo_periodic().
struct adc_buf adc_buf_2 |
Definition at line 67 of file vms_ecu_demo.c.
Referenced by vms_ecu_demo_init(), and vms_ecu_demo_periodic().
struct adc_buf adc_buf_3 |
Definition at line 68 of file vms_ecu_demo.c.
Referenced by vms_ecu_demo_init(), and vms_ecu_demo_periodic().
struct adc_buf adc_buf_4 |
Definition at line 69 of file vms_ecu_demo.c.
Referenced by vms_ecu_demo_init(), and vms_ecu_demo_periodic().
float ain_1 |
Definition at line 61 of file vms_ecu_demo.c.
Referenced by vms_ecu_demo_downlink(), vms_ecu_demo_init(), and vms_ecu_demo_periodic().
float ain_2 |
Definition at line 62 of file vms_ecu_demo.c.
Referenced by vms_ecu_demo_downlink(), vms_ecu_demo_init(), and vms_ecu_demo_periodic().
float ain_3 |
Definition at line 63 of file vms_ecu_demo.c.
Referenced by vms_ecu_demo_downlink(), vms_ecu_demo_init(), and vms_ecu_demo_periodic().
float ain_4 |
Definition at line 64 of file vms_ecu_demo.c.
Referenced by vms_ecu_demo_downlink(), vms_ecu_demo_init(), and vms_ecu_demo_periodic().
bool ams_status |
Definition at line 97 of file vms_ecu_demo.c.
Referenced by vms_ecu_demo_init(), and vms_ecu_demo_periodic().
|
static |
Definition at line 115 of file vms_ecu_demo.c.
|
static |
Definition at line 116 of file vms_ecu_demo.c.
Referenced by int32_quat_of_axis_angle().
|
static |
Definition at line 133 of file vms_ecu_demo.c.
Referenced by vms_ecu_demo_init().
|
static |
Definition at line 124 of file vms_ecu_demo.c.
|
static |
Definition at line 79 of file vms_ecu_demo.c.
Referenced by vms_ecu_demo_init().
|
static |
Definition at line 84 of file vms_ecu_demo.c.
Referenced by vms_ecu_demo_init().
uint16_t dac_1 |
Definition at line 76 of file vms_ecu_demo.c.
Referenced by vms_ecu_demo_init(), and vms_ecu_demo_UpdateDac1().
uint16_t dac_2 |
Definition at line 77 of file vms_ecu_demo.c.
Referenced by vms_ecu_demo_init(), and vms_ecu_demo_UpdateDac2().
dacsample_t dac_ref1 |
Definition at line 90 of file vms_ecu_demo.c.
Referenced by vms_ecu_demo_init(), and vms_ecu_demo_UpdateDac1().
dacsample_t dac_ref2 |
Definition at line 91 of file vms_ecu_demo.c.
Referenced by vms_ecu_demo_init(), and vms_ecu_demo_UpdateDac2().
bool pwr_ready |
Definition at line 98 of file vms_ecu_demo.c.
Referenced by vms_ecu_demo_init(), and vms_ecu_demo_periodic().
bool pwr_stdby |
Definition at line 99 of file vms_ecu_demo.c.
Referenced by vms_ecu_demo_init(), and vms_ecu_demo_periodic().
bool rtds |
Definition at line 100 of file vms_ecu_demo.c.
Referenced by vms_ecu_demo_init(), and vms_ecu_demo_periodic().
uint8_t stb_in |
Definition at line 103 of file vms_ecu_demo.c.
Referenced by vms_ecu_demo_downlink(), vms_ecu_demo_init(), and vms_ecu_demo_periodic().
uint8_t stg_in |
Definition at line 102 of file vms_ecu_demo.c.
Referenced by vms_ecu_demo_downlink(), vms_ecu_demo_init(), and vms_ecu_demo_periodic().