diff options
author | px4dev <px4@purgatory.org> | 2012-12-29 12:58:41 -0800 |
---|---|---|
committer | px4dev <px4@purgatory.org> | 2012-12-29 12:58:41 -0800 |
commit | 6b9d5dac4dd866903ed28f062a3c998a85058e63 (patch) | |
tree | e07009ee574482fa575f64865b7b41143487f2a9 /apps/px4io/protocol.h | |
parent | 6ede0e2f18f001afb390f3bbb0b989bdd2759c24 (diff) | |
download | px4-firmware-6b9d5dac4dd866903ed28f062a3c998a85058e63.tar.gz px4-firmware-6b9d5dac4dd866903ed28f062a3c998a85058e63.tar.bz2 px4-firmware-6b9d5dac4dd866903ed28f062a3c998a85058e63.zip |
Rough in the new mixer path for PX4IO.
Diffstat (limited to 'apps/px4io/protocol.h')
-rw-r--r-- | apps/px4io/protocol.h | 48 |
1 files changed, 37 insertions, 11 deletions
diff --git a/apps/px4io/protocol.h b/apps/px4io/protocol.h index c704b1201..080d33001 100644 --- a/apps/px4io/protocol.h +++ b/apps/px4io/protocol.h @@ -47,25 +47,21 @@ #pragma pack(push, 1) -/* command from FMU to IO */ +/** + * Periodic command from FMU to IO. + */ struct px4io_command { uint16_t f2i_magic; -#define F2I_MAGIC 0x636d +#define F2I_MAGIC 0x636d uint16_t servo_command[PX4IO_OUTPUT_CHANNELS]; bool relay_state[PX4IO_RELAY_CHANNELS]; bool arm_ok; }; -/* config message from FMU to IO */ -struct px4io_config { - uint16_t f2i_config_magic; -#define F2I_CONFIG_MAGIC 0x6366 - - /* XXX currently nothing here */ -}; - -/* report from IO to FMU */ +/** + * Periodic report from IO to FMU + */ struct px4io_report { uint16_t i2f_magic; #define I2F_MAGIC 0x7570 @@ -75,4 +71,34 @@ struct px4io_report { uint8_t channel_count; }; +/** + * As-needed config message from FMU to IO + */ +struct px4io_config { + uint16_t f2i_config_magic; +#define F2I_CONFIG_MAGIC 0x6366 + + /* XXX currently nothing here */ +}; + +/** + * As-needed mixer data upload. + * + * This message adds text to the mixer text buffer; the text + * buffer is drained as the definitions are consumed. + */ +struct px4io_mixdata { + uint16_t f2i_mixer_magic; +#define F2I_MIXER_MAGIC 0x6d74 + + uint8_t action; +#define F2I_MIXER_ACTION_RESET 0 +#define F2I_MIXER_ACTION_APPEND 1 + + char text[0]; /* actual text size may vary */ +}; + +/* maximum size is limited by the HX frame size */ +#define F2I_MIXER_MAX_TEXT (sizeof(struct px4io_mixdata) - HX_STREAM_MAX_FRAME) + #pragma pack(pop)
\ No newline at end of file |