|
Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
|
Crossfire (CRSF) Protocol Definitions and Helpers. More...
#include <zephyr/types.h>Go to the source code of this file.
Data Structures | |
| struct | crsf_payload_gps |
| GPS telemetry payload (Type 0x02). More... | |
| struct | crsf_payload_battery |
| Battery telemetry payload (Type 0x08). More... | |
| struct | crsf_link_stats |
| Link statistics payload (Type 0x14). More... | |
| struct | crsf_payload_attitude |
| Attitude telemetry payload (Type 0x1E). More... | |
Macros | |
RC Channel Conversion Helpers | |
Conversion between CRSF ticks and microseconds. | |
| #define | CRSF_TICKS_TO_US(x) |
| Convert CRSF channel ticks to microseconds. | |
| #define | CRSF_US_TO_TICKS(x) |
| Convert microseconds to CRSF channel ticks. | |
Enumerations | |
| enum | crsf_packet_type { CRSF_TYPE_GPS = 0x02 , CRSF_TYPE_BATTERY = 0x08 , CRSF_TYPE_LINK_TX_ID = 0x0A , CRSF_TYPE_LINK_STATS = 0x14 , CRSF_TYPE_RC_CHANNELS = 0x16 , CRSF_TYPE_ATTITUDE = 0x1E , CRSF_TYPE_FLIGHT_MODE = 0x21 , CRSF_TYPE_PING_DEVICES = 0x28 , CRSF_TYPE_DEVICE_INFO = 0x29 , CRSF_TYPE_PARAMETER_SETTINGS = 0x2B , CRSF_TYPE_COMMAND = 0x32 , CRSF_TYPE_RADIO_ID = 0x3A , CRSF_TYPE_AP_CUSTOM_TELEM = 0x80 } |
| CRSF packet (frame) types. More... | |
Functions | |
| int | input_crsf_send_telemetry (const struct device *dev, uint8_t type, uint8_t *payload, size_t payload_len) |
| Send a generic CRSF telemetry frame. | |
| struct crsf_link_stats | input_crsf_get_link_stats (const struct device *dev) |
| Retrieve the latest CRSF link statistics. | |
Crossfire (CRSF) Protocol Definitions and Helpers.
This module provides constants, packet type definitions, telemetry payload structures, and helper APIs for working with the CRSF (Crossfire) protocol used by RC transmitters and receivers.
It covers frame layout, telemetry payload formats, RC channel conversions, and link statistics access.
| #define CRSF_TICKS_TO_US | ( | x | ) |
Convert CRSF channel ticks to microseconds.
| x | CRSF channel value in ticks |
| #define CRSF_US_TO_TICKS | ( | x | ) |
Convert microseconds to CRSF channel ticks.
| x | Pulse width in microseconds |
| enum crsf_packet_type |
CRSF packet (frame) types.
| struct crsf_link_stats input_crsf_get_link_stats | ( | const struct device * | dev | ) |
Retrieve the latest CRSF link statistics.
| dev | Pointer to the CRSF input device |
| int input_crsf_send_telemetry | ( | const struct device * | dev, |
| uint8_t | type, | ||
| uint8_t * | payload, | ||
| size_t | payload_len ) |
Send a generic CRSF telemetry frame.
| dev | Pointer to the CRSF input device |
| type | Packet type (see crsf_packet_type) |
| payload | Pointer to payload buffer |
| payload_len | Payload length in bytes |