Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
QDebug Related API's(Remote)

Functions

uint8_t GetChar (void)
 Get one byte from the Receive BufferRX_index is post incremented. More...
 
void PutChar (uint8_t data)
 Puts one byte in the Transmit BufferTX_index is post incremented. More...
 
void PutInt (uint16_t data)
 Puts two bytes in the Transmit BufferBig Endian. More...
 
void QDebug_Init (void)
 Initialize Debug InterfaceMust be called before the main loop. More...
 
void QDebug_ProcessCommands (void)
 Command handler for the data received from QTouch StudioThis function should be called in the main loop after measure_sensors to process the data received from QTOuch Studio More...
 
void QDebug_SendData (uint16_t qt_lib_flags)
 Send data to QTouch Studio based on the subscriptionThis function should be called in the main loop after measure_sensors to send the measured touch data. More...
 
void QDebug_SetSubscriptions (uint16_t once, uint16_t change, uint16_t allways)
 Set subscription values. 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.hCalled from the transmit functions in QDebug.c. More...
 
void Set_Channel_Config (void)
 Extract the data packet from QTouch Studio and set channel configShould only be called from the command handler. More...
 
void Set_Global_Config (void)
 Extract the data packet from QTouch Studio and set global configShould only be called from the command handler. More...
 
void Set_QT_User_Data (uint8_t *pdata)
 Extracts user data from QTouch Studio to touch mcu memoryThe data can be binary data. More...
 
void Set_Subscriptions (void)
 Set Data Subscription valuesShould only be called from the command handler. More...
 
void Transmit_Delta (void)
 Transmits the channel delta values to QTouch StudioThe value is equal to signal-reference. 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 StudioThe data will be binary data. 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 StudioOn/Off condition for each sensor. More...
 
void Transmit_Time_Stamps (void)
 Transmits the application execution timestamp values to QTouch StudioThis value is a combination of current_time_ms_touch (high word) & timer counter register (low word) More...
 
unsigned char twi_get_data_from_transceiver (unsigned char *msg, unsigned char msgSize)
 Call this function to read out the requested data from the TWI transceiver buffer. More...
 
unsigned char twi_get_state_info (void)
 Call this function to fetch the state information of the previous operation. More...
 
void twi_master_initialise (void)
 Call this function to set up the TWI master to its initial standby state. More...
 
void twi_start_transceiver (void)
 Call this function to resend the last message. More...
 
void twi_start_transceiver_with_data (unsigned char *msg, unsigned char msgSize, unsigned char direction, unsigned char index)
 Call this function to send a prepared message. More...
 
unsigned char twi_transceiver_busy (void)
 Call this function to test if the TWI_ISR is busy transmitting.e. More...
 
#define QT8   0xF001
 
#define QT16   0xF002
 
#define QM64   0xF003
 
#define TWI   1
 
#define SPI1W   2
 
#define SPI2W   3
 
#define UART   4
 
#define BitBangSPI   5
 
#define RF4CE_QDEBUG   6
 
#define QDEBUG_RF4CE
 
#define PROJECT_ID   0x1
 
#define INTERFACE   RF4CE_QDEBUG
 
#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
 
#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
 
#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
 
#define QT_MESSAGE_START   0x1B
 
#define KXTF9_TWI_ADDR   (0x0f)
 List of the command IDs used in QDebug. More...
 
#define KXTF9_ID_VAL   (0x01)
 
#define KXTF9_DATA_RESOLUTION   (12)
 
#define TILT_TIMER_INIT   (6)
 
#define WUF_TIMER_INIT   (4)
 
#define KXTF9_XOUT_HPF_L   (0x00)
 
#define KXTF9_XOUT_HPF_H   (0x01)
 
#define KXTF9_YOUT_HPF_L   (0x02)
 
#define KXTF9_YOUT_HPF_H   (0x03)
 
#define KXTF9_ZOUT_HPF_L   (0x04)
 
#define KXTF9_ZOUT_HPF_H   (0x05)
 
#define KXTF9_XOUT_L   (0x06)
 
#define KXTF9_XOUT_H   (0x07)
 
#define KXTF9_YOUT_L   (0x08)
 
#define KXTF9_YOUT_H   (0x09)
 
#define KXTF9_ZOUT_L   (0x0A)
 
#define KXTF9_ZOUT_H   (0x0B)
 
