00001
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 #ifndef _QT60168_H_
00048 #define _QT60168_H_
00049
00050
00051
00052 #define QT60168_CMD_NULL_COMMAND 0x00
00053 #define QT60168_CMD_ENTER_SETUPS_MODE 0x01
00054 #define QT60168_CMD_CAL_ALL 0x03
00055 #define QT60168_CMD_FORCE_RESET 0x04
00056 #define QT60168_CMD_GENERAL_STATUS 0x05
00057 #define QT60168_CMD_REPORT_1ST_KEY 0x06
00058 #define QT60168_CMD_REPORT_ALL_KEYS 0x07
00059 #define QT60168_CMD_ERROR_FLAGS_FOR_ALL 0x0B
00060 #define QT60168_CMD_FMEA_STATUS 0x0C
00061 #define QT60168_CMD_DUMP_SETUPS 0x0D
00062 #define QT60168_CMD_EEPROM_CRC 0x0E
00063 #define QT60168_CMD_RETURN_LAST_CMMD 0x0F
00064 #define QT60168_CMD_INTERNAL_CODE_0X10 0x10
00065 #define QT60168_CMD_INTERNAL_CODE_0X12 0x12
00066 #define QT60168_CMD_DATA_FOR_1_KEY 0x40
00067 #define QT60168_CMD_STATUS_FOR_KEY_K 0x80
00068 #define QT60168_CMD_CAL_KEY_K 0xC0
00069
00070 #define QT60168_REPLY_FORCE_RESET 0xFB
00071 #define QT60168_REPLY_ENTER_SETUPS_MODE 0xFE
00072
00073 #define QT60168_STATUS_KEY_DETECTED_MASK 0x01
00074 #define QT60168_STATUS_KEY_IN_CALIBRATION_MASK 0x02
00075 #define QT60168_STATUS_CALIBRATION_FAILED_MASK 0x04
00076 #define QT60168_STATUS_MAIN_SYNC_ERROR_MASK 0x08
00077 #define QT60168_STATUS_FMEA_ERROR_MASK 0x20
00078 #define QT60168_STATUS_COMM_ERROR_MASK 0x40
00079
00080
00081 #define QT60168_KEY_STATUS_CAL_FAILED 0x01
00082 #define QT60168_KEY_STATUS_IN_CAL 0x02
00083 #define QT60168_KEY_STATUS_LOW_SIGNAL 0x04
00084 #define QT60168_KEY_STATUS_DETECTED 0x08
00085 #define QT60168_KEY_STATUS_ENABLED 0x10
00086
00087
00088 #define QT60168_MAX_NUMBER_OF_KEYS 24
00089
00090
00091 typedef struct
00092 {
00094 unsigned char ndrift_nthr;
00095
00097 unsigned char fdil_ndil;
00098
00100 unsigned char nrd;
00101
00103 unsigned char ssync_aks_bl;
00104 } qt60168_key_cfg_t;
00105
00106 typedef struct
00107 {
00108 qt60168_key_cfg_t key_cfg[QT60168_MAX_NUMBER_OF_KEYS];
00109
00111 unsigned char msync ;
00112
00114 unsigned char bs ;
00115
00117 unsigned short lsl ;
00118
00120 unsigned char crc ;
00121 }qt60168_setups_block_t;
00122
00123
00124
00129 void qt60168_init(U32 cpu_hz);
00130
00136 Bool qt60168_is_no_key_pressed( void );
00137
00145 Bool qt60168_is_key_pressed(U8 key);
00146
00159 int qt60168_report_all_key(void);
00160
00165 void qt60168_send_cmd(unsigned char cmd);
00166
00171 void qt60168_get_reply(unsigned short *data);
00172
00173 #endif
00174
00175
00176