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_QM_Burst_Lengths (void) |
Set QMatrix burst lengthsShould 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_Burst_Lengths (void) |
Transmits the QMatrix burst length values to QTouch StudioThis value is available for each channel. 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 | 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 | 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 | 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 | 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 |
#define BitBangSPI 5 |
#define CTRL_REG1_DRDYE (0x20) |
#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) |
Referenced by accelero_init().
#define CTRL_REG1_PC1 (0x80) |
#define CTRL_REG1_RES (0x40) |
Referenced by accelero_init().
#define CTRL_REG1_TDTE (0x04) |
#define CTRL_REG1_TPE (0x01) |
Referenced by accelero_init().
#define CTRL_REG1_WUFE (0x02) |
Referenced by accelero_init().
#define CTRL_REG2_DOM (0x08) |
Referenced by accelero_init(), app_task(), and qt_avr477_filter_cb().
#define CTRL_REG2_FDM (0x02) |
Referenced by accelero_init(), and qt_avr477_filter_cb().
#define CTRL_REG2_FUM (0x01) |
Referenced by accelero_init(), and qt_avr477_filter_cb().
#define CTRL_REG2_LEM (0x20) |
Referenced by accelero_init(), and qt_avr477_filter_cb().
#define CTRL_REG2_RIM (0x10) |
Referenced by accelero_init(), and qt_avr477_filter_cb().
#define CTRL_REG2_UPM (0x04) |
Referenced by accelero_init(), app_task(), and qt_avr477_filter_cb().
#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().
#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().
#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().
#define CTRL_REG3_SRST (0x80) |
Referenced by accelero_init().
#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) |
#define DATA_CTRL_ODR_100HZ (0x03) |
#define DATA_CTRL_ODR_12_5HZ (0x00) |
#define DATA_CTRL_ODR_200HZ (0x04) |
Referenced by accelero_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 |
Referenced by accelero_read(), and accelero_write().
#define INT_CTRL_REG1_IEA (0x10) |
#define INT_CTRL_REG1_IEL (0x08) |
#define INT_CTRL_REG1_IEN (0x20) |
#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) |
Referenced by accelero_init().
#define KXTF9_CTRL_REG2 (0x1C) |
Referenced by accelero_init().
#define KXTF9_CTRL_REG3 (0x1D) |
Referenced by accelero_init().
#define KXTF9_DATA_CTRL_REG (0x21) |
Referenced by accelero_init().
#define KXTF9_DATA_RESOLUTION (12) |
#define KXTF9_HYST_SET (0x5E) |
#define KXTF9_ID_VAL (0x01) |
#define KXTF9_INT_CTRL_REG1 (0x1E) |
Referenced by accelero_init().
#define KXTF9_INT_CTRL_REG2 (0x1F) |
#define KXTF9_INT_CTRL_REG3 (0x20) |
#define KXTF9_INT_REL (0x1A) |
Referenced by accelero_init(), and app_task().
#define KXTF9_INT_SRC_REG1 (0x15) |
#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) |
#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().
#define KXTF9_TILT_POS_PRE (0x11) |
#define KXTF9_TILT_TIMER (0x28) |
Referenced by accelero_init().
#define KXTF9_TWI_ADDR (0x0f) |
List of the command IDs used in QDebug.
#define KXTF9_WHO_AM_I (0x0F) |
Referenced by accelero_init().
#define KXTF9_WUF_THRESH (0x5A) |
Referenced by accelero_init().
#define KXTF9_WUF_TIMER (0x29) |
Referenced by accelero_init().
#define KXTF9_XOUT_H (0x07) |
#define KXTF9_XOUT_HPF_H (0x01) |
#define KXTF9_XOUT_HPF_L (0x00) |
#define KXTF9_XOUT_L (0x06) |
#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 |
Referenced by Transmit_Sign_On().
#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 |
Referenced by Transmit_Delta().
#define QT_DUMMY 0x20 |
Referenced by Transmit_Dummy().
#define QT_GLOBAL_CONFIG 0x22 |
Referenced by Transmit_Global_Config().
#define QT_MESSAGE_START 0x1B |
#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 RF4CE_QDEBUG 6 |
#define SPI1W 2 |
#define SPI2W 3 |
#define STATUS_INT (0x10) |
#define SUBS_DELTA 5 |
Referenced by app_task().
#define SUBS_GLOBAL_CONFIG 1 |
Referenced by app_task().
#define SUBS_REF 4 |
Referenced by app_task(), and QDebug_SendData().
#define SUBS_SENSOR_CONFIG 2 |
Referenced by app_task().
#define SUBS_SIGN_ON 0 |
Referenced by app_task().
#define SUBS_SIGNALS 3 |
Referenced by app_task().
#define SUBS_STATES 6 |
Referenced by app_task(), and QDebug_SendData().
#define TILT_TIMER_INIT (6) |
Referenced by accelero_init().
#define TRUE 1 |
Referenced by accelero_read(), switch(), and twi_start_transceiver_with_data().
#define TWI 1 |
#define TWI_ADDRESS 0x0F |
Referenced by twi_start_transceiver_with_data().
#define TWI_ADR_BITS 1 |
Referenced by twi_start_transceiver_with_data().
#define TWI_ARB_LOST 0x38 |
Referenced by switch().
#define TWI_BUFFER_SIZE 0x0D |
#define TWI_BUS_ERROR 0x00 |
Referenced by switch().
#define TWI_MRX_ADR_ACK 0x40 |
Referenced by switch().
#define TWI_MRX_ADR_NACK 0x48 |
Referenced by switch().
#define TWI_MRX_DATA_ACK 0x50 |
Referenced by switch().
#define TWI_MRX_DATA_NACK 0x58 |
Referenced by switch().
#define TWI_MTX_ADR_ACK 0x18 |
Referenced by switch().
#define TWI_MTX_ADR_NACK 0x20 |
Referenced by switch().
#define TWI_MTX_DATA_ACK 0x28 |
Referenced by switch().
#define TWI_MTX_DATA_NACK 0x30 |
Referenced by switch().
#define TWI_NO_STATE 0xF8 |
Referenced by twi_start_transceiver(), and twi_start_transceiver_with_data().
#define TWI_READ_BIT 0 |
Referenced by twi_start_transceiver_with_data().
#define TWI_REP_START 0x10 |
Referenced by switch().
#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 |
Referenced by switch().
#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().
uint8_t GetChar | ( | void | ) |
Get one byte from the Receive BufferRX_index is post incremented.
Referenced by QDebug_ProcessCommands(), Set_Channel_Config(), Set_Global_Config(), Set_QM_Burst_Lengths(), and Set_Subscriptions().
void PutChar | ( | uint8_t | data | ) |
Puts one byte in the Transmit BufferTX_index is post incremented.
Referenced by Set_QT_User_Data(), Transmit_Burst_Lengths(), 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 BufferBig Endian.
TX_index is post incremented
Referenced by Transmit_Global_Config(), Transmit_Sign_On(), and Transmit_Time_Stamps().
void QDebug_Init | ( | void | ) |
Initialize Debug InterfaceMust be called before the main loop.
References Init_Buffers(), and qt_get_library_sig().
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
References GetChar(), QT_CMD_DUMMY, QT_CMD_SET_CH_CONFIG, QT_CMD_SET_GLOBAL_CONFIG, QT_CMD_SET_QM_BURST_LENGTHS, QT_CMD_SET_SUBS, QT_CMD_SET_USER_DATA, RX_Buffer, RX_index, Set_Channel_Config(), Set_Global_Config(), Set_QM_Burst_Lengths(), Set_QT_User_Data(), and Set_Subscriptions().
Referenced by vendor_data_ind().
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.
qt_lib_flags | Change flag from measure_sensors |
References delivery, qgLibraryChanges, qgSubsAllways, qgSubsChange, qgSubsOnce, QTLIB_CHANNEL_REF_CHANGE, QTLIB_ROTOR_SLIDER_POS_CHANGE, QTLIB_STATUS_CHANGE, SequenceH, SUBS_REF, and SUBS_STATES.
Referenced by app_task().
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
once | |
change | |
always |
References allow_to_sleep, EE_QDEBUG_OFFSET, pal_ps_set(), qgSubsAllways, qgSubsChange, and qgSubsOnce.
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.
c | data read by the selected interface |
References MESSAGE_START, STATE_DATA, STATE_IDLE, STATE_LENGTH1, and STATE_LENGTH2.
Referenced by vendor_data_ind().
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.
References TX_index, TX_OPTIONS, USER_CONTROL_PRESSED, and zrc_cmd_request().
Referenced by Set_QT_User_Data(), Transmit_Burst_Lengths(), 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().
void Set_Channel_Config | ( | void | ) |
Extract the data packet from QTouch Studio and set channel configShould only be called from the command handler.
References GetChar(), tag_sensor_t::threshold, and tag_sensor_t::type_aks_pos_hyst.
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.
References GetChar(), qt_config_data, tag_qt_touch_lib_config_data_t::qt_di, tag_qt_touch_lib_config_data_t::qt_drift_hold_time, tag_qt_touch_lib_config_data_t::qt_max_on_duration, qt_measurement_period_msec, tag_qt_touch_lib_config_data_t::qt_neg_drift_rate, tag_qt_touch_lib_config_data_t::qt_pos_drift_rate, tag_qt_touch_lib_config_data_t::qt_pos_recal_delay, and tag_qt_touch_lib_config_data_t::qt_recal_threshold.
Referenced by QDebug_ProcessCommands().
void Set_QM_Burst_Lengths | ( | void | ) |
Set QMatrix burst lengthsShould only be called from the command handler.
References GetChar(), qt_burst_lengths, and QT_NUM_CHANNELS.
Referenced by QDebug_ProcessCommands().
void Set_QT_User_Data | ( | uint8_t * | pdata | ) |
Extracts user data from QTouch Studio to touch mcu memoryThe data can be binary data.
References PutChar(), RX_Buffer, and Send_Message().
Referenced by QDebug_ProcessCommands().
void Set_Subscriptions | ( | void | ) |
Set Data Subscription valuesShould only be called from the command handler.
References GetChar(), and QDebug_SetSubscriptions().
Referenced by QDebug_ProcessCommands().
void Transmit_Burst_Lengths | ( | void | ) |
Transmits the QMatrix burst length values to QTouch StudioThis value is available for each channel.
References PutChar(), qt_burst_lengths, QT_NUM_CHANNELS, and Send_Message().
void Transmit_Delta | ( | void | ) |
Transmits the channel delta values to QTouch StudioThe value is equal to signal-reference.
References num_sensors, PutChar(), QT_DELTAS, qt_get_sensor_delta(), and Send_Message().
Referenced by app_task().
void Transmit_Dummy | ( | void | ) |
Transmits a dummy packet if no other subscriptions are set.
References PutChar(), QT_DUMMY, and Send_Message().
void Transmit_Global_Config | ( | void | ) |
Transmits the global config struct to QTouch Studio.
References PutChar(), PutInt(), qt_config_data, tag_qt_touch_lib_config_data_t::qt_di, tag_qt_touch_lib_config_data_t::qt_drift_hold_time, QT_GLOBAL_CONFIG, tag_qt_touch_lib_config_data_t::qt_max_on_duration, qt_measurement_period_msec, tag_qt_touch_lib_config_data_t::qt_neg_drift_rate, tag_qt_touch_lib_config_data_t::qt_pos_drift_rate, tag_qt_touch_lib_config_data_t::qt_pos_recal_delay, tag_qt_touch_lib_config_data_t::qt_recal_threshold, Send_Message(), and TICKS_PER_MS.
Referenced by app_task().
void Transmit_QT_User_Data | ( | uint8_t * | pdata, |
uint16_t | c | ||
) |
Transmits user data to QTouch StudioThe data will be binary data.
pdata | data pointer |
c | length of data in bytes |
References PutChar(), and Send_Message().
void Transmit_Sensor_Config | ( | void | ) |
Transmits the channel config struct to QTouch Studio.
References CHANNEL_19, PutChar(), QT_NUM_CHANNELS, QT_SENSOR_CONFIG, and Send_Message().
Referenced by app_task().
void Transmit_Sign_On | ( | void | ) |
Transmits the sign on packet to QTouch Studio.
References qt_lib_sig_info_t::lib_sig_lword, qt_lib_sig_info_t::library_version, PROJECT_ID, PutChar(), PutInt(), QT_NUM_CHANNELS, QT_SIGN_ON, and Send_Message().
Referenced by app_task().
void Transmit_Signals | ( | void | ) |
Transmits the measurement values for each channel to QTouch Studio.
References tag_qt_touch_lib_measure_data_t::channel_signals, PutChar(), qt_measure_data, QT_NUM_CHANNELS, QT_SIGNALS, and Send_Message().
Referenced by app_task().
void Transmit_State | ( | void | ) |
Transmits the state values to QTouch StudioOn/Off condition for each sensor.
References PutChar(), QT_MAX_NUM_ROTORS_SLIDERS, qt_measure_data, QT_NUM_CHANNELS, QT_NUM_SENSOR_STATE_BYTES, QT_STATES, tag_qt_touch_lib_measure_data_t::qt_touch_status, tag_qt_touch_status_t::rotor_slider_values, Send_Message(), and tag_qt_touch_status_t::sensor_states.
Referenced by app_task().
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)
References PutInt(), Send_Message(), timestamp1_hword, timestamp1_lword, timestamp2_hword, timestamp2_lword, timestamp3_hword, and timestamp3_lword.
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.
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, 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.
Referenced by accelero_read(), twi_get_data_from_transceiver(), twi_get_state_info(), twi_start_transceiver(), and twi_start_transceiver_with_data().
union TWI_statusReg TWI_statusReg |