Autodrone
Multi-Domain Vehicle
ibus.h File Reference

This file initializes the ibus receiver protocol. More...

Go to the source code of this file.

Macros

#define IBUS_FRAME_SIZE_MAX   32
 
#define PAYLOAD_SIZE   (IBUS_FRAME_SIZE_MAX - 4U)
 
#define CRC_SIZE   2
 
#define RC_CHANNELS   (PAYLOAD_SIZE / 2U)
 
#define ARRAY_LEN(x)   (sizeof(x) / sizeof((x)[0]))
 

Enumerations

enum  { IBUS_STATE_LENGTH , IBUS_STATE_TYPE , IBUS_STATE_PAYLOAD , IBUS_STATE_CRC }
 
enum  ibusStatus_e { IBUS_READY , IBUS_BUSY , IBUS_ERROR }
 

Functions

bool ibusInit (void)
 Initializes ibus ring buffer and low level usart registers. More...
 
void ibusProcess (void)
 Waits for the parser to not be busy. More...
 

Variables

uint8_t ibusPayload [PAYLOAD_SIZE]
 
uint8_t ibusCRC [CRC_SIZE]
 
uint16_t ibusChannels [RC_CHANNELS]
 
bool rcActive
 

Detailed Description

This file initializes the ibus receiver protocol.

Author
Jeremy Wolfe
Date
23 FEB 2022

Macro Definition Documentation

◆ ARRAY_LEN

#define ARRAY_LEN (   x)    (sizeof(x) / sizeof((x)[0]))

◆ CRC_SIZE

#define CRC_SIZE   2

◆ IBUS_FRAME_SIZE_MAX

#define IBUS_FRAME_SIZE_MAX   32

◆ PAYLOAD_SIZE

#define PAYLOAD_SIZE   (IBUS_FRAME_SIZE_MAX - 4U)

◆ RC_CHANNELS

#define RC_CHANNELS   (PAYLOAD_SIZE / 2U)

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
IBUS_STATE_LENGTH 
IBUS_STATE_TYPE 
IBUS_STATE_PAYLOAD 
IBUS_STATE_CRC 

◆ ibusStatus_e

Enumerator
IBUS_READY 
IBUS_BUSY 
IBUS_ERROR 

Function Documentation

◆ ibusInit()

bool ibusInit ( void  )

Initializes ibus ring buffer and low level usart registers.

Returns
bool True if initialization was successful. False if failed.

◆ ibusProcess()

void ibusProcess ( void  )

Waits for the parser to not be busy.

Returns
Void.

Variable Documentation

◆ ibusChannels

uint16_t ibusChannels[RC_CHANNELS]
extern

◆ ibusCRC

uint8_t ibusCRC[CRC_SIZE]
extern

◆ ibusPayload

uint8_t ibusPayload[PAYLOAD_SIZE]
extern

◆ rcActive

bool rcActive
extern