27 #include "generated/airframe.h"
34 #ifndef ADC_CHANNEL_WING_ROTATION_CONTROLLER_POSITION
35 #define ADC_CHANNEL_WING_ROTATION_CONTROLLER_POSITION ADC_5
38 #ifndef ADC_CHANNEL_WING_ROTATION_CONTROLLER_POSITION_NB_SAMPLES
39 #define ADC_CHANNEL_WING_ROTATION_CONTROLLER_POSITION_NB_SAMPLES 16
42 #ifndef ADC_WING_ROT_OFFSET
43 #error "ADC_WING_ROT_OFFSET not defined"
46 #ifndef ADC_WING_ROT_SCALE
47 #error "ADC_WING_ROT_SCALE not defined"
50 #ifdef ADC_WING_ROT_OFFSET
51 static float adc_offset = ADC_WING_ROT_OFFSET;
54 #ifdef ADC_WING_ROT_SCALE
55 static float adc_scale = ADC_WING_ROT_SCALE;
70 float wing_angle_deg = adc_scale * adc_wing_rotation + adc_offset;
74 feedback.
idx = SERVO_ROTATION_MECH_IDX;
75 feedback.
position = 0.5 * M_PI - RadOfDeg(wing_angle_deg);
Main include for ABI (AirBorneInterface).
#define ACT_FEEDBACK_UAVCAN_ID
arch independent ADC (Analog to Digital Converter) API
Generic interface for all ADC hardware drivers, independent from microcontroller architecture.
void adc_buf_channel(uint8_t adc_channel, struct adc_buf *s, uint8_t av_nb_sample)
Link between ChibiOS ADC drivers and Paparazzi adc_buffers.
bool position
Position is set.
struct act_feedback_t::act_feedback_set_t set
Bitset registering what is set as feedback.
uint8_t idx
General index of the actuators (generated in airframe.h)
float position
In radians.
#define ADC_CHANNEL_WING_ROTATION_CONTROLLER_POSITION
void wing_rotation_adc_to_deg(void)
void wing_rotation_adc_init(void)
static struct adc_buf buf_wing_rot_pos
#define ADC_CHANNEL_WING_ROTATION_CONTROLLER_POSITION_NB_SAMPLES