#define KXTF9_ST_RESP   (0x0C)
 
#define KXTF9_WHO_AM_I   (0x0F)
 
#define KXTF9_TILT_POS_CUR   (0x10)
 
#define KXTF9_TILT_POS_PRE   (0x11)
 
#define KXTF9_INT_SRC_REG1   (0x15)
 
#define KXTF9_INT_SRC_REG2   (0x16)
 
#define KXTF9_STATUS_REG   (0x18)
 
#define KXTF9_INT_REL   (0x1A)
 
#define KXTF9_CTRL_REG1   (0x1B)
 
#define KXTF9_CTRL_REG2   (0x1C)
 
#define KXTF9_CTRL_REG3   (0x1D)
 
#define KXTF9_INT_CTRL_REG1   (0x1E)
 
#define KXTF9_INT_CTRL_REG2   (0x1F)
 
#define KXTF9_INT_CTRL_REG3   (0x20)
 
#define KXTF9_DATA_CTRL_REG   (0x21)
 
#define KXTF9_TILT_TIMER   (0x28)
 
#define KXTF9_WUF_TIMER   (0x29)
 
#define KXTF9_TDT_TIMER   (0x2B)
 
#define KXTF9_TDT_H_THRESH   (0x2C)
 
#define KXTF9_TDT_L_THRESH   (0x2D)
 
#define KXTF9_TDT_TAP_TIMER   (0x2E)
 
#define KXTF9_TDT_TOTAL_TIMER   (0x2F)
 
#define KXTF9_TDT_LATENCY_TIMER   (0x30)
 
#define KXTF9_TDT_WINDOW_TIMER   (0x31)
 
#define KXTF9_SELF_TEST   (0x3A)
 
#define KXTF9_WUF_THRESH   (0x5A)
 
#define KXTF9_TILT_ANGLE   (0x5C)
 
#define KXTF9_HYST_SET   (0x5E)
 
#define STATUS_INT   (0x10)
 
#define CTRL_REG1_TPE   (0x01)
 
#define CTRL_REG1_WUFE   (0x02)
 
#define CTRL_REG1_TDTE   (0x04)
 
#define CTRL_REG1_GSEL   (0x18)
 
#define CTRL_REG1_GSEL_2G   (0x00)
 
#define CTRL_REG1_GSEL_4G   (0x08)
 
#define CTRL_REG1_GSEL_8G   (0x10)
 
#define CTRL_REG1_PC1   (0x80)
 
#define CTRL_REG1_DRDYE   (0x20)
 
#define CTRL_REG1_RES   (0x40)
 
#define CTRL_REG1_PC1   (0x80)
 
#define CTRL_REG2_FUM   (0x01)
 
#define CTRL_REG2_FDM   (0x02)
 
#define CTRL_REG2_UPM   (0x04)
 
#define CTRL_REG2_DOM   (0x08)
 
#define CTRL_REG2_RIM   (0x10)
 
#define CTRL_REG2_LEM   (0x20)
 
#define CTRL_REG3_OWUF   (0x03)
 
#define CTRL_REG3_OWUF_25HZ   (0x00)
 
#define CTRL_REG3_OWUF_50HZ   (0x01)
 
#define CTRL_REG3_OWUF_100HZ   (0x02)
 
#define CTRL_REG3_OWUF_200HZ   (0x03)
 
#define CTRL_REG3_OTDT   (0x0C)
 
#define CTRL_REG3_OTDT_50HZ   (0x00)
 
#define CTRL_REG3_OTDT_100HZ   (0x04)
 
#define CTRL_REG3_OTDT_200HZ   (0x08)
 
#define CTRL_REG3_OTDT_400HZ   (0x0C)
 
#define CTRL_REG3_DCST   (0x10)
 
#define CTRL_REG3_OTP   (0x60)
 
#define CTRL_REG3_OTP_1_6HZ   (0x00)
 
#define CTRL_REG3_OTP_6_3HZ   (0x20)
 
#define CTRL_REG3_OTP_12_5HZ   (0x40)
 
#define CTRL_REG3_OTP_50HZ   (0x60)
 
#define CTRL_REG3_SRST   (0x80)
 
#define INT_CTRL_REG1_IEU   (0x04)
 
#define INT_CTRL_REG1_IEL   (0x08)
 
