Browse Source

PWM out driver: Move to generated uORB topic

sbg
Lorenz Meier 10 years ago
parent
commit
b0a9679fca
  1. 3
      msg/output_pwm.msg
  2. 27
      src/drivers/drv_pwm_output.h

3
msg/output_pwm.msg

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
uint8 PWM_OUTPUT_MAX_CHANNELS = 16
uint16[16] values
uint32 channel_count

27
src/drivers/drv_pwm_output.h

@ -61,10 +61,17 @@ __BEGIN_DECLS @@ -61,10 +61,17 @@ __BEGIN_DECLS
#define PWM_OUTPUT_BASE_DEVICE_PATH "/dev/pwm_output"
#define PWM_OUTPUT0_DEVICE_PATH "/dev/pwm_output0"
#include <uORB/topics/output_pwm.h>
#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 @@ -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 { @@ -136,11 +130,6 @@ struct pwm_output_rc_config {
bool rc_reverse;
};
/*
* ORB tag for PWM outputs.
*/
ORB_DECLARE(output_pwm);
/*
* ioctl() definitions
*

Loading…
Cancel
Save