mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-20 20:03:54 +08:00
PWM out driver: Move to generated uORB topic
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
uint8 PWM_OUTPUT_MAX_CHANNELS = 16
|
||||
uint16[16] values
|
||||
uint32 channel_count
|
||||
@@ -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
|
||||
*/
|
||||
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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user