#define INT_CTRL_REG1_IEA   (0x10)
 
#define INT_CTRL_REG1_IEN   (0x20)
 
#define INT_CTRL_REG2_XBW   (0x80)
 
#define INT_CTRL_REG2_YBW   (0x40)
 
#define INT_CTRL_REG2_ZBW   (0x20)
 
#define DATA_CTRL_ODR   (0x07)
 
#define DATA_CTRL_ODR_12_5HZ   (0x00)
 
#define DATA_CTRL_ODR_25HZ   (0x01)
 
#define DATA_CTRL_ODR_50HZ   (0x02)
 
#define DATA_CTRL_ODR_100HZ   (0x03)
 
#define DATA_CTRL_ODR_200HZ   (0x04)
 
#define DATA_CTRL_ODR_400HZ   (0x05)
 
#define DATA_CTRL_ODR_800HZ   (0x06)
 
#define DATA_CTRL_HPFRO   (0x30)
 
#define DATA_CTRL_HPFRO_50HZ   (0x00)
 
#define DATA_CTRL_HPFRO_100HZ   (0x10)
 
#define DATA_CTRL_HPFRO_200HZ   (0x20)
 
#define DATA_CTRL_HPFRO_400HZ   (0x30)
 
#define TWI_BUFFER_SIZE   0x0D
 
#define TWI_TWBR   0xA0
 
union TWI_statusReg TWI_statusReg
 
#define TWI_ADDRESS   0x0F
 
#define TWI_READ_BIT   0
 
#define TWI_ADR_BITS   1
 
#define TRUE   1
 
#define FALSE   0
 
#define TWI_START   0x08
 
#define TWI_REP_START   0x10
 
#define TWI_ARB_LOST   0x38
 
#define TWI_MTX_ADR_ACK   0x18
 
#define TWI_MTX_ADR_NACK   0x20
 
#define TWI_MTX_DATA_ACK   0x28
 
#define TWI_MTX_DATA_NACK   0x30
 
#define TWI_MRX_ADR_ACK   0x40
 
#define TWI_MRX_ADR_NACK   0x48
 
#define TWI_MRX_DATA_ACK   0x50
 
#define TWI_MRX_DATA_NACK   0x58
 
#define TWI_STX_ADR_ACK   0xA8
 
#define TWI_STX_ADR_ACK_M_ARB_LOST   0xB0
 
#define TWI_STX_DATA_ACK   0xB8
 
#define TWI_STX_DATA_NACK   0xC0
 
#define TWI_STX_DATA_ACK_LAST_BYTE   0xC8
 
#define TWI_SRX_ADR_ACK   0x60
 
#define TWI_SRX_ADR_ACK_M_ARB_LOST   0x68
 
#define TWI_SRX_GEN_ACK   0x70
 
#define TWI_SRX_GEN_ACK_M_ARB_LOST   0x78
 
#define TWI_SRX_ADR_DATA_ACK   0x80
 
#define TWI_SRX_ADR_DATA_NACK   0x88
 
#define TWI_SRX_GEN_DATA_ACK   0x90
 
#define TWI_SRX_GEN_DATA_NACK   0x98
 
#define TWI_SRX_STOP_RESTART   0xA0
 
#define TWI_NO_STATE   0xF8
 
#define TWI_BUS_ERROR   0x00
 

Private functions.

void Set_Measurement_Period (void)
 Extract the data packet from QTouch Studio and set measurement period. More...
 
void Transmit_Ref (void)
 Transmits the channel reference values to QTouch Studio. More...
 

#define BitBangSPI   5
#define CTRL_REG1_DRDYE   (0x20)

Referenced by kxtf9_event().

#define CTRL_REG1_GSEL   (0x18)

Referenced by kxtf9_set_range().

#define CTRL_REG1_GSEL_2G   (0x00)
#define CTRL_REG1_GSEL_4G   (0x08)
#define CTRL_REG1_GSEL_8G   (0x10)
#define CTRL_REG1_PC1   (0x80)
#define CTRL_REG1_PC1   (0x80)
#define CTRL_REG1_RES   (0x40)

Referenced by accelero_init(), and kxtf9_init().

#define CTRL_REG1_TDTE   (0x04)

Referenced by kxtf9_event().

#define CTRL_REG1_TPE   (0x01)

Referenced by accelero_init(), and kxtf9_event().

#define CTRL_REG1_WUFE   (0x02)

Referenced by accelero_init(), and kxtf9_event().

#define CTRL_REG2_DOM   (0x08)
#define CTRL_REG2_FDM   (0x02)
#define CTRL_REG2_FUM   (0x01)
#define CTRL_REG2_LEM   (0x20)
#define CTRL_REG2_RIM   (0x10)
#define CTRL_REG2_UPM   (0x04)
#define CTRL_REG3_DCST   (0x10)
#define CTRL_REG3_OTDT   (0x0C)
#define CTRL_REG3_OTDT_100HZ   (0x04)
#define CTRL_REG3_OTDT_200HZ   (0x08)
#define CTRL_REG3_OTDT_400HZ   (0x0C)

Referenced by accelero_init(), and kxtf9_init().

#define CTRL_REG3_OTDT_50HZ   (0x00)
#define CTRL_REG3_OTP   (0x60)
#define CTRL_REG3_OTP_12_5HZ   (0x40)
#define CTRL_REG3_OTP_1_6HZ   (0x00)
#define CTRL_REG3_OTP_50HZ   (0x60)
#define CTRL_REG3_OTP_6_3HZ   (0x20)

Referenced by accelero_init(), and kxtf9_init().

#define CTRL_REG3_OWUF   (0x03)
#define CTRL_REG3_OWUF_100HZ   (0x02)
#define CTRL_REG3_OWUF_200HZ   (0x03)
#define CTRL_REG3_OWUF_25HZ   (0x00)
#define CTRL_REG3_OWUF_50HZ   (0x01)

Referenced by accelero_init(), and kxtf9_init().

#define CTRL_REG3_SRST   (0x80)
#define DATA_CTRL_HPFRO   (0x30)
#define DATA_CTRL_HPFRO_100HZ   (0x10)
#define DATA_CTRL_HPFRO_200HZ   (0x20)
#define DATA_CTRL_HPFRO_400HZ   (0x30)
#define DATA_CTRL_HPFRO_50HZ   (0x00)
#define DATA_CTRL_ODR   (0x07)

Referenced by kxtf9_set_bandwidth().

#define DATA_CTRL_ODR_100HZ   (0x03)
#define DATA_CTRL_ODR_12_5HZ   (0x00)
#define DATA_CTRL_ODR_200HZ   (0x04)

Referenced by accelero_init(), and kxtf9_init().

#define DATA_CTRL_ODR_25HZ   (0x01)
#define DATA_CTRL_ODR_400HZ   (0x05)
#define DATA_CTRL_ODR_50HZ   (0x02)
#define DATA_CTRL_ODR_800HZ   (0x06)
#define FALSE   0
#define INT_CTRL_REG1_IEA   (0x10)

Referenced by kxtf9_event(), and kxtf9_init().

#define INT_CTRL_REG1_IEL   (0x08)

Referenced by kxtf9_event(), and kxtf9_init().

#define INT_CTRL_REG1_IEN   (0x20)

Referenced by kxtf9_event(), and kxtf9_init().

#define INT_CTRL_REG1_IEU   (0x04)
#define INT_CTRL_REG2_XBW   (0x80)
#define INT_CTRL_REG2_YBW   (0x40)
#define INT_CTRL_REG2_ZBW   (0x20)
#define INTERFACE   RF4CE_QDEBUG
#define KXTF9_CTRL_REG1   (0x1B)
#define KXTF9_CTRL_REG2   (0x1C)

Referenced by accelero_init().

#define KXTF9_CTRL_REG3   (0x1D)
#define KXTF9_DATA_CTRL_REG   (0x21)
#define KXTF9_DATA_RESOLUTION   (12)

Referenced by kxtf9_init().

#define KXTF9_HYST_SET   (0x5E)
#define KXTF9_ID_VAL   (0x01)

Referenced by kxtf9_init().

#define KXTF9_INT_CTRL_REG1   (0x1E)
#define KXTF9_INT_CTRL_REG2   (0x1F)
#define KXTF9_INT_CTRL_REG3   (0x20)

Referenced by kxtf9_set_tap().

#define KXTF9_INT_REL   (0x1A)

Referenced by accelero_init(), app_task(), and kxtf9_init().

#define KXTF9_INT_SRC_REG1   (0x15)

Referenced by kxtf9_isr().

#define KXTF9_INT_SRC_REG2   (0x16)

Referenced by app_task().

#define KXTF9_SELF_TEST   (0x3A)
#define KXTF9_ST_RESP   (0x0C)
#define KXTF9_STATUS_REG   (0x18)
#define KXTF9_TDT_H_THRESH   (0x2C)
#define KXTF9_TDT_L_THRESH   (0x2D)
#define KXTF9_TDT_LATENCY_TIMER   (0x30)
#define KXTF9_TDT_TAP_TIMER   (0x2E)
#define KXTF9_TDT_TIMER   (0x2B)

Referenced by kxtf9_set_tap().

#define KXTF9_TDT_TOTAL_TIMER   (0x2F)
#define KXTF9_TDT_WINDOW_TIMER   (0x31)
#define KXTF9_TILT_ANGLE   (0x5C)
#define KXTF9_TILT_POS_CUR   (0x10)

Referenced by app_task(), and kxtf9_isr().

#define KXTF9_TILT_POS_PRE   (0x11)
#define KXTF9_TILT_TIMER   (0x28)

Referenced by accelero_init(), and kxtf9_init().

#define KXTF9_TWI_ADDR   (0x0f)

List of the command IDs used in QDebug.

#define KXTF9_WHO_AM_I   (0x0F)
#define KXTF9_WUF_THRESH   (0x5A)
#define KXTF9_WUF_TIMER   (0x29)

Referenced by accelero_init(), and kxtf9_init().

#define KXTF9_XOUT_H   (0x07)
#define KXTF9_XOUT_HPF_H   (0x01)
#define KXTF9_XOUT_HPF_L   (0x00)
#define KXTF9_XOUT_L   (0x06)

Referenced by kxtf9_init().

#define KXTF9_YOUT_H   (0x09)
#define KXTF9_YOUT_HPF_H   (0x03)
#define KXTF9_YOUT_HPF_L   (0x02)
#define KXTF9_YOUT_L   (0x08)
#define KXTF9_ZOUT_H   (0x0B)
#define KXTF9_ZOUT_HPF_H   (0x05)
#define KXTF9_ZOUT_HPF_L   (0x04)
#define KXTF9_ZOUT_L   (0x0A)
#define PROJECT_ID   0x1
#define QDEBUG_RF4CE
#define QM64   0xF003
#define QT16   0xF002
#define QT8   0xF001
#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_QM_BURST_LENGTHS   0x14

Referenced by QDebug_ProcessCommands().

#define QT_CMD_SET_SUBS   0x11

Referenced by QDebug_ProcessCommands().

#define QT_CMD_SET_USER_DATA   0x15

Referenced by QDebug_ProcessCommands().

#define QT_DELTAS   0x26
#define QT_DUMMY   0x20

Referenced by Transmit_Dummy().

#define QT_GLOBAL_CONFIG   0x22
#define QT_MESSAGE_START   0x1B
#define QT_REFERENCES   0x25
#define QT_SENSOR_CONFIG   0x23
#define QT_SIGN_ON   0x21
#define QT_SIGNALS   0x24
#define QT_STATES   0x27
#define RF4CE_QDEBUG   6
#define SPI1W   2
#define SPI2W   3
#define STATUS_INT   (0x10)

Referenced by kxtf9_isr().

#define SUBS_DELTA   5

Referenced by app_task(), and QDebug_SendData().

#define SUBS_GLOBAL_CONFIG   1

Referenced by app_task(), and QDebug_SendData().

#define SUBS_REF   4

Referenced by app_task(), and QDebug_SendData().

#define SUBS_SENSOR_CONFIG   2

Referenced by app_task(), and QDebug_SendData().

#define SUBS_SIGN_ON   0

Referenced by app_task(), and QDebug_SendData().

#define SUBS_SIGNALS   3

Referenced by app_task(), and QDebug_SendData().

#define SUBS_STATES   6

Referenced by app_task(), and QDebug_SendData().

#define TILT_TIMER_INIT   (6)

Referenced by accelero_init(), and kxtf9_init().

