SerialIO
Loading...
Searching...
No Matches
crsf Class Reference

A class for handling CRSF protocol communication. More...

#include <crsf.h>

Inheritance diagram for crsf:
[legend]
Collaboration diagram for crsf:
[legend]

Public Member Functions

 crsf (Stream *rxPort, int rxPin=-1, int txPin=-1, bool inverted=false)
 Constructor for the CRSF class.
 
void begin () override
 Initializes the CRSF communication.
 
void processIncoming () override
 Processes incoming CRSF data.
 
void getChannel (rc_channels_t *channelData) override
 Retrieves the decoded RC channels from the received CRSF data.
 
uint8_t crc8 (uint8_t *data, uint8_t len)
 
- Public Member Functions inherited from SerialIO
 SerialIO (Stream *rxPort, int rxPin, int txPin, bool inverted)
 Constructor for the SerialIO class.
 

Additional Inherited Members

- Protected Member Functions inherited from SerialIO
void leftShift (uint8_t arr[], size_t size)
 
void rightShift (uint8_t arr[], size_t size)
 
- Protected Attributes inherited from SerialIO
Stream * _rxPort
 
bool _inverted
 
int _rxPin
 
int _txPin
 

Detailed Description

A class for handling CRSF protocol communication.

Constructor & Destructor Documentation

◆ crsf()

crsf::crsf ( Stream * rxPort,
int rxPin = -1,
int txPin = -1,
bool inverted = false )
explicit

Constructor for the CRSF class.

Parameters
rxPortReference to the hardware serial port for RX communication.
rxPinThe RX pin number.
txPinThe TX pin number.
invertedWhether the serial signal is inverted (true) or not (false).

Member Function Documentation

◆ begin()

void crsf::begin ( )
overridevirtual

Initializes the CRSF communication.

Implements SerialIO.

◆ getChannel()

void crsf::getChannel ( rc_channels_t * channelData)
overridevirtual

Retrieves the decoded RC channels from the received CRSF data.

Parameters
channelDataPointer to a crsf_channels_t struct where the decoded channel data will be stored.

Implements SerialIO.

◆ processIncoming()

void crsf::processIncoming ( )
overridevirtual

Processes incoming CRSF data.

Implements SerialIO.


The documentation for this class was generated from the following files: