Skip to content

karimelkheshen/crsf-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CRSF C Library

A small and tested C implementation of the CRSF protocol for UART links with no dynamic allocation or external dependencies.

What it includes

  • Frame build and parse helpers for supported frame types:
    • Channels
    • GPS
    • Link Statistics
    • Battery Sensor
    • Attitude
    • MSP Request/Response
  • Lightweight streaming parser.

Files

  • crsf.h Public API and protocol definitions.
  • crsf.c Core implementation.
  • crsf_parser.h Header-only streaming parser.

Basic Usage

Initialise the parser.

crsf_parser_t parser;
crsf_parser_init(&parser, CRSF_ADDRESS_FC, on_crsf_frame);

Feed incoming UART bytes.

crsf_parser_feed(&parser, rx_buffer, rx_len);

Build and send frames.

crsf_build_payload_channels(payload, &channels);
crsf_build_frame_channels(frame, CRSF_ADDRESS_RX, payload);

Reference

Based on the CRSF protocol specification.

About

Small, dependency free C implementation of the CRSF protocol.

Resources

License

Stars

2 stars

Watchers

0 watching

Forks

Contributors

Languages