#define TRUE   1
#define TWI   1
#define TWI_ADDRESS   0x0F
#define TWI_ADR_BITS   1
#define TWI_ARB_LOST   0x38
#define TWI_BUFFER_SIZE   0x0D
#define TWI_BUS_ERROR   0x00
#define TWI_MRX_ADR_ACK   0x40
#define TWI_MRX_ADR_NACK   0x48
#define TWI_MRX_DATA_ACK   0x50
#define TWI_MRX_DATA_NACK   0x58
#define TWI_MTX_ADR_ACK   0x18
#define TWI_MTX_ADR_NACK   0x20
#define TWI_MTX_DATA_ACK   0x28
#define TWI_MTX_DATA_NACK   0x30
#define TWI_NO_STATE   0xF8
#define TWI_READ_BIT   0
#define TWI_REP_START   0x10
#define TWI_SRX_ADR_ACK   0x60
#define TWI_SRX_ADR_ACK_M_ARB_LOST   0x68
#define TWI_SRX_ADR_DATA_ACK   0x80
#define TWI_SRX_ADR_DATA_NACK   0x88
#define TWI_SRX_GEN_ACK   0x70
#define TWI_SRX_GEN_ACK_M_ARB_LOST   0x78
#define TWI_SRX_GEN_DATA_ACK   0x90
#define TWI_SRX_GEN_DATA_NACK   0x98
#define TWI_SRX_STOP_RESTART   0xA0
#define TWI_START   0x08
#define TWI_STX_ADR_ACK   0xA8
#define TWI_STX_ADR_ACK_M_ARB_LOST   0xB0
#define TWI_STX_DATA_ACK   0xB8
#define TWI_STX_DATA_ACK_LAST_BYTE   0xC8
#define TWI_STX_DATA_NACK   0xC0
#define TWI_TWBR   0xA0

Referenced by twi_master_initialise().

#define UART   4
#define WUF_TIMER_INIT   (4)

Referenced by accelero_init(), and kxtf9_init().

uint8_t GetChar ( void  )

Get one byte from the Receive BufferRX_index is post incremented.

Get one byte from the Receive Buffer.

void PutChar ( uint8_t  data)

Puts one byte in the Transmit BufferTX_index is post incremented.

Puts one byte in the Transmit Buffer.

References data.

void PutInt ( uint16_t  data)

Puts two bytes in the Transmit BufferBig Endian.

Puts two bytes in the Transmit Buffer.

TX_index is post incremented

References data.

void QDebug_Init ( void  )

Initialize Debug InterfaceMust be called before the main loop.

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

Referenced by main().

void QDebug_ProcessCommands ( void  )

Command handler for the data received from QTouch StudioThis function should be called in the main loop after measure_sensors to process the data received from QTOuch Studio

Command handler for the data received from QTouch Studio.

Referenced by main().

void QDebug_SendData ( uint16_t  qt_lib_flags)

Send data to QTouch Studio based on the subscriptionThis function should be called in the main loop after measure_sensors to send the measured touch data.

Send data to QTouch Studio based on the subscription.

Parameters
qt_lib_flagsChange flag from measure_sensors

Referenced by app_task(), and main().

void QDebug_SetSubscriptions ( uint16_t  once,
uint16_t  change,
uint16_t  allways 
)

Set subscription values.

This function can be used directly in main to set data subscription if 1way SPI interface is used

Parameters
once
change
always

Referenced by Set_Subscriptions().

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.

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.

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

References MESSAGE_START, state, STATE_DATA, STATE_IDLE, STATE_LENGTH1, and STATE_LENGTH2.

void Send_Message ( void  )

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

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

References TX_index, TX_OPTIONS, and USER_CONTROL_PRESSED.

void Set_Channel_Config ( void  )

Extract the data packet from QTouch Studio and set channel configShould only be called from the command handler.

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

Referenced by QDebug_ProcessCommands().

void Set_Global_Config ( void  )

Extract the data packet from QTouch Studio and set global configShould only be called from the command handler.

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

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.
void Set_QT_User_Data ( uint8_t *  pdata)

Extracts user data from QTouch Studio to touch mcu memoryThe data can be binary data.

Extracts user data from QTouch Studio to touch mcu memory.

Referenced by QDebug_ProcessCommands().

void Set_Subscriptions ( void  )

Set Data Subscription valuesShould only be called from the command handler.

Set Data Subscription values.

Referenced by QDebug_ProcessCommands().

void Transmit_Delta ( void  )

Transmits the channel delta values to QTouch StudioThe value is equal to signal-reference.

