29 #include <sys/ioctl.h>
35 #define PWM_DELOS_SET_RATIOS _IOR(PWM_MAGIC, 9, pwm_delos_quadruplet*)
36 #define PWM_DELOS_SET_SPEEDS _IOR(PWM_MAGIC, 10, pwm_delos_quadruplet*)
37 #define PWM_DELOS_SET_CTRL _IOR(PWM_MAGIC, 11, unsigned int)
38 #define PWM_DELOS_REQUEST _IO(PWM_MAGIC, 12)
40 #define PWM_NB_BITS (9)
43 #ifndef PWM_TOTAL_RANGE
44 #define PWM_TOTAL_RANGE (1<<PWM_NB_BITS)
47 #define PWM_REG_RATIO_PRECISION_MASK (PWM_NB_BITS<<16)
48 #define PWM_REG_SATURATION (PWM_REG_RATIO_PRECISION_MASK|PWM_TOTAL_RANGE)
68 actuators_fd = open(
"/dev/pwm", O_RDWR);
70 pwm_delos_quadruplet m = {{ 1, 1, 1, 1 }};
72 #if ACTUATORS_SWING_DEBUG
73 printf(
"Return Speeds: %d\n", ret);
81 #if ACTUATORS_SWING_DEBUG
82 printf(
"Return control: %d\n", ret);
88 pwm_delos_quadruplet m;
115 #if ACTUATORS_SWING_DEBUG
116 RunOnceEvery(512, printf(
"Return ratios: %d (ratios: %d %d %d %d, pwm: %d %d %d %d\n",
#define PWM_DELOS_SET_CTRL
#define PWM_REG_SATURATION
#define PWM_REG_RATIO_PRECISION_MASK
Hardware independent API for actuators (servos, motor controllers).
uint16_t rpm_ref[4]
Reference RPM.
void actuators_swing_init(void)
Core autopilot interface common to all firmwares.
#define PWM_DELOS_SET_SPEEDS
#define PWM_DELOS_SET_RATIOS
void actuators_swing_commit(void)
Actuator driver for the swing.
struct ActuatorsSwing actuators_swing