Microchip® Advanced Software Framework

qdebug_transport.h File Reference
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>

Macros

#define _ROTOR_SLIDER_
 
#define INT(a, b)   ((a << 8) | b)
 
#define MESSAGE_START   0x1B
 
#define QT_NUM_CHANNELS   25
 
#define RX_BUFFER_SIZE   (QT_NUM_CHANNELS*4)+10
 
#define STATE_DATA   3
 
#define STATE_IDLE   0
 
#define STATE_LENGTH1   1
 
#define STATE_LENGTH2   2
 
#define TX_BUFFER_SIZE   (QT_NUM_CHANNELS*4)+10
 

Functions

uint8_t GetChar (void)
 Get one byte from the Receive Buffer RX_index is post incremented. More...
 
void Init_Buffers (void)
 Initialize the send and receive buffers Called from QDebug_Init. More...
 
void PutChar (uint8_t data)
 Puts one byte in the Transmit Buffer TX_index is post incremented. More...
 
void PutInt (uint16_t data)
 Puts two bytes in the Transmit Buffer Big Endian. More...
 
uint8_t Receive_Message (void)
 Executes a master read transmission if TWI is selected as interfaceChecks if RX_Buffer has a valid frame Called from QDebug_ProcessCommands in QDebug.c. More...
 
uint8_t RxHandler (uint8_t c)
 Handles the incomming bytes from the interface selected in QDebugSettings.h and puts the bytes in the RX_BufferUsed by SPI and TWI receive handlers. More...
 
void Send_Message (void)
 Send the content of the TX_Buffer to the USB Bridge using the interface selected in QDebugSettings.h Called from the transmit functions in QDebug.c. More...
 
void Set_datamode (unsigned char mode)
 

Variables

unsigned int gMsTimeout
 
uint8_t RF4CE_RX_Buffer [RX_BUFFER_SIZE]
 
uint8_t RX_Buffer [RX_BUFFER_SIZE]
 
uint16_t RX_index
 
uint8_t SequenceH
 
uint8_t SequenceL
 
uint8_t TX_Buffer [TX_BUFFER_SIZE]
 
uint16_t TX_index
 

#define _ROTOR_SLIDER_
#define INT (   a,
 
)    ((a << 8) | b)
#define MESSAGE_START   0x1B

Referenced by Init_Buffers().

#define QT_NUM_CHANNELS   25
#define RX_BUFFER_SIZE   (QT_NUM_CHANNELS*4)+10
#define STATE_DATA   3

Referenced by RxHandler().

#define STATE_IDLE   0

Referenced by RxHandler().

#define STATE_LENGTH1   1

Referenced by RxHandler().

#define STATE_LENGTH2   2

Referenced by RxHandler().

#define TX_BUFFER_SIZE   (QT_NUM_CHANNELS*4)+10

uint8_t GetChar ( void  )

Get one byte from the Receive Buffer RX_index is post incremented.

References RX_Buffer, and RX_index.

void Init_Buffers ( void  )

Initialize the send and receive buffers Called from QDebug_Init.

References MESSAGE_START, RX_Buffer, RX_index, TX_Buffer, and TX_index.

void PutChar ( uint8_t  data)

Puts one byte in the Transmit Buffer TX_index is post incremented.

References TX_Buffer, and TX_index.

Referenced by zrc_cmd_indication().

void PutInt ( uint16_t  data)

Puts two bytes in the Transmit Buffer Big Endian.

TX_index is post incremented

References TX_Buffer, and TX_index.

uint8_t Receive_Message ( void  )

Executes a master read transmission if TWI is selected as interfaceChecks if RX_Buffer has a valid frame Called from QDebug_ProcessCommands in QDebug.c.

Parameters
mdatacontains merged touch data in RF4CE packet
Returns
returns a true or false depending on whether a valid frame is available or not

References LED_0, LED_ON, pal_led(), RF4CE_RX_Buffer, RX_Buffer, RX_index, and twi_retrieve_message().

Referenced by app_task().

uint8_t RxHandler ( uint8_t  c)

Handles the incomming bytes from the interface selected in QDebugSettings.h and puts the bytes in the RX_BufferUsed by SPI and TWI receive handlers.

Parameters
cdata read by the selected interface
Returns
state returns a true if more data must be read returns a false if the frame is complete

References RX_Buffer, STATE_DATA, STATE_IDLE, STATE_LENGTH1, and STATE_LENGTH2.

Referenced by switch().

void Send_Message ( void  )

Send the content of the TX_Buffer to the USB Bridge using the interface selected in QDebugSettings.h Called from the transmit functions in QDebug.c.

References twi_send_message(), and TX_index.

void Set_datamode ( unsigned char  mode)

unsigned int gMsTimeout
uint8_t RF4CE_RX_Buffer[RX_BUFFER_SIZE]

Referenced by app_task(), and Receive_Message().

uint16_t RX_index
uint8_t SequenceH
uint8_t SequenceL
uint8_t TX_Buffer[TX_BUFFER_SIZE]
uint16_t TX_index