Microchip® Advanced Software Framework

QDebugTransport.h File Reference
#include <parts.h>
#include "touch_api.h"

Macros

#define DEF_TOUCH_QDEBUG_ENABLE   0
 
#define DEF_TOUCH_QDEBUG_ENABLE_AT   0
 
#define DEF_TOUCH_QDEBUG_ENABLE_QM   0
 
#define DEF_TOUCH_QDEBUG_ENABLE_QTA   0
 
#define DEF_TOUCH_QDEBUG_ENABLE_QTB   0
 
#define INT(a, b)   ((a << 8) | b)
 
#define MESSAGE_START   0x1B
 
#define STATE_DATA   3
 
#define STATE_IDLE   0
 
#define STATE_LENGTH1   1
 
#define STATE_LENGTH2   2
 

Functions

uint8_t GetChar (void)
 Get one byte from the Receive Buffer. More...
 
void Init_Buffers (void)
 Initialize the send and receive buffers. More...
 
void PutChar (uint8_t data)
 Puts one byte in the Transmit Buffer. More...
 
void PutInt (uint16_t data)
 Puts two bytes in the Transmit Buffer. More...
 
uint8_t Receive_Message (void)
 Executes a master read transmission if TWI is selected as interface. Checks if RX_Buffer has a valid frame. More...
 
uint8_t RxHandler (uint8_t c)
 Handles the incoming bytes from the interface selected in QDebugSettings.h and puts the bytes in the RX_Buffer data read by the selected interface. More...
 
void Send_Message (void)
 Send the content of the TX_Buffer to the USB Bridge using the interface selected in QDebugSettings.h. More...
 

Variables

uint8_t RX_Buffer [RX_BUFFER_SIZE]
 RX Buffer globals. More...
 
uint16_t RX_index
 
uint8_t SequenceH
 
uint8_t SequenceL
 
uint8_t TX_Buffer [TX_BUFFER_SIZE]
 TX Buffer globals. More...
 
uint16_t TX_index
 

#define DEF_TOUCH_QDEBUG_ENABLE   0
#define DEF_TOUCH_QDEBUG_ENABLE_AT   0
#define DEF_TOUCH_QDEBUG_ENABLE_QM   0
#define DEF_TOUCH_QDEBUG_ENABLE_QTA   0
#define DEF_TOUCH_QDEBUG_ENABLE_QTB   0
#define INT (   a,
 
)    ((a << 8) | b)
#define MESSAGE_START   0x1B

Referenced by Init_Buffers().

#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().

uint8_t GetChar ( void  )

Get one byte from the Receive Buffer.

Returns
uint8_t: byte received.
Note
RX_index is post incremented.

References RX_Buffer, and RX_index.

Referenced by QDebug_ProcessCommands(), Set_Channel_Config(), Set_Global_Config(), and Set_Subscriptions().

void Init_Buffers ( void  )

Initialize the send and receive buffers.

Note
Called from QDebug_Init.

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

Referenced by QDebug_Init().

void PutChar ( uint8_t  data)

Puts one byte in the Transmit Buffer.

Parameters
data,:byte to be sent.
Note
Called from QDebug_Init.

References TX_Buffer, and TX_index.

Referenced by Set_QT_User_Data(), Transmit_Delta(), Transmit_Dummy(), Transmit_Global_Config(), Transmit_QT_User_Data(), Transmit_Ref(), Transmit_Sensor_Config(), Transmit_Sign_On(), Transmit_Signals(), and Transmit_State().

void PutInt ( uint16_t  data)

Puts two bytes in the Transmit Buffer.

Parameters
data,:16bit data to be sent.
Note
Big Endian. TX_index is post incremented.

References TX_Buffer, and TX_index.

Referenced by Transmit_Global_Config(), Transmit_Sign_On(), and Transmit_Time_Stamps().

uint8_t Receive_Message ( void  )

Executes a master read transmission if TWI is selected as interface. Checks if RX_Buffer has a valid frame.

Returns
uint8_t: returns a true or false dependent on whether a valid frame is available or not
Note
Called from QDebug_ProcessCommands in QDebug.c.
Returns
uint8_t: returns a true or false Dependant on whether a valid frame is available or not
Note
Called from QDebug_ProcessCommands in QDebug.c.

References RX_Buffer, and RX_index.

Referenced by QDebug_ProcessCommands().

uint8_t RxHandler ( uint8_t  c)

Handles the incoming bytes from the interface selected in QDebugSettings.h and puts the bytes in the RX_Buffer data read by the selected interface.

Returns
uint8_t: returns a true if more data must be read, returns a false if the frame is complete
Note
Used by SPI and TWI receive handlers.

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

Referenced by BitBangSPI_Send_Message().

void Send_Message ( void  )

Send the content of the TX_Buffer to the USB Bridge using the interface selected in QDebugSettings.h.

Note
Called from the transmit functions in QDebug.c.

References BitBangSPI_Send_Message(), SequenceH, SequenceL, TX_Buffer, and TX_index.

Referenced by Set_QT_User_Data(), Transmit_Delta(), Transmit_Dummy(), Transmit_Global_Config(), Transmit_QT_User_Data(), Transmit_Ref(), Transmit_Sensor_Config(), Transmit_Sign_On(), Transmit_Signals(), Transmit_State(), and Transmit_Time_Stamps().

uint8_t RX_Buffer[RX_BUFFER_SIZE]
uint16_t RX_index
uint8_t SequenceH

Referenced by QDebug_SendData(), and Send_Message().

uint8_t SequenceL

Referenced by Send_Message().

uint8_t TX_Buffer[TX_BUFFER_SIZE]

TX Buffer globals.

compile qdebug files only when QDebug is enabled.

Referenced by BitBangSPI_Send_Message(), Init_Buffers(), PutChar(), PutInt(), and Send_Message().

uint16_t TX_index