46 #ifndef __D4DTCH_CR_TOUCH_H
47 #define __D4DTCH_CR_TOUCH_H
49 #if (D4D_MK_STR(D4D_LLD_TCH) == d4dtch_cr_touch_ID)
54 #include "d4dtch_cr_touch_cfg.h"
59 #define D4D_CRTCH_STATUS 0x00
60 #define D4D_CRTCH_STATUS1 0x01
61 #define D4D_CRTCH_STATUS2 0x02
62 #define D4D_CRTCH_X 0x03
63 #define D4D_CRTCH_Y 0x05
64 #define D4D_CRTCH_PRESS 0x07
65 #define D4D_CRTCH_FIFO_ST 0x09
66 #define D4D_CRTCH_FIFO_X 0x0A
67 #define D4D_CRTCH_FIFO_Y 0x0C
68 #define D4D_CRTCH_FIFO_PRESS 0x0E
69 #define D4D_CRTCH_UART_BAUD 0x10
71 #define D4D_CRTCH_RES_CFG 0x40
74 #define D4D_CRTCH_STATUS1_RTST_MASK 0x80
75 #define D4D_CRTCH_STATUS1_RTSRDY_MASK 0x01
77 #define D4D_CRTCH_RES_CFG_RTPRESEN_MASK 0x80
79 #define D4D_CRTCH_STATUS2_RTSD_MASK 0x03
85 #ifndef D4DTCH_FULL_SCALE
86 #define D4DTCH_FULL_SCALE 0x0FFF
89 #ifndef D4DTCH_X_TOUCH_MIN
90 #define D4DTCH_X_TOUCH_MIN (D4DTCH_FULL_SCALE / 10)
93 #ifndef D4DTCH_Y_TOUCH_MIN
94 #define D4DTCH_Y_TOUCH_MIN (D4DTCH_FULL_SCALE / 10)
97 #ifndef D4DTCH_X_TOUCH_OFFMAX
98 #define D4DTCH_X_TOUCH_OFFMAX (D4DTCH_X_TOUCH_MIN * 4 / 2)
101 #ifndef D4DTCH_Y_TOUCH_OFFMAX
102 #define D4DTCH_Y_TOUCH_OFFMAX (D4DTCH_Y_TOUCH_MIN * 4 / 2)
105 #ifndef D4DTCH_SAMPLE_MARGIN
106 #define D4DTCH_SAMPLE_MARGIN (D4DTCH_FULL_SCALE / 256)
110 #ifndef D4DTCH_IIC_BAUDRATE
111 #define D4DTCH_IIC_BAUDRATE 400000
114 #ifndef D4DTCH_IIC_ADDRESS
115 #define D4DTCH_IIC_ADDRESS 0x49
118 #ifndef D4DTCH_INVERSE_X
119 #define D4DTCH_INVERSE_X 0
122 #ifndef D4DTCH_INVERSE_Y
123 #define D4DTCH_INVERSE_Y 0
126 #ifndef D4DTCH_SWAP_AXES
127 #define D4DTCH_SWAP_AXES 0
132 #ifndef D4D_CRTCH_TOUCHPANDING_PORT
133 #define D4D_CRTCH_TOUCHPANDING_PORT B
137 #ifndef D4D_CRTCH_TOUCHPENDING_PIN
138 #define D4D_CRTCH_TOUCHPENDING_PIN 22
142 #ifndef D4D_CRTCH_TOUCHPENDING_PCR_MUX
143 #define D4D_CRTCH_TOUCHPENDING_PCR_MUX 1
147 #ifndef D4D_CRTCH_TOUCHPENDING_PCR_FLAGS
148 #define D4D_CRTCH_TOUCHPENDING_PCR_FLAGS (PORT_PCR_PS_MASK | PORT_PCR_PE_MASK)
152 #ifndef D4D_CRTCH_TOUCHPENDING_SCGC
153 #define D4D_CRTCH_TOUCHPENDING_SCGC 5
157 #ifndef D4D_CRTCH_TOUCHPENDING_SIM_SCGC
158 #define D4D_CRTCH_TOUCHPENDING_SIM_SCGC D4D_PASTE(SIM_SCGC, D4D_CRTCH_TOUCHPENDING_SCGC)
162 #ifndef D4D_CRTCH_TOUCHPENDING_SIM_SCGC_MASK
163 #define D4D_CRTCH_TOUCHPENDING_SIM_SCGC_MASK D4D_PASTE(D4D_PASTE(SIM_SCGC, D4D_PASTE(D4D_CRTCH_TOUCHPENDING_SCGC, _PORT)), D4D_PASTE(D4D_CRTCH_TOUCHPANDING_PORT, _MASK))
167 #ifndef D4D_CRTCH_TOUCHPENDING_PCR
168 #define D4D_CRTCH_TOUCHPENDING_PCR D4D_PASTE(D4D_PASTE(PORT, D4D_CRTCH_TOUCHPANDING_PORT), D4D_PASTE(_PCR, D4D_CRTCH_TOUCHPENDING_PIN))
172 #ifndef D4D_CRTCH_GPIO_PDIR
173 #define D4D_CRTCH_GPIO_PDIR D4D_PASTE(GPIO, D4D_PASTE(D4D_CRTCH_TOUCHPANDING_PORT, _PDIR))
177 #ifndef D4D_LLD_TCH_HW_CRTOUCH
178 #define D4D_LLD_TCH_HW_CRTOUCH d4dtchhw_crtouch_iicBareMetal
186 #if D4DTCH_INVERSE_X != 0
187 #define D4DTCH_INVERSE_X_INT D4DTCH_FULL_SCALE
190 #if D4DTCH_INVERSE_Y != 0
191 #define D4DTCH_INVERSE_Y_INT D4DTCH_FULL_SCALE
unsigned char(* D4DTCHHWCRTOUCH_MultiReadBytes)(unsigned char regAddr, unsigned char *pBuffer, unsigned char cnt)
unsigned char(* D4DTCHHWCRTOUCH_MultiWriteBytes)(unsigned char regAddr, unsigned char *pBuffer, unsigned char cnt)
#define D4D_LLD_TCH_HW_CRTOUCH
unsigned char Byte
Type definition of Byte (unsigned 8-bit).
unsigned char(* D4DTCHHWCRTOUCH_Init)(void)
unsigned char(* D4DTCHHWCRTOUCH_DeInit)(void)
void(* D4DTCHHWCRTOUCH_SetAddress)(unsigned char)
struct D4DTCHHWCRTOUCH_FUNCTIONS_S D4DTCHHWCRTOUCH_FUNCTIONS
signed long(* D4DTCHHWCRTOUCH_SetBaudRate)(unsigned long baudRate)
unsigned short Word
Type definition of Word (unsigned 16-bit).