This file contains the QDebug public API that can be used to transfer data from a Touch Device to QTouch Studio using the QT600 USB Bridge.
Copyright (c) 2010-2018 Microchip Technology Inc. and its subsidiaries.
#include "QDebug_at32uc3l.h"
#include "compiler.h"
#include "QDebugTransport.h"
#include "QDebugSettings.h"
#include "SPI_Master.h"
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... | |
void | Set_Channel_Config (void) |
Extract the data packet from QTouch Studio and set channel config. More... | |
void | Set_Global_Config (void) |
Extract the data packet from QTouch Studio and set global config. 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 *pdata) |
Extract the data packet from QTouch Studio and set QMatrix burst lengths. More... | |
void | Set_Subscriptions (void) |
Set Data Subscription values. More... | |
void | Transmit_Delta (void) |
Transmits the channel delta values to QTouch Studio. More... | |
void | Transmit_Dummy (void) |
Transmits a dummy packet if no other subscriptions are set. More... | |
void | Transmit_Global_Config (void) |
Transmits the global config struct to QTouch Studio. More... | |
void | Transmit_QT_User_Data (uint8_t *pdata, uint16_t c) |
Transmits user data to QTouch Studio. More... | |
void | Transmit_Ref (void) |
Transmits the channel reference values to QTouch Studio. More... | |
void | Transmit_Sensor_Config (void) |
Transmits the channel config struct to QTouch Studio. More... | |
void | Transmit_Sign_On (void) |
Transmits the sign on packet to QTouch Studio. More... | |
void | Transmit_Signals (void) |
Transmits the measurement values for each channel to QTouch Studio. More... | |
void | Transmit_State (void) |
Transmits the state values to QTouch Studio. More... | |
void | Transmit_Time_Stamps (void) |
Transmits the QMatrix burst length values to QTouch Studio. More... | |
Variables | |
volatile int8_t | autonomous_qtouch_in_touch |
Flag set by touch_at_status_change_interrupt_callback() function when a fresh touch status is available. More... | |
static uint16_t | delivery = 0 |
uint16_t | measurement_period_ms |
Dummy variable for QDebug protocol for compatibility with QMatrix and QTouch. More... | |
static uint16_t | qgLibraryChanges = 0 |
uint8_t | qgRefschanged |
uint8_t | qgStateschanged |
static uint16_t | qgSubsAllways = 0 |
static uint16_t | qgSubsChange = 0 |
static uint16_t | qgSubsOnce = 0 |
uint16_t | timestamp1_hword |
Time stamp information. More... | |
uint16_t | timestamp1_lword |
uint16_t | timestamp2_hword |
uint16_t | timestamp2_lword |
uint16_t | timestamp3_hword |
uint16_t | timestamp3_lword |
touch_config_t | touch_config |
Touch Library input configuration structure. More... | |
static bool | transmit_dummy = true |
Object to get library info. | |
touch_info_t | at_libinfo |
void QDebug_Init | ( | void | ) |
This API initializes QDebug interface, including the low level hardware interface (SPI, TWI, USART etc).
References QDEBUG_GET_LIBINFO_FUNC, QDEBUG_LIBINFO, SPI_Master_Init(), and TOUCH_SUCCESS.
Referenced by main().
void QDebug_ProcessCommands | ( | void | ) |
Command handler for the data received from QTouch Studio.
References QT_CMD_DUMMY, QT_CMD_SET_CH_CONFIG, QT_CMD_SET_GLOBAL_CONFIG, QT_CMD_SET_QM_BURST_LENGTHS, QT_CMD_SET_SUBS, Set_Channel_Config(), Set_Global_Config(), Set_Measurement_Period(), Set_QM_Burst_Lengths(), and Set_Subscriptions().
Referenced by main().
void QDebug_SendData | ( | uint16_t | qt_lib_flags | ) |
Send data to QTouch Studio based on the subscription.
qt_lib_flags:Change | flag from measure_sensors. |
References delivery, qgLibraryChanges, qgSubsAllways, qgSubsChange, qgSubsOnce, SUBS_DELTA, SUBS_GLOBAL_CONFIG, SUBS_REF, SUBS_SENSOR_CONFIG, SUBS_SIGN_ON, SUBS_SIGNALS, SUBS_STATES, TOUCH_CHANNEL_REF_CHANGE, TOUCH_ROTOR_SLIDER_POS_CHANGE, TOUCH_STATUS_CHANGE, Transmit_Delta(), transmit_dummy, Transmit_Dummy(), Transmit_Global_Config(), Transmit_Ref(), Transmit_Sensor_Config(), Transmit_Sign_On(), Transmit_Signals(), and Transmit_State().
Referenced by main().
void QDebug_SetSubscriptions | ( | uint16_t | once, |
uint16_t | change, | ||
uint16_t | allways | ||
) |
Set subscription values.
References qgSubsAllways, qgSubsChange, and qgSubsOnce.
Referenced by Set_Subscriptions().
void Set_Channel_Config | ( | void | ) |
Extract the data packet from QTouch Studio and set channel config.
References tag_touch_qt_param_t::aks_group, tag_touch_qt_param_t::detect_hysteresis, tag_touch_qt_param_t::detect_threshold, QDEBUG_GET_SENSOR_CONFIG_FUNC, QDEBUG_UPDATE_SENSOR_CONFIG_FUNC, tag_touch_at_param_t::sense, TOUCH_SUCCESS, and UNUSED.
Referenced by QDebug_ProcessCommands().
void Set_Global_Config | ( | void | ) |
Extract the data packet from QTouch Studio and set global config.
References tag_touch_global_param_t::di, tag_touch_global_param_t::drift_hold_time, tag_touch_at_param_t::filter, tag_touch_global_param_t::max_on_duration, tag_touch_at_param_t::ndrift, tag_touch_global_param_t::neg_drift_rate, tag_touch_at_param_t::pdrift, tag_touch_global_param_t::pos_drift_rate, tag_touch_global_param_t::pos_recal_delay, tag_touch_at_param_t::pthr, QDEBUG_GET_GLOBAL_PARAM_FUNC, QDEBUG_UPDATE_GLOBAL_PARAM_FUNC, tag_touch_global_param_t::recal_threshold, TOUCH_SUCCESS, and UNUSED.
Referenced by QDebug_ProcessCommands().
void Set_Measurement_Period | ( | void | ) |
Extract the data packet from QTouch Studio and set measurement period.
References measurement_period_ms, and UNUSED.
Referenced by QDebug_ProcessCommands().
void Set_QT_User_Data | ( | uint8_t * | pdata | ) |
Extract the data packet from QTouch Studio and set QMatrix burst lengths.
Extracts user data from QTouch Studio to touch mcu memory.
Extracts user data from QTouch Studio to touch mcu memory.
pdata,: | data pointer. |
void Set_Subscriptions | ( | void | ) |
Set Data Subscription values.
References QDebug_SetSubscriptions().
Referenced by QDebug_ProcessCommands().
void Transmit_Delta | ( | void | ) |
Transmits the channel delta values to QTouch Studio.
References QDEBUG_NUM_SENSORS, QDEBUG_REFERENCES_PTR, QDEBUG_SIGNALS_PTR, QT_DELTAS, and UNUSED.
Referenced by QDebug_SendData().
void Transmit_Dummy | ( | void | ) |
Transmits a dummy packet if no other subscriptions are set.
References QT_DUMMY.
Referenced by QDebug_SendData().
void Transmit_Global_Config | ( | void | ) |
Transmits the global config struct to QTouch Studio.
References tag_touch_global_param_t::di, tag_touch_global_param_t::drift_hold_time, tag_touch_at_param_t::filter, tag_touch_global_param_t::max_on_duration, measurement_period_ms, tag_touch_at_param_t::ndrift, tag_touch_global_param_t::neg_drift_rate, tag_touch_at_param_t::pdrift, tag_touch_global_param_t::pos_drift_rate, tag_touch_global_param_t::pos_recal_delay, tag_touch_at_param_t::pthr, QDEBUG_GET_GLOBAL_PARAM_FUNC, QT_GLOBAL_CONFIG, tag_touch_global_param_t::recal_threshold, TOUCH_SUCCESS, and UNUSED.
Referenced by QDebug_SendData().
void Transmit_QT_User_Data | ( | uint8_t * | pdata, |
uint16_t | c | ||
) |
Transmits user data to QTouch Studio.
pdata,: | data pointer. |
c,: | length of data in bytes. |
void Transmit_Ref | ( | void | ) |
Transmits the channel reference values to QTouch Studio.
References QDEBUG_NUM_CHANNELS, QDEBUG_REFERENCES_PTR, and QT_REFERENCES.
Referenced by QDebug_SendData().
void Transmit_Sensor_Config | ( | void | ) |
Transmits the channel config struct to QTouch Studio.
References QDEBUG_GET_GLOBAL_PARAM_FUNC, QDEBUG_NUM_SENSORS, QT_SENSOR_CONFIG, tag_touch_at_param_t::sense, and TOUCH_SUCCESS.
Referenced by QDebug_SendData().
void Transmit_Sign_On | ( | void | ) |
Transmits the sign on packet to QTouch Studio.
References delivery, INTERFACE, PROJECT_ID, QDEBUG_LIBINFO, QDEBUG_NUM_CHANNELS, and QT_SIGN_ON.
Referenced by QDebug_SendData().
void Transmit_Signals | ( | void | ) |
Transmits the measurement values for each channel to QTouch Studio.
References QDEBUG_NUM_CHANNELS, QDEBUG_SIGNALS_PTR, and QT_SIGNALS.
Referenced by QDebug_SendData().
void Transmit_State | ( | void | ) |
Transmits the state values to QTouch Studio.
References autonomous_qtouch_in_touch, QDEBUG_NUM_CHANNELS, QDEBUG_NUM_ROTORS_SLIDERS, QDEBUG_NUM_SENSOR_STATE_BYTES, and QT_STATES.
Referenced by QDebug_SendData().
void Transmit_Time_Stamps | ( | void | ) |
Transmits the QMatrix burst length values to QTouch Studio.
Transmits the application execution timestamp values to QTouch Studio.
Transmits the application execution timestamp values to QTouch Studio.
References timestamp1_hword, timestamp1_lword, timestamp2_hword, timestamp2_lword, timestamp3_hword, and timestamp3_lword.
touch_info_t at_libinfo |
volatile int8_t autonomous_qtouch_in_touch |
Flag set by touch_at_status_change_interrupt_callback() function when a fresh touch status is available.
Referenced by touch_at_status_change_interrupt_callback(), and Transmit_State().
|
static |
Referenced by QDebug_SendData(), and Transmit_Sign_On().
uint16_t measurement_period_ms |
Dummy variable for QDebug protocol for compatibility with QMatrix and QTouch.
Referenced by Set_Measurement_Period(), and Transmit_Global_Config().
|
static |
Referenced by QDebug_SendData().
uint8_t qgRefschanged |
compile file only when QDebug is enabled.
These must somehow be updated from the library.
uint8_t qgStateschanged |
|
static |
Referenced by QDebug_SendData(), and QDebug_SetSubscriptions().
|
static |
Referenced by QDebug_SendData(), and QDebug_SetSubscriptions().
|
static |
Subscriptions.
Referenced by QDebug_SendData(), and QDebug_SetSubscriptions().
uint16_t timestamp1_hword |
Time stamp information.
Referenced by Transmit_Time_Stamps().
uint16_t timestamp1_lword |
Referenced by Transmit_Time_Stamps().
uint16_t timestamp2_hword |
Referenced by Transmit_Time_Stamps().
uint16_t timestamp2_lword |
Referenced by Transmit_Time_Stamps().
uint16_t timestamp3_hword |
Referenced by Transmit_Time_Stamps().
uint16_t timestamp3_lword |
Referenced by Transmit_Time_Stamps().
touch_config_t touch_config |
Touch Library input configuration structure.
Referenced by QDebug_SendData().