1 /*
2  * Copyright (c) 2020 Hubert Miś
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 /**
8  * @file
9  * @brief FT8XX memory map
10  */
11 
12 #ifndef ZEPHYR_DRIVERS_MISC_FT8XX_FT8XX_MEMORY_H_
13 #define ZEPHYR_DRIVERS_MISC_FT8XX_FT8XX_MEMORY_H_
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 /**
20  * @brief FT8xx memory addresses
21  * @defgroup ft8xx_memory FT8xx memory map
22  * @ingroup ft8xx_interface
23  * @{
24  */
25 
26 /** Main parts of FT800 memory map */
27 enum ft800_memory_map_t {
28 	FT800_RAM_G         = 0x000000,
29 	FT800_ROM_CHIPID    = 0x0C0000,
30 	FT800_ROM_FONT      = 0x0BB23C,
31 	FT800_ROM_FONT_ADDR = 0x0FFFFC,
32 	FT800_RAM_DL        = 0x100000,
33 	FT800_RAM_PAL       = 0x102000,
34 	FT800_REG_          = 0x102400,
35 	FT800_RAM_CMD       = 0x108000
36 };
37 
38 /** Main parts of FT810 memory map */
39 enum ft810_memory_map_t {
40 	FT810_RAM_G         = 0x000000,
41 	FT810_RAM_DL        = 0x300000,
42 	FT810_REG_          = 0x302000,
43 	FT810_RAM_CMD       = 0x308000
44 };
45 
46 /** FT800 register addresses */
47 enum ft800_register_address_t {
48 	FT800_REG_ID         = 0x102400,
49 	FT800_REG_FRAMES     = 0x102404,
50 	FT800_REG_CLOCK      = 0x102408,
51 	FT800_REG_FREQUENCY  = 0x10240C,
52 	FT800_REG_RENDERMODE = 0x102410,
53 	FT800_REG_SNAPY      = 0x102414,
54 	FT800_REG_SNAPSHOT   = 0x102418,
55 	FT800_REG_CPURESET   = 0x10241C,
56 	FT800_REG_TAP_CRC    = 0x102420,
57 	FT800_REG_TAP_MASK   = 0x102424,
58 	FT800_REG_HCYCLE     = 0x102428,
59 	FT800_REG_HOFFSET    = 0x10242C,
60 	FT800_REG_HSIZE      = 0x102430,
61 	FT800_REG_HSYNC0     = 0x102434,
62 	FT800_REG_HSYNC1     = 0x102438,
63 	FT800_REG_VCYCLE     = 0x10243C,
64 	FT800_REG_VOFFSET    = 0x102440,
65 	FT800_REG_VSIZE      = 0x102444,
66 	FT800_REG_VSYNC0     = 0x102448,
67 	FT800_REG_VSYNC1     = 0x10244C,
68 	FT800_REG_DLSWAP     = 0x102450,
69 	FT800_REG_ROTATE     = 0x102454,
70 	FT800_REG_OUTBITS    = 0x102458,
71 	FT800_REG_DITHER     = 0x10245C,
72 	FT800_REG_SWIZZLE    = 0x102460,
73 	FT800_REG_CSPREAD    = 0x102464,
74 	FT800_REG_PCLK_POL   = 0x102468,
75 	FT800_REG_PCLK       = 0x10246C,
76 	FT800_REG_TAG_X      = 0x102470,
77 	FT800_REG_TAG_Y      = 0x102474,
78 	FT800_REG_TAG        = 0x102478,
79 	FT800_REG_VOL_PB     = 0x10247C,
80 	FT800_REG_VOL_SOUND  = 0x102480,
81 	FT800_REG_SOUND      = 0x102484,
82 	FT800_REG_PLAY       = 0x102488,
83 	FT800_REG_GPIO_DIR   = 0x10248C,
84 	FT800_REG_GPIO       = 0x102490,
85 
86 	FT800_REG_INT_FLAGS  = 0x102498,
87 	FT800_REG_INT_EN     = 0x10249C,
88 	FT800_REG_INT_MASK   = 0x1024A0,
89 	FT800_REG_PLAYBACK_START = 0x1024A4,
90 	FT800_REG_PLAYBACK_LENGTH = 0x1024A8,
91 	FT800_REG_PLAYBACK_READPTR = 0x1024AC,
92 	FT800_REG_PLAYBACK_FREQ = 0x1024B0,
93 	FT800_REG_PLAYBACK_FORMAT = 0x1024B4,
94 	FT800_REG_PLAYBACK_LOOP = 0x1024B8,
95 	FT800_REG_PLAYBACK_PLAY = 0x1024BC,
96 	FT800_REG_PWM_HZ     = 0x1024C0,
97 	FT800_REG_PWM_DUTY   = 0x1024C4,
98 	FT800_REG_MACRO_0    = 0x1024C8,
99 	FT800_REG_MACRO_1    = 0x1024CC,
100 
101 	FT800_REG_CMD_READ   = 0x1024E4,
102 	FT800_REG_CMD_WRITE  = 0x1024E8,
103 	FT800_REG_CMD_DL     = 0x1024EC,
104 	FT800_REG_TOUCH_MODE = 0x1024F0,
105 	FT800_REG_TOUCH_ADC_MODE = 0x1024F4,
106 	FT800_REG_TOUCH_CHARGE = 0x1024F8,
107 	FT800_REG_TOUCH_SETTLE = 0x1024FC,
108 	FT800_REG_TOUCH_OVERSAMPLE = 0x102500,
109 	FT800_REG_TOUCH_RZTHRESH = 0x102504,
110 	FT800_REG_TOUCH_RAW_XY = 0x102508,
111 	FT800_REG_TOUCH_RZ   = 0x10250C,
112 	FT800_REG_TOUCH_SCREEN_XY = 0x102510,
113 	FT800_REG_TOUCH_TAG_XY = 0x102514,
114 	FT800_REG_TOUCH_TAG  = 0x102518,
115 	FT800_REG_TOUCH_TRANSFORM_A = 0x10251C,
116 	FT800_REG_TOUCH_TRANSFORM_B = 0x102520,
117 	FT800_REG_TOUCH_TRANSFORM_C = 0x102524,
118 	FT800_REG_TOUCH_TRANSFORM_D = 0x102528,
119 	FT800_REG_TOUCH_TRANSFORM_E = 0x10252C,
120 	FT800_REG_TOUCH_TRANSFORM_F = 0x102530,
121 
122 	FT800_REG_TOUCH_DIRECT_XY = 0x102574,
123 	FT800_REG_TOUCH_DIRECT_Z1Z2 = 0x102578,
124 
125 	FT800_REG_TRACKER    = 0x109000
126 };
127 
128 /** FT810 register addresses */
129 enum ft810_register_address_t {
130 	FT810_REG_TRIM       = 0x10256C,
131 
132 	FT810_REG_ID         = 0x302000,
133 	FT810_REG_FRAMES     = 0x302004,
134 	FT810_REG_CLOCK      = 0x302008,
135 	FT810_REG_FREQUENCY  = 0x30200C,
136 	FT810_REG_RENDERMODE = 0x302010,
137 	FT810_REG_SNAPY      = 0x302014,
138 	FT810_REG_SNAPSHOT   = 0x302018,
139 	FT810_REG_CPURESET   = 0x302020,
140 	FT810_REG_TAP_CRC    = 0x302020,
141 	FT810_REG_TAP_MASK   = 0x302024,
142 	FT810_REG_HCYCLE     = 0x30202C,
143 	FT810_REG_HOFFSET    = 0x302030,
144 	FT810_REG_HSIZE      = 0x302034,
145 	FT810_REG_HSYNC0     = 0x302038,
146 	FT810_REG_HSYNC1     = 0x30203C,
147 	FT810_REG_VCYCLE     = 0x302040,
148 	FT810_REG_VOFFSET    = 0x302044,
149 	FT810_REG_VSIZE      = 0x302048,
150 	FT810_REG_VSYNC0     = 0x30204C,
151 	FT810_REG_VSYNC1     = 0x302050,
152 	FT810_REG_DLSWAP     = 0x302054,
153 	FT810_REG_ROTATE     = 0x302058,
154 	FT810_REG_OUTBITS    = 0x30205C,
155 	FT810_REG_DITHER     = 0x302060,
156 	FT810_REG_SWIZZLE    = 0x302064,
157 	FT810_REG_CSPREAD    = 0x302068,
158 	FT810_REG_PCLK_POL   = 0x30206C,
159 	FT810_REG_PCLK       = 0x302070,
160 	FT810_REG_TAG_X      = 0x302074,
161 	FT810_REG_TAG_Y      = 0x302078,
162 	FT810_REG_TAG        = 0x30207C,
163 	FT810_REG_VOL_PB     = 0x302080,
164 	FT810_REG_VOL_SOUND  = 0x302084,
165 	FT810_REG_SOUND      = 0x302088,
166 	FT810_REG_PLAY       = 0x30208C,
167 	FT810_REG_GPIO_DIR   = 0x302090,
168 	FT810_REG_GPIO       = 0x302094,
169 	FT810_REG_GPIOX_DIR  = 0x302098,
170 	FT810_REG_GPIOX      = 0x30209C,
171 
172 	FT810_REG_INT_FLAGS  = 0x3020A8,
173 	FT810_REG_INT_EN     = 0x3020AC,
174 	FT810_REG_INT_MASK   = 0x3020B0,
175 	FT810_REG_PLAYBACK_START = 0x3020B4,
176 	FT810_REG_PLAYBACK_LENGTH = 0x3020B8,
177 	FT810_REG_PLAYBACK_READPTR = 0x3020BC,
178 	FT810_REG_PLAYBACK_FREQ = 0x3020C0,
179 	FT810_REG_PLAYBACK_FORMAT = 0x3020C4,
180 	FT810_REG_PLAYBACK_LOOP = 0x3020C8,
181 	FT810_REG_PLAYBACK_PLAY = 0x3020CC,
182 	FT810_REG_PWM_HZ     = 0x3020D0,
183 	FT810_REG_PWM_DUTY   = 0x3020D4,
184 
185 	FT810_REG_CMD_READ   = 0x3020F8,
186 	FT810_REG_CMD_WRITE  = 0x3020FC,
187 	FT810_REG_CMD_DL     = 0x302100,
188 	FT810_REG_TOUCH_MODE = 0x302104,
189 	FT810_REG_TOUCH_ADC_MODE = 0x302108,
190 	FT810_REG_TOUCH_CHARGE = 0x30210C,
191 	FT810_REG_TOUCH_SETTLE = 0x302110,
192 	FT810_REG_TOUCH_OVERSAMPLE = 0x302114,
193 	FT810_REG_TOUCH_RZTHRESH = 0x302118,
194 	FT810_REG_TOUCH_RAW_XY = 0x30211C,
195 	FT810_REG_TOUCH_RZ   = 0x302120,
196 	FT810_REG_TOUCH_SCREEN_XY = 0x302124,
197 	FT810_REG_TOUCH_TAG_XY = 0x302128,
198 	FT810_REG_TOUCH_TAG  = 0x30212C,
199 	FT810_REG_TOUCH_TRANSFORM_A = 0x302150,
200 	FT810_REG_TOUCH_TRANSFORM_B = 0x302154,
201 	FT810_REG_TOUCH_TRANSFORM_C = 0x302158,
202 	FT810_REG_TOUCH_TRANSFORM_D = 0x30215C,
203 	FT810_REG_TOUCH_TRANSFORM_E = 0x302160,
204 	FT810_REG_TOUCH_TRANSFORM_F = 0x302164,
205 	FT810_REG_TOUCH_CONFIG = 0x302168,
206 
207 	FT810_REG_SPI_WIDTH  = 0x302180,
208 
209 	FT810_REG_TOUCH_DIRECT_XY = 0x30218C,
210 	FT810_REG_TOUCH_DIRECT_Z1Z2 = 0x302190,
211 
212 	FT810_REG_CMDB_SPACE = 0x302574,
213 	FT810_REG_CMDB_WRITE = 0x302578,
214 
215 	FT810_REG_TRACKER    = 0x309000,
216 	FT810_REG_TRACKER1   = 0x309004,
217 	FT810_REG_TRACKER2   = 0x309008,
218 	FT810_REG_TRACKER3   = 0x30900C,
219 	FT810_REG_TRACKER4   = 0x309010,
220 	FT810_REG_MEDIAFIFO_READ = 0x309014,
221 	FT810_REG_MEDIAFIFO_WRITE = 0x309018,
222 };
223 
224 /**
225  * @}
226  */
227 
228 #ifdef __cplusplus
229 }
230 #endif
231 
232 #endif /* ZEPHYR_DRIVERS_MISC_FT8XX_FT8XX_MEMORY_H_ */
233