33 #include "autopilot.h"
35 #if PERIODIC_TELEMETRY
41 pprz_msg_send_BEBOP_ACTUATORS(trans, dev, AC_ID,
68 #if PERIODIC_TELEMETRY
125 #pragma GCC diagnostic push
126 #pragma GCC diagnostic ignored "-Wcast-qual"
128 #pragma GCC diagnostic pop
145 for (
int i = 0; i < size; i++) {
146 checksum = checksum ^ bytes[i];
#define ACTUATORS_BEBOP_SET_REF_SPEED
Set reference speed.
Generic transmission transport header.
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
Periodic telemetry system header (includes downlink utility and generated code).
bool_t autopilot_motors_on
void actuators_bebop_commit(void)
#define ACTUATORS_BEBOP_ADDR
#define ACTUATORS_BEBOP_TOGGLE_GPIO
Toggle GPIO (reset, red led, green led)
bool_t i2c_transceive(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len_w, uint16_t len_r)
Submit a write/read transaction.
uint16_t rpm_obs[4]
Observed RPM.
Hardware independent API for actuators (servos, motor controllers).
void autopilot_set_motors_on(bool_t motors_on)
#define ACTUATORS_BEBOP_CLEAR_ERROR
Clear all current erros.
transaction set to done by user level
Interface for electrical status: supply voltage, current, battery status, etc.
uint8_t led
Current led status.
bool_t i2c_transmit(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len)
Submit a write only transaction.
#define DefaultPeriodic
Set default periodic telemetry.
static uint8_t actuators_bebop_checksum(uint8_t *bytes, uint8_t size)
enum I2CTransactionStatus status
Transaction status.
static const struct usb_device_descriptor dev
#define ACTUATORS_BEBOP_GET_OBS_DATA
Get observation data.
uint8_t slave_addr
Slave address.
uint16_t vsupply
supply voltage in decivolts
General stabilization interface for rotorcrafts.
int32_t stabilization_cmd[COMMANDS_NB]
Stabilization commands.
#define ACTUATORS_BEBOP_STOP_PROP
Stop the propellers.
struct Electrical electrical
struct ActuatorsBebop actuators_bebop
uint16_t rpm_ref[4]
Reference RPM.
Actuator driver for the bebop.
struct i2c_transaction i2c_trans
I2C transaction for communicating with the bebop BLDC driver.
void actuators_bebop_init(void)
#define ACTUATORS_BEBOP_START_PROP
Start the propellers.
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.