Serial Wombat 18AB Firmware
Macros | Functions | Variables
protocol.c File Reference
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "serialWombat.h"
#include "asciiConversion.h"

Macros

#define PROTOCOL_MAX_CAPTURED_PACKETS   256
 
#define OUTPUT_I2C_DEBUG(_value)   {}
 
#define CRCCCITT_POLYNOMIAL   ((unsigned short)0x1021)
 
#define CRCCCITT_SEED_VALUE   ((unsigned short)0x84CF)
 

Functions

void ProcessSetPin (void)
 
void uartStartTX ()
 
void error (SW_ERROR_t errorCode)
 
void ProcessRx (void)
 
void crcAppSpace (uint32_t address_w, uint32_t length_w)
 
void processCapturedCommands ()
 

Variables

uint32_t debug_discarded_bytes = 0
 
uint8_t SW_I2CAddress = 0x6B
 
bool UART2ndInterface = false
 
uint8_t UartRxbufferCounter = 0
 
uint8_t UartTxbufferCounter = 0
 
uint8_t Rxbuffer [RXBUFFER_LENGTH]
 
uint8_t Txbuffer [TXBUFFER_LENGTH]
 
bool LineBreaksAndEcho = false
 
volatile bool ResponsePending = false
 
volatile bool ResponseAvailable = false
 
volatile uint8_t TX_ClockStretching = 0
 
volatile uint8_t RX_ClockStretching = 0
 
uint16_t lastUserBufferIndex = 0xFFFF
 
uint16_t lastQueueIndex = 0xFFFF
 
uint8_t testSequenceNumber = 0
 
bool testSequenceArmed = 0
 
bool protocolCapturingPackets = false
 
uint16_t protocolCapturedPackets = 0
 
uint8_t lastErrorPacket [8]
 
pinRegister_t PinRegisterCopyBuffer
 
timingResourceManager_t TimingResourceManagerCopyBuffer
 
volatile unsigned short crcResultCRCCCITT = 0
 
uint16_t Errors = 0
 
uint16_t PacketsProcessed = 0
 

Macro Definition Documentation

◆ CRCCCITT_POLYNOMIAL

#define CRCCCITT_POLYNOMIAL   ((unsigned short)0x1021)

◆ CRCCCITT_SEED_VALUE

#define CRCCCITT_SEED_VALUE   ((unsigned short)0x84CF)

◆ OUTPUT_I2C_DEBUG

#define OUTPUT_I2C_DEBUG (   _value)    {}

◆ PROTOCOL_MAX_CAPTURED_PACKETS

#define PROTOCOL_MAX_CAPTURED_PACKETS   256

Function Documentation

◆ crcAppSpace()

void crcAppSpace ( uint32_t  address_w,
uint32_t  length_w 
)

◆ error()

void error ( SW_ERROR_t  errorCode)

◆ processCapturedCommands()

void processCapturedCommands ( )

◆ ProcessRx()

void ProcessRx ( void  )

◆ ProcessSetPin()

void ProcessSetPin ( void  )

◆ uartStartTX()

void uartStartTX ( )

Variable Documentation

◆ crcResultCRCCCITT

volatile unsigned short crcResultCRCCCITT = 0

◆ debug_discarded_bytes

uint32_t debug_discarded_bytes = 0

◆ Errors

uint16_t Errors = 0

◆ lastErrorPacket

uint8_t lastErrorPacket[8]

◆ lastQueueIndex

uint16_t lastQueueIndex = 0xFFFF

◆ lastUserBufferIndex

uint16_t lastUserBufferIndex = 0xFFFF

◆ LineBreaksAndEcho

bool LineBreaksAndEcho = false

◆ PacketsProcessed

uint16_t PacketsProcessed = 0

◆ PinRegisterCopyBuffer

pinRegister_t PinRegisterCopyBuffer

◆ protocolCapturedPackets

uint16_t protocolCapturedPackets = 0

◆ protocolCapturingPackets

bool protocolCapturingPackets = false

◆ ResponseAvailable

volatile bool ResponseAvailable = false

◆ ResponsePending

volatile bool ResponsePending = false

◆ RX_ClockStretching

volatile uint8_t RX_ClockStretching = 0

◆ Rxbuffer

uint8_t Rxbuffer[RXBUFFER_LENGTH]

◆ SW_I2CAddress

uint8_t SW_I2CAddress = 0x6B

◆ testSequenceArmed

bool testSequenceArmed = 0

◆ testSequenceNumber

uint8_t testSequenceNumber = 0

◆ TimingResourceManagerCopyBuffer

timingResourceManager_t TimingResourceManagerCopyBuffer

◆ TX_ClockStretching

volatile uint8_t TX_ClockStretching = 0

◆ Txbuffer

uint8_t Txbuffer[TXBUFFER_LENGTH]

◆ UART2ndInterface

bool UART2ndInterface = false

◆ UartRxbufferCounter

uint8_t UartRxbufferCounter = 0

◆ UartTxbufferCounter

uint8_t UartTxbufferCounter = 0