Library to control a Graphics TFT connected to 4-wire SPI - revised for the Raio RA8875 Display Controller.

Dependents:   FRDM_RA8875_mPaint RA8875_Demo RA8875_KeyPadDemo SignalGenerator ... more

Fork of SPI_TFT by Peter Drescher

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers RA8875_Touch_FT5206.h Source File

RA8875_Touch_FT5206.h

00001 /// FT5206 Touch Controller definitions
00002 ///
00003 ///
00004 
00005 
00006 #ifndef RA8875_TOUCH_FT5206_H
00007 #define RA8875_TOUCH_FT5206_H
00008 
00009 /// FT5206 definitions follow
00010 #define FT5206_I2C_FREQUENCY                400000
00011 #define FT5206_I2C_ADDRESS                  0x38
00012 
00013 #define FT5206_TOUCH_POINTS                 5    // This chip can support only 5 touch points
00014 
00015 #define FT5206_NUMBER_OF_REGISTERS          31   // there are more registers, but this
00016                                                  // is enough to get all 5 touch coordinates.
00017 
00018 #define FT5206_NUMBER_OF_TOTAL_REGISTERS    0xFE
00019 
00020 #define FT5206_DEVICE_MODE                  0x00 // Normal, test, etc.
00021 #define FT5206_GEST_ID                      0x01 // Gesture detected
00022 #define FT5206_TD_STATUS                    0x02 // How many points detected (3:0). 1-5 is valid.
00023 
00024 #define FT5206_TOUCH1_XH                    0x03 // Event Flag, Touch X Position
00025 #define FT5206_TOUCH1_XL                    0x04
00026 #define FT5206_TOUCH1_YH                    0x05 // Touch ID, Touch Y Position
00027 #define FT5206_TOUCH1_YL                    0x06
00028 
00029 #define FT5206_TOUCH2_XH                    0x09 // Event Flag, Touch X Position
00030 #define FT5206_TOUCH2_XL                    0x0a
00031 #define FT5206_TOUCH2_YH                    0x0b // Touch ID, Touch Y Position
00032 #define FT5206_TOUCH2_YL                    0x0c
00033 
00034 #define FT5206_TOUCH3_XH                    0x0f // Event Flag, Touch X Position
00035 #define FT5206_TOUCH3_XL                    0x10
00036 #define FT5206_TOUCH3_YH                    0x11 // Touch ID, Touch Y Position
00037 #define FT5206_TOUCH3_YL                    0x12
00038 
00039 #define FT5206_TOUCH4_XH                    0x15 // Event Flag, Touch X Position
00040 #define FT5206_TOUCH4_XL                    0x16
00041 #define FT5206_TOUCH4_YH                    0x17 // Touch ID, Touch Y Position
00042 #define FT5206_TOUCH4_YL                    0x18
00043 
00044 #define FT5206_TOUCH5_XH                    0x1b // Event Flag, Touch X Position
00045 #define FT5206_TOUCH5_XL                    0x1c
00046 #define FT5206_TOUCH5_YH                    0x1d // Touch ID, Touch Y Position
00047 #define FT5206_TOUCH5_YL                    0x1e
00048 
00049 // For typical usage, the registers listed below are not used.
00050 #define FT5206_ID_G_THGROUP                 0x80 // Valid touching detect threshold
00051 #define FT5206_ID_G_THPEAK                  0x81 // Valid touching peak detect threshold
00052 #define FT5206_ID_G_THCAL                   0x82 // The threshold when calculating the focus of touching
00053 #define FT5206_ID_G_THWATER                 0x83 // The threshold when there is surface water
00054 #define FT5206_ID_G_THTEMP                  0x84 // The threshold of temperature compensation
00055 #define FT5206_ID_G_CTRL                    0x86 // Power control mode
00056 #define FT5206_ID_G_TIME_ENTER_MONITOR      0x87 // The timer of entering monitor status
00057 #define FT5206_ID_G_PERIODACTIVE            0x88 // Period Active
00058 #define FT5206_ID_G_PERIODMONITOR           0x89 // The timer of entering idle while in monitor status
00059 #define FT5206_ID_G_AUTO_CLB_MODE           0xA0 // Auto calibration mode
00060 
00061 #define FT5206_TOUCH_LIB_VERSION_H          0xA1 // Firmware Library Version H byte
00062 #define FT5206_TOUCH_LIB_VERSION_L          0xA2 // Firmware Library Version L byte
00063 #define FT5206_ID_G_CIPHER                  0xA3 // Chip vendor ID
00064 #define FT5206_G_MODE                       0xA4 // The interrupt status to host
00065 #define FT5206_ID_G_PMODE                   0xA5 // Power Consume Mode
00066 #define FT5206_FIRMID                       0xA6 // Firmware ID
00067 #define FT5206_ID_G_STATE                   0xA7 // Running State
00068 #define FT5206_ID_G_FT5201ID                0xA8 // CTPM Vendor ID
00069 #define FT5206_ID_G_ERR                     0xA9 // Error Code
00070 #define FT5206_ID_G_CLB                     0xAA // Configure TP module during calibration in Test Mode
00071 #define FT5206_ID_G_B_AREA_TH               0xAE // The threshold of big area
00072 #define FT5206_LOG_MSG_CNT                  0xFE // The log MSG count
00073 #define FT5206_LOG_CUR_CHA                  0xFF // Current character of log message, will point to the next
00074                                                  // character when one character is read.
00075 #define FT5206_GEST_ID_MOVE_UP              0x10
00076 #define FT5206_GEST_ID_MOVE_LEFT            0x14
00077 #define FT5206_GEST_ID_MOVE_DOWN            0x18
00078 #define FT5206_GEST_ID_MOVE_RIGHT           0x1c
00079 #define FT5206_GEST_ID_ZOOM_IN              0x48
00080 #define FT5206_GEST_ID_ZOOM_OUT             0x49
00081 #define FT5206_GEST_ID_NO_GESTURE           0x00
00082 
00083 #define FT5206_EVENT_FLAG_PUT_DOWN          0x00
00084 #define FT5206_EVENT_FLAG_PUT_UP            0x01
00085 #define FT5206_EVENT_FLAG_CONTACT           0x02
00086 #define FT5206_EVENT_FLAG_RESERVED          0x03
00087 
00088 #define FT5206_ID_G_POLLING_MODE            0x00
00089 #define FT5206_ID_G_TRIGGER_MODE            0x01
00090 
00091 #define FT5206_ID_G_PMODE_ACTIVE            0x00
00092 #define FT5206_ID_G_PMODE_MONITOR           0x01
00093 #define FT5206_ID_G_PMODE_HIBERNATE         0x03
00094 
00095 #define FT5206_ID_G_STATE_CONFIGURE         0x00
00096 #define FT5206_ID_G_STATE_WORK              0x01
00097 #define FT5206_ID_G_STATE_CALIBRATION       0x02
00098 #define FT5206_ID_G_STATE_FACTORY           0x03
00099 #define FT5206_ID_G_STATE_AUTO_CALIBRATION  0x04
00100 
00101 /// end of FT5206 definitions
00102 
00103 #endif // RA8875_TOUCH_FT5206_H