35 #if PERIODIC_TELEMETRY
105 #if PERIODIC_TELEMETRY
124 float energy = (float)dtelem.
frame.consumption;
125 float temp = dtelem.
frame.temp;
127 pprz_msg_send_ESC(trans,
dev, AC_ID,
159 #define _CONCAT_GPIO(num, name) UART ## num ## _GPIO_ ## name
160 #define CONCAT_GPIO(num, name) _CONCAT_GPIO(num, name)
172 #ifdef DSHOT_TIM1_TELEMETRY_NUM
179 #ifdef DSHOT_TIM2_TELEMETRY_NUM
185 #ifdef DSHOT_TIM3_TELEMETRY_NUM
191 #ifdef DSHOT_TIM4_TELEMETRY_NUM
198 #ifdef DSHOT_TIM5_TELEMETRY_NUM
204 #ifdef DSHOT_TIM8_TELEMETRY_NUM
210 #ifdef DSHOT_TIM9_TELEMETRY_NUM
260 #ifdef DSHOT_SERVO_10
264 #ifdef DSHOT_SERVO_11
294 #if PERIODIC_TELEMETRY
332 #ifdef DSHOT_SERVO_10
335 #ifdef DSHOT_SERVO_11
364 feedback[i].
idx = get_servo_idx_DSHOT(i);
368 feedback[i].
set.
rpm =
true;
373 feedback[i].
rpm = (float) erpm;
374 feedback[i].
set.
rpm =
true;
377 feedback[i].
set.
rpm =
false;
Main include for ABI (AirBorneInterface).
#define ACT_FEEDBACK_DSHOT_ID
bool activated
current dshot channel is activated
float voltage
motor current
#define ACTUATORS_DSHOT_NB
Maxnum number of DSHOT commands This should be large enough for max applications: 8 motors +1 in case...
#define DSHOT_SERVO_2_GPIO
#define DSHOT_SERVO_4_DRIVER
#define DSHOT_SERVO_2_CHANNEL
#define DSHOT_SERVO_5_DRIVER
#define DSHOT_SERVO_3_GPIO
#define DSHOT_SERVO_5_GPIO
#define DSHOT_SERVO_1_DRIVER
#define DSHOT_SERVO_0_PIN
#define DSHOT_SERVO_1_PIN
#define DSHOT_SERVO_0_DRIVER
#define DSHOT_SERVO_3_PIN
#define DSHOT_SERVO_5_CHANNEL
#define DSHOT_SERVO_0_CHANNEL
#define DSHOT_SERVO_1_GPIO
#define DSHOT_SERVO_3_CHANNEL
#define DSHOT_SERVO_4_PIN
#define DSHOT_SERVO_2_PIN
#define DSHOT_SERVO_1_CHANNEL
#define DSHOT_SERVO_5_PIN
#define DSHOT_SERVO_0_GPIO
#define DSHOT_SERVO_3_DRIVER
#define DSHOT_SERVO_4_CHANNEL
#define DSHOT_SERVO_2_DRIVER
#define DSHOT_SERVO_4_GPIO
void gpio_setup_pin_af_pullup(ioportid_t port, uint16_t pin, uint8_t af)
Setup a gpio for input pullup with alternate function.
void gpio_setup_pin_af(ioportid_t port, uint16_t pin, uint8_t af, bool is_output)
Setup a gpio for input or output with alternate function.
void actuators_dshot_arch_init(void)
Arch dependent init.
struct dshot_private actuators_dshot_private[ACTUATORS_DSHOT_NB]
#define CONCAT_GPIO(num, name)
static void dshot_set_struct(struct dshot *ds, struct dshot_private *dsp, DSHOTDriver *driver, uint32_t channel)
struct dshot actuators_dshot_values[ACTUATORS_DSHOT_NB]
static void dshot_init_struct(struct dshot *ds)
static void esc_msg_send(struct transport_tx *trans, struct link_device *dev)
void actuators_dshot_arch_commit(void)
struct Electrical electrical
Interface for electrical status: supply voltage, current, battery status, etc.
float vsupply
supply voltage in V
void dshotStart(DSHOTDriver *driver, const DSHOTConfig *config)
Configures and activates the DSHOT peripheral.
void dshotSetThrottle(DSHOTDriver *driver, const uint8_t index, const uint16_t throttle)
prepare throttle order for specified ESC
DshotTelemetry dshotGetTelemetry(DSHOTDriver *driver, uint32_t index)
return last received telemetry data
void dshotSendFrame(DSHOTDriver *driver)
send throttle order
DSHOT driver based on ChibiOS.
DshotTelemetryFrame frame
#define DSHOT_BIDIR_TLM_EDT
#define DSHOT_BIDIR_ERR_CRC
special values returned by dshotGetRpm function
DSHOT Driver configuration structure.
Some architecture independent helper functions for GPIOs.
#define DSHOT_SERVO_10_AF
#define DSHOT_SERVO_9_PIN
#define DSHOT_SERVO_9_DRIVER
#define DSHOT_SERVO_7_GPIO
#define DSHOT_SERVO_8_CHANNEL
#define DSHOT_SERVO_8_PIN
#define DSHOT_SERVO_7_PIN
#define DSHOT_SERVO_10_PIN
#define DSHOT_SERVO_7_CHANNEL
#define DSHOT_SERVO_10_GPIO
#define DSHOT_SERVO_9_CHANNEL
#define DSHOT_SERVO_9_GPIO
#define DSHOT_SERVO_10_CHANNEL
#define DSHOT_SERVO_8_DRIVER
#define DSHOT_SERVO_8_GPIO
#define DSHOT_SERVO_7_DRIVER
#define DSHOT_SERVO_10_DRIVER
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)
PRINT_CONFIG_VAR(ONELOOP_ANDI_FILT_CUTOFF)
Specific RAM section for DMA usage on F7.
#define IN_DMA_SECTION_NOINIT(var)
static const struct usb_device_descriptor dev
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.