diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2012-11-05 16:04:45 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2012-11-05 16:04:45 +0100 |
commit | e7f2c053c241849e3ea035fcd22a0e29945b3415 (patch) | |
tree | 704d9d21d46ba670ef1ec0286f24aa272e6cca25 /apps/drivers/drv_rc_input.h | |
parent | 39659e57f817c4f49be595d6cecf05e67e2d89db (diff) | |
download | px4-firmware-e7f2c053c241849e3ea035fcd22a0e29945b3415.tar.gz px4-firmware-e7f2c053c241849e3ea035fcd22a0e29945b3415.tar.bz2 px4-firmware-e7f2c053c241849e3ea035fcd22a0e29945b3415.zip |
Quickly separated low-level raw RC from mapped / scaled RC, supports FMU PPM and IO PPM / Spektrum now
Diffstat (limited to 'apps/drivers/drv_rc_input.h')
-rw-r--r-- | apps/drivers/drv_rc_input.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/apps/drivers/drv_rc_input.h b/apps/drivers/drv_rc_input.h index 532e95fb5..927406108 100644 --- a/apps/drivers/drv_rc_input.h +++ b/apps/drivers/drv_rc_input.h @@ -57,15 +57,23 @@ #define RC_INPUT_DEVICE_PATH "/dev/input_rc" /** - * Maximum number of R/C input channels in the system. + * Maximum number of R/C input channels in the system. S.Bus has up to 18 channels. */ -#define RC_INPUT_MAX_CHANNELS 16 +#define RC_INPUT_MAX_CHANNELS 18 /** * Input signal type, value is a control position from zero to 100 * percent. */ -typedef uint8_t rc_input_t; +typedef uint16_t rc_input_t; + +enum RC_INPUT_SOURCE { + RC_INPUT_SOURCE_UNKNOWN = 0, + RC_INPUT_SOURCE_PX4FMU_PPM, + RC_INPUT_SOURCE_PX4IO_PPM, + RC_INPUT_SOURCE_PX4IO_SPEKTRUM, + RC_INPUT_SOURCE_PX4IO_SBUS +}; /** * R/C input status structure. @@ -74,10 +82,16 @@ typedef uint8_t rc_input_t; * on the board involved. */ struct rc_input_values { + /** decoding time */ + uint64_t timestamp; + /** number of channels actually being seen */ uint32_t channel_count; - /** desired pulse widths for each of the supported channels */ + /** Input source */ + enum RC_INPUT_SOURCE input_source; + + /** measured pulse widths for each of the supported channels */ rc_input_t values[RC_INPUT_MAX_CHANNELS]; }; |