Microchip® Advanced Software Framework

QDebug_at32uc3l.h File Reference

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.

Macros

Subscription definitions.

compile file only when QDebug is enabled.

#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_MEASUREMENT_PERIOD   0x14
 
#define QT_CMD_SET_QM_BURST_LENGTHS   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
 
Macros for Autonomous QTouch API and data structure.
#define QDEBUG_SIGNALS_PTR   ((volatile uint16_t *)(0xFFFF6872u))
 
#define QDEBUG_REFERENCES_PTR   ((volatile uint16_t *)(0xFFFF686Eu))
 
#define QDEBUG_LIBINFO   at_libinfo
 
#define QDEBUG_NUM_SENSOR_STATE_BYTES   (1u)
 
#define QDEBUG_GET_LIBINFO_FUNC   touch_at_get_libinfo
 
#define QDEBUG_GET_GLOBAL_PARAM_FUNC   touch_at_sensor_get_config
 
#define QDEBUG_UPDATE_GLOBAL_PARAM_FUNC   touch_at_sensor_update_config
 
#define QDEBUG_GET_SENSOR_CONFIG_FUNC   touch_at_sensor_get_config
 
#define QDEBUG_UPDATE_SENSOR_CONFIG_FUNC   touch_at_sensor_update_config
 
#define QDEBUG_NUM_SENSORS   (1u)
 
#define QDEBUG_NUM_CHANNELS   (1u)
 
#define QDEBUG_NUM_ROTORS_SLIDERS   (0u)
 

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_QM_Burst_Lengths (void)
 Extract the data packet from QTouch Studio and set QMatrix burst lengths. More...
 
void Set_QT_User_Data (uint8_t *pdata)
 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_Burst_Lengths (void)
 Transmits the QMatrix burst length values to QTouch Studio. More...
 
void Transmit_Time_Stamps (void)
 Transmits the application execution timestamp values to QTouch Studio. More...
 
void Transmit_QT_User_Data (uint8_t *pdata, uint16_t c)
 Transmits user data to QTouch Studio. More...
 

Variables

touch_measure_data_tp_qm_measure_data
 
touch_measure_data_tp_qta_measure_data
 
touch_measure_data_tp_qtb_measure_data
 

#define QDEBUG_GET_GLOBAL_PARAM_FUNC   touch_at_sensor_get_config
#define QDEBUG_GET_LIBINFO_FUNC   touch_at_get_libinfo

Referenced by QDebug_Init().

#define QDEBUG_GET_SENSOR_CONFIG_FUNC   touch_at_sensor_get_config

Referenced by Set_Channel_Config().

#define QDEBUG_LIBINFO   at_libinfo

Referenced by QDebug_Init(), and Transmit_Sign_On().

#define QDEBUG_NUM_CHANNELS   (1u)
#define QDEBUG_NUM_ROTORS_SLIDERS   (0u)

Referenced by Transmit_State().

#define QDEBUG_NUM_SENSOR_STATE_BYTES   (1u)

Referenced by Transmit_State().

#define QDEBUG_NUM_SENSORS   (1u)
#define QDEBUG_REFERENCES_PTR   ((volatile uint16_t *)(0xFFFF686Eu))

Referenced by Transmit_Delta(), and Transmit_Ref().

#define QDEBUG_SIGNALS_PTR   ((volatile uint16_t *)(0xFFFF6872u))

Referenced by Transmit_Delta(), and Transmit_Signals().

#define QDEBUG_UPDATE_GLOBAL_PARAM_FUNC   touch_at_sensor_update_config

Referenced by Set_Global_Config().

#define QDEBUG_UPDATE_SENSOR_CONFIG_FUNC   touch_at_sensor_update_config

Referenced by Set_Channel_Config().

#define QT_CMD_DUMMY   0x10

Referenced by QDebug_ProcessCommands().

#define QT_CMD_SET_CH_CONFIG   0x13

Referenced by QDebug_ProcessCommands().

#define QT_CMD_SET_GLOBAL_CONFIG   0x12

Referenced by QDebug_ProcessCommands().

#define QT_CMD_SET_MEASUREMENT_PERIOD   0x14
#define QT_CMD_SET_QM_BURST_LENGTHS   0x15

Referenced by QDebug_ProcessCommands().

#define QT_CMD_SET_SUBS   0x11

Referenced by QDebug_ProcessCommands().

#define QT_DELTAS   0x26

Referenced by Transmit_Delta().

#define QT_DUMMY   0x20

Referenced by Transmit_Dummy().

#define QT_GLOBAL_CONFIG   0x22

Referenced by Transmit_Global_Config().

#define QT_REFERENCES   0x25

Referenced by Transmit_Ref().

#define QT_SENSOR_CONFIG   0x23

Referenced by Transmit_Sensor_Config().

#define QT_SIGN_ON   0x21

Referenced by Transmit_Sign_On().

#define QT_SIGNALS   0x24

Referenced by Transmit_Signals().

#define QT_STATES   0x27

Referenced by Transmit_State().

#define SUBS_DELTA   5

Referenced by QDebug_SendData().

#define SUBS_GLOBAL_CONFIG   1

Referenced by QDebug_SendData().

#define SUBS_REF   4

Referenced by QDebug_SendData().

#define SUBS_SENSOR_CONFIG   2

Referenced by QDebug_SendData().

#define SUBS_SIGN_ON   0

Referenced by QDebug_SendData().

#define SUBS_SIGNALS   3

Referenced by QDebug_SendData().

#define SUBS_STATES   6

Referenced by QDebug_SendData().

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.

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.

Note
This function should be called in the main loop after measure_sensors to process 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_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.

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.

Note
Should only be called from the command handler.

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_Measurement_Period ( void  )

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

Note
Should only be called from the command handler.

References measurement_period_ms, and UNUSED.

Referenced by QDebug_ProcessCommands().

void Set_QM_Burst_Lengths ( void  )

Extract the data packet from QTouch Studio and set QMatrix burst lengths.

Note
Should only be called from the command handler.

Referenced by QDebug_ProcessCommands().

void Set_QT_User_Data ( uint8_t *  pdata)

Extracts user data from QTouch Studio to touch mcu memory.

Parameters
pdata,:data pointer.
Note
The data can be binary data.

Extracts user data from QTouch Studio to touch mcu memory.

Note
Should only be called from the command handler.

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.

References QDebug_SetSubscriptions().

Referenced by QDebug_ProcessCommands().

void Transmit_Burst_Lengths ( void  )

Transmits the QMatrix burst length values to QTouch Studio.

Note
This value is available for each channel.
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_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.

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

Transmits the application execution timestamp values to QTouch Studio.

Note
This value is available for each channel.

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

References timestamp1_hword, timestamp1_lword, timestamp2_hword, timestamp2_lword, timestamp3_hword, and timestamp3_lword.

touch_measure_data_t* p_qm_measure_data

QMatrix measured data pointer.

touch_measure_data_t* p_qta_measure_data
touch_measure_data_t* p_qtb_measure_data