Microchip® Advanced Software Framework

QDebug.h File Reference
#include "touch_api.h"

Macros

Subscription definitions.
#define SUBS_SIGN_ON   0
 
#define SUBS_GLOBAL_CONFIG   1
 
#define SUBS_SENSOR_CONFIG   2
 
#define SUBS_SIGNALS   3
 
#define SUBS_REF   4
 
#define SUBS_DELTA   5
 
#define SUBS_STATES   6
 
PC commands.
#define QT_CMD_DUMMY   0x10
 
#define QT_CMD_SET_SUBS   0x11
 
#define QT_CMD_SET_GLOBAL_CONFIG   0x12
 
#define QT_CMD_SET_CH_CONFIG   0x13
 
#define QT_CMD_SET_QM_BURST_LENGTHS   0x14
 
#define QT_CMD_SET_USER_DATA   0x15
 
Touch MCU data packets.
#define QT_DUMMY   0x20
 
#define QT_SIGN_ON   0x21
 
#define QT_GLOBAL_CONFIG   0x22
 
#define QT_SENSOR_CONFIG   0x23
 
#define QT_SIGNALS   0x24
 
#define QT_REFERENCES   0x25
 
#define QT_DELTAS   0x26
 
#define QT_STATES   0x27
 

Functions

Public functions.
void QDebug_Init (void)
 This API initializes QDebug interface, including the low level hardware interface (SPI, TWI, USART etc). More...
 
void QDebug_ProcessCommands (void)
 Command handler for the data received from QTouch Studio. More...
 
void QDebug_SendData (uint16_t qt_lib_flags)
 Send data to QTouch Studio based on the subscription. More...
 
void QDebug_SetSubscriptions (uint16_t once, uint16_t change, uint16_t allways)
 Set subscription values. More...
 
Private functions.
void Set_Global_Config (void)
 Extract the data packet from QTouch Studio and set global config. More...
 
void Set_Channel_Config (void)
 Extract the data packet from QTouch Studio and set channel config. More...
 
void Set_Subscriptions (void)
 Set Data Subscription values. More...
 
void Set_Measurement_Period (void)
 Extract the data packet from QTouch Studio and set measurement period. More...
 
void Set_QT_User_Data (uint8_t *)
 Extracts user data from QTouch Studio to touch mcu memory. More...
 
void Transmit_Dummy (void)
 Transmits a dummy packet if no other subscriptions are set. More...
 
void Transmit_Sign_On (void)
 Transmits the sign on packet to QTouch Studio. More...
 
void Transmit_Global_Config (void)
 Transmits the global config struct to QTouch Studio. More...
 
void Transmit_Sensor_Config (void)
 Transmits the channel config struct to QTouch Studio. More...
 
void Transmit_Signals (void)
 Transmits the measurement values for each channel to QTouch Studio. More...
 
void Transmit_Ref (void)
 Transmits the channel reference values to QTouch Studio. More...
 
void Transmit_Delta (void)
 Transmits the channel delta values to QTouch Studio. More...
 
void Transmit_State (void)
 Transmits the state values to QTouch Studio. More...
 
void Transmit_QT_User_Data (uint8_t *pdata, uint16_t c)
 Transmits user data to QTouch Studio. More...
 
void Transmit_Time_Stamps (void)
 Transmits the application execution timestamp values to QTouch Studio. More...
 

#define QT_CMD_DUMMY   0x10
#define QT_CMD_SET_CH_CONFIG   0x13
#define QT_CMD_SET_GLOBAL_CONFIG   0x12
#define QT_CMD_SET_QM_BURST_LENGTHS   0x14
#define QT_CMD_SET_SUBS   0x11
#define QT_CMD_SET_USER_DATA   0x15
#define QT_DELTAS   0x26
#define QT_DUMMY   0x20
#define QT_GLOBAL_CONFIG   0x22
#define QT_REFERENCES   0x25
#define QT_SENSOR_CONFIG   0x23
#define QT_SIGN_ON   0x21
#define QT_SIGNALS   0x24
#define QT_STATES   0x27
#define SUBS_DELTA   5
#define SUBS_GLOBAL_CONFIG   1
#define SUBS_REF   4
#define SUBS_SENSOR_CONFIG   2
#define SUBS_SIGN_ON   0
#define SUBS_SIGNALS   3
#define SUBS_STATES   6

void QDebug_Init ( void  )

This API initializes QDebug interface, including the low level hardware interface (SPI, TWI, USART etc).

Note
Must be called before using any other QDebug API.
void QDebug_ProcessCommands ( void  )

Command handler for the data received from QTouch Studio.

Note
This function should be called in the main loop after measure_sensors to process the data received from QTOuch Studio.
void QDebug_SendData ( uint16_t  qt_lib_flags)

Send data to QTouch Studio based on the subscription.

Parameters
qt_lib_flags:Changeflag from measure_sensors.
void QDebug_SetSubscriptions ( uint16_t  once,
uint16_t  change,
uint16_t  allways 
)

Set subscription values.

Note
This function can be used directly in main to set data subscription if 1way SPI interface is used.
void Set_Channel_Config ( void  )

Extract the data packet from QTouch Studio and set channel config.

Note
Should only be called from the command handler.
void Set_Global_Config ( void  )

Extract the data packet from QTouch Studio and set global config.

Note
Should only be called from the command handler.
void Set_Measurement_Period ( void  )

Extract the data packet from QTouch Studio and set measurement period.

Note
Should only be called from the command handler.
void Set_QT_User_Data ( uint8_t *  )

Extracts user data from QTouch Studio to touch mcu memory.

Parameters
pdata,:data pointer.
Note
The data can be binary data.
void Set_Subscriptions ( void  )

Set Data Subscription values.

Note
Should only be called from the command handler.
void Transmit_Delta ( void  )

Transmits the channel delta values to QTouch Studio.

void Transmit_Dummy ( void  )

Transmits a dummy packet if no other subscriptions are set.

void Transmit_Global_Config ( void  )

Transmits the global config struct to QTouch Studio.

void Transmit_QT_User_Data ( uint8_t *  pdata,
uint16_t  c 
)

Transmits user data to QTouch Studio.

Parameters
pdata,:data pointer.
c,:length of data in bytes.
Note
The data will be binary data.
void Transmit_Ref ( void  )

Transmits the channel reference values to QTouch Studio.

void Transmit_Sensor_Config ( void  )

Transmits the channel config struct to QTouch Studio.

void Transmit_Sign_On ( void  )

Transmits the sign on packet to QTouch Studio.

void Transmit_Signals ( void  )

Transmits the measurement values for each channel to QTouch Studio.

void Transmit_State ( void  )

Transmits the state values to QTouch Studio.

void Transmit_Time_Stamps ( void  )

Transmits the application execution timestamp values to QTouch Studio.

Note
This value is a combination of current_time_ms_touch (high word) & timer counter register (low word).