44 #ifndef SERVO_MOTOR_IDX
45 #warning "Disco actuators require a <servo name=MOTOR>"
76 #define DISCO_BLDC_STATUS_STOPPED 1
77 #define DISCO_BLDC_STATUS_RAMPUP 2
78 #define DISCO_BLDC_STATUS_RUNNING 4
79 #define DISCO_BLDC_STATUS_RAMPDOWN 5
84 #define DISCO_BLDC_START_MOTOR_THRESHOLD 1100
124 #pragma GCC diagnostic push
125 #pragma GCC diagnostic ignored "-Wcast-qual"
127 #pragma GCC diagnostic pop
169 #pragma GCC diagnostic push
170 #pragma GCC diagnostic ignored "-Wcast-qual"
172 #pragma GCC diagnostic pop
178 feedback.
idx = SERVO_MOTOR_IDX;
187 for (
int i = 0; i < size; i++) {
Main include for ABI (AirBorneInterface).
#define ACT_FEEDBACK_BOARD_ID
void autopilot_set_kill_throttle(bool kill)
set kill throttle
Core autopilot interface common to all firmwares.
void actuators_disco_commit(void)
#define DISCO_BLDC_STATUS_STOPPED
#define DISCO_BLDC_STATUS_RAMPUP
#define DISCO_BLDC_START_MOTOR_THRESHOLD
#define DISCO_BLDC_STATUS_RUNNING
struct ActuatorsDisco actuators_disco
struct disco_bldc_obs obs_data
static uint8_t disco_channels[]
Internal mapping of the PWM with output index servo rail 1 <-> linux pwm_4 servo rail 2 <-> linux pwm...
static uint8_t actuators_disco_checksum(uint8_t *bytes, uint8_t size)
void actuators_disco_set(uint8_t idx, uint16_t val)
void actuators_disco_init(void)
private observation structure
#define ACTUATORS_DISCO_PWM_NB
Max number of PWM channels.
#define ACTUATORS_DISCO_CLEAR_ERROR
Clear all current erros.
bool rpm_saturated
RPM saturation flag (bit 15 in obs data)
#define ACTUATORS_DISCO_SET_REF_SPEED
Set reference speed.
#define ACTUATORS_DISCO_MOTOR_IDX
Index for motor BLDC.
#define ACTUATORS_DISCO_START_PROP
Start the propellers.
uint16_t rpm_obs
Measured RPM.
uint16_t motor_rpm
Motor RPM setpoint.
#define ACTUATORS_DISCO_GET_OBS_DATA
Get observation data.
#define ACTUATORS_DISCO_ADDR
struct i2c_transaction i2c_trans
I2C transaction for communicating with the Disco BLDC driver.
struct PWM_Sysfs pwm[ACTUATORS_DISCO_PWM_NB]
Array of PWM outputs.
#define ACTUATORS_DISCO_STOP_PROP
Stop the propellers.
struct Electrical electrical
Interface for electrical status: supply voltage, current, battery status, etc.
float vsupply
supply voltage in V
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
enum I2CTransactionStatus status
Transaction status.
uint8_t slave_addr
Slave address.
bool i2c_blocking_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 and wait for it to complete.
bool i2c_blocking_transmit(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len)
Submit a write only transaction and wait for it to complete.
@ I2CTransDone
transaction set to done by user level
Hardware independent API for actuators (servos, motor controllers).
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)
void pwm_sysfs_set_duty(struct PWM_Sysfs *pwm, uint32_t duty)
int pwm_sysfs_init(struct PWM_Sysfs *pwm, char *base_path, char *_export, char *_enable, char *_duty, char *_period, uint8_t channel)
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.