Transmits the channel delta values to QTouch Studio.

Referenced by app_task(), and QDebug_SendData().

void Transmit_Dummy ( void  )

Transmits a dummy packet if no other subscriptions are set.

Referenced by QDebug_SendData().

void Transmit_Global_Config ( void  )

Transmits the global config struct to QTouch Studio.

Referenced by app_task(), and QDebug_SendData().

void Transmit_QT_User_Data ( uint8_t *  pdata,
uint16_t  c 
)

Transmits user data to QTouch StudioThe data will be binary data.

Transmits user data to QTouch Studio.

Parameters
pdatadata pointer
clength of data in bytes
void Transmit_Ref ( void  )

Transmits the channel reference values to QTouch Studio.

Note

References tag_qt_touch_lib_measure_data_t::channel_references, PutChar(), qt_measure_data, QT_NUM_CHANNELS, QT_REFERENCES, and Send_Message().

Referenced by app_task(), and QDebug_SendData().

void Transmit_Sensor_Config ( void  )

Transmits the channel config struct to QTouch Studio.

Referenced by app_task(), and QDebug_SendData().

void Transmit_Sign_On ( void  )

Transmits the sign on packet to QTouch Studio.

Referenced by app_task(), and QDebug_SendData().

void Transmit_Signals ( void  )

Transmits the measurement values for each channel to QTouch Studio.

Referenced by app_task(), and QDebug_SendData().

void Transmit_State ( void  )

Transmits the state values to QTouch StudioOn/Off condition for each sensor.

Transmits the state values to QTouch Studio.

Referenced by app_task(), and QDebug_SendData().

void Transmit_Time_Stamps ( void  )

Transmits the application execution timestamp values to QTouch StudioThis 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.

unsigned char twi_get_data_from_transceiver ( unsigned char *  msg,
unsigned char  msgSize 
)

Call this function to read out the requested data from the TWI transceiver buffer.

first call twi_start_transceiver to send a request for data to the slave. Then Run this function to collect the data when they have arrived. Include a pointer to where to place the data and the number of bytes requested (including the address field) in the function call. The function will hold execution (loop) until the TWI_ISR has completed with the previous operation, before reading out the data and returning.

If there was an error in the previous transmission *the function will return the TWI error code.called when the TWI interrupt is triggered; that is whenever a TWI event has occurred. This function should not be called directly from the main application.

References TWI_statusReg::lastTransOK, TWI_buf, and twi_transceiver_busy().

Referenced by accelero_read().

unsigned char twi_get_state_info ( void  )

Call this function to fetch the state information of the previous operation.

The function will hold execution (loop) until the TWI_ISR has completed with the previous operation.

Returns
If there was an error, then the function will return the TWI State code.

References TWI_state, and twi_transceiver_busy().

void twi_master_initialise ( void  )

Call this function to set up the TWI master to its initial standby state.

Remember to enable interrupts from the main application after initializing the TWI.

References TWI_TWBR.

Referenced by accelero_init().

void twi_start_transceiver ( void  )

Call this function to resend the last message.

The driver will reuse the data previously put in the transceiver buffers. The function will hold execution (loop) until the TWI_ISR has completed with the previous operation, then initialize the next operation and return.

References TWI_statusReg::all, TWI_NO_STATE, TWI_state, and twi_transceiver_busy().

void twi_start_transceiver_with_data ( unsigned char *  msg,
unsigned char  msgSize,
unsigned char  direction,
unsigned char  index 
)

Call this function to send a prepared message.

The first byte must contain the slave address and the read/write bit. Consecutive bytes contain the data to be sent, or empty locations for data to be read from the slave. Also include how many bytes that should be sent/read including the address byte. The function will hold execution (loop) until the TWI_ISR has completed with the previous operation, then initialize the next operation and return.

References TWI_statusReg::all, temp, TRUE, TWI_ADDRESS, TWI_ADR_BITS, TWI_buf, TWI_msgSize, TWI_NO_STATE, TWI_READ_BIT, TWI_state, and twi_transceiver_busy().

Referenced by accelero_read(), and accelero_write().

unsigned char twi_transceiver_busy ( void  )

Call this function to test if the TWI_ISR is busy transmitting.e.

Call this function to test if the TWI_ISR is busy transmitting.

Returns
Whether Transmitter is busy