diff --git a/msg/output_pwm.msg b/msg/output_pwm.msg new file mode 100644 index 0000000000..1418a43e6e --- /dev/null +++ b/msg/output_pwm.msg @@ -0,0 +1,3 @@ +uint8 PWM_OUTPUT_MAX_CHANNELS = 16 +uint16[16] values +uint32 channel_count diff --git a/src/drivers/drv_pwm_output.h b/src/drivers/drv_pwm_output.h index eda113f5e4..fc619866be 100644 --- a/src/drivers/drv_pwm_output.h +++ b/src/drivers/drv_pwm_output.h @@ -61,10 +61,17 @@ __BEGIN_DECLS #define PWM_OUTPUT_BASE_DEVICE_PATH "/dev/pwm_output" #define PWM_OUTPUT0_DEVICE_PATH "/dev/pwm_output0" +#include +#define pwm_output_values output_pwm_s + +#ifndef PWM_OUTPUT_MAX_CHANNELS + #define PWM_OUTPUT_MAX_CHANNELS output_pwm_s::PWM_OUTPUT_MAX_CHANNELS +#endif + /** * Maximum number of PWM output channels supported by the device. */ -#define PWM_OUTPUT_MAX_CHANNELS 16 +//#define PWM_OUTPUT_MAX_CHANNELS 16 /** * Lowest minimum PWM in us @@ -107,19 +114,6 @@ __BEGIN_DECLS */ typedef uint16_t servo_position_t; -/** - * Servo output status structure. - * - * May be published to output_pwm, or written to a PWM output - * device. - */ -struct pwm_output_values { - /** desired pulse widths for each of the supported channels */ - servo_position_t values[PWM_OUTPUT_MAX_CHANNELS]; - unsigned channel_count; -}; - - /** * RC config values for a channel * @@ -136,11 +130,6 @@ struct pwm_output_rc_config { bool rc_reverse; }; -/* - * ORB tag for PWM outputs. - */ -ORB_DECLARE(output_pwm); - /* * ioctl() definitions *