Many bug fixes, including selection fixes.
[SCSI2SD.git] / software / SCSI2SD / SCSI2SD.cydsn / Generated_Source / PSoC5 / cyfitter_cfg.c
1 /*******************************************************************************\r
2 * FILENAME: cyfitter_cfg.c\r
3 * PSoC Creator 3.0 Component Pack 7\r
4 *\r
5 * Description:\r
6 * This file is automatically generated by PSoC Creator with device \r
7 * initialization code.  Except for the user defined sections in\r
8 * CyClockStartupError(), this file should not be modified.\r
9 *\r
10 ********************************************************************************\r
11 * Copyright 2013, Cypress Semiconductor Corporation.  All rights reserved.\r
12 * You may use this file only in accordance with the license, terms, conditions, \r
13 * disclaimers, and limitations in the end user license agreement accompanying \r
14 * the software package with which this file was provided.\r
15 ********************************************************************************/\r
16 \r
17 #include <string.h>\r
18 #include <cytypes.h>\r
19 #include <cydevice_trm.h>\r
20 #include <cyfitter.h>\r
21 #include <CyLib.h>\r
22 #include <cyfitter_cfg.h>\r
23 \r
24 #define CY_NEED_CYCLOCKSTARTUPERROR 1\r
25 \r
26 \r
27 #if defined(__GNUC__) || defined(__ARMCC_VERSION)\r
28     #define CYPACKED \r
29     #define CYPACKED_ATTR __attribute__ ((packed))\r
30     #define CYALIGNED __attribute__ ((aligned))\r
31     #define CY_CFG_UNUSED __attribute__ ((unused))\r
32     #define CY_CFG_SECTION __attribute__ ((section(".psocinit")))\r
33     \r
34     #if defined(__ARMCC_VERSION)\r
35         #define CY_CFG_MEMORY_BARRIER() __memory_changed()\r
36     #else\r
37         #define CY_CFG_MEMORY_BARRIER() __sync_synchronize()\r
38     #endif\r
39     \r
40 #elif defined(__ICCARM__)\r
41     #include <intrinsics.h>\r
42 \r
43     #define CYPACKED __packed\r
44     #define CYPACKED_ATTR \r
45     #define CYALIGNED _Pragma("data_alignment=4")\r
46     #define CY_CFG_UNUSED _Pragma("diag_suppress=Pe177")\r
47     #define CY_CFG_SECTION _Pragma("location=\".psocinit\"")\r
48     \r
49     #define CY_CFG_MEMORY_BARRIER() __DMB()\r
50     \r
51 #else\r
52     #error Unsupported toolchain\r
53 #endif\r
54 \r
55 \r
56 CY_CFG_UNUSED\r
57 static void CYMEMZERO(void *s, size_t n);\r
58 CY_CFG_UNUSED\r
59 static void CYMEMZERO(void *s, size_t n)\r
60 {\r
61         (void)memset(s, 0, n);\r
62 }\r
63 CY_CFG_UNUSED\r
64 static void CYCONFIGCPY(void *dest, const void *src, size_t n);\r
65 CY_CFG_UNUSED\r
66 static void CYCONFIGCPY(void *dest, const void *src, size_t n)\r
67 {\r
68         (void)memcpy(dest, src, n);\r
69 }\r
70 CY_CFG_UNUSED\r
71 static void CYCONFIGCPYCODE(void *dest, const void *src, size_t n);\r
72 CY_CFG_UNUSED\r
73 static void CYCONFIGCPYCODE(void *dest, const void *src, size_t n)\r
74 {\r
75         (void)memcpy(dest, src, n);\r
76 }\r
77 \r
78 \r
79 \r
80 /* Clock startup error codes                                                   */\r
81 #define CYCLOCKSTART_NO_ERROR    0u\r
82 #define CYCLOCKSTART_XTAL_ERROR  1u\r
83 #define CYCLOCKSTART_32KHZ_ERROR 2u\r
84 #define CYCLOCKSTART_PLL_ERROR   3u\r
85 \r
86 #ifdef CY_NEED_CYCLOCKSTARTUPERROR\r
87 /*******************************************************************************\r
88 * Function Name: CyClockStartupError\r
89 ********************************************************************************\r
90 * Summary:\r
91 *  If an error is encountered during clock configuration (crystal startup error,\r
92 *  PLL lock error, etc.), the system will end up here.  Unless reimplemented by\r
93 *  the customer, this function will stop in an infinite loop.\r
94 *\r
95 * Parameters:\r
96 *   void\r
97 *\r
98 * Return:\r
99 *   void\r
100 *\r
101 *******************************************************************************/\r
102 CY_CFG_UNUSED\r
103 static void CyClockStartupError(uint8 errorCode);\r
104 CY_CFG_UNUSED\r
105 static void CyClockStartupError(uint8 errorCode)\r
106 {\r
107     /* To remove the compiler warning if errorCode not used.                */\r
108     errorCode = errorCode;\r
109 \r
110     /* `#START CyClockStartupError` */\r
111 \r
112     /* If we have a clock startup error (bad MHz crystal, PLL lock, etc.),  */\r
113     /* we will end up here to allow the customer to implement something to  */\r
114     /* deal with the clock condition.                                       */\r
115 \r
116     /* `#END` */\r
117 \r
118     /* If nothing else, stop here since the clocks have not started         */\r
119     /* correctly.                                                           */\r
120     while(1) {}\r
121 }\r
122 #endif\r
123 \r
124 #define CY_CFG_BASE_ADDR_COUNT 34u\r
125 CYPACKED typedef struct\r
126 {\r
127         uint8 offset;\r
128         uint8 value;\r
129 } CYPACKED_ATTR cy_cfg_addrvalue_t;\r
130 \r
131 \r
132 \r
133 /*******************************************************************************\r
134 * Function Name: cfg_write_bytes32\r
135 ********************************************************************************\r
136 * Summary:\r
137 *  This function is used for setting up the chip configuration areas that\r
138 *  contain relatively sparse data.\r
139 *\r
140 * Parameters:\r
141 *   void\r
142 *\r
143 * Return:\r
144 *   void\r
145 *\r
146 *******************************************************************************/\r
147 static void cfg_write_bytes32(const uint32 addr_table[], const cy_cfg_addrvalue_t data_table[]);\r
148 static void cfg_write_bytes32(const uint32 addr_table[], const cy_cfg_addrvalue_t data_table[])\r
149 {\r
150         /* For 32-bit little-endian architectures */\r
151         uint32 i, j = 0u;\r
152         for (i = 0u; i < CY_CFG_BASE_ADDR_COUNT; i++)\r
153         {\r
154                 uint32 baseAddr = addr_table[i];\r
155                 uint8 count = (uint8)baseAddr;\r
156                 baseAddr &= 0xFFFFFF00u;\r
157                 while (count != 0u)\r
158                 {\r
159                         CY_SET_XTND_REG8((void CYFAR *)(baseAddr + data_table[j].offset), data_table[j].value);\r
160                         j++;\r
161                         count--;\r
162                 }\r
163         }\r
164 }\r
165 \r
166 /*******************************************************************************\r
167 * Function Name: ClockSetup\r
168 ********************************************************************************\r
169 *\r
170 * Summary:\r
171 *  Performs the initialization of all of the clocks in the device based on the\r
172 *  settings in the Clock tab of the DWR.  This includes enabling the requested\r
173 *  clocks and setting the necessary dividers to produce the desired frequency. \r
174 *\r
175 * Parameters:\r
176 *  void\r
177 *\r
178 * Return:\r
179 *  void\r
180 *\r
181 *******************************************************************************/\r
182 static void ClockSetup(void);\r
183 static void ClockSetup(void)\r
184 {\r
185         uint32 timeout;\r
186         uint8 pllLock;\r
187 \r
188 \r
189         /* Configure Digital Clocks based on settings from Clock DWR */\r
190         CY_SET_XTND_REG16((void CYFAR *)(CYREG_CLKDIST_DCFG0_CFG0), 0x0001u);\r
191         CY_SET_XTND_REG8((void CYFAR *)(CYREG_CLKDIST_DCFG0_CFG0 + 0x2u), 0x10u);\r
192         CY_SET_XTND_REG16((void CYFAR *)(CYREG_CLKDIST_DCFG1_CFG0), 0x001Du);\r
193         CY_SET_XTND_REG8((void CYFAR *)(CYREG_CLKDIST_DCFG1_CFG0 + 0x2u), 0x19u);\r
194 \r
195         /* Configure ILO based on settings from Clock DWR */\r
196         CY_SET_XTND_REG8((void CYFAR *)(CYREG_SLOWCLK_ILO_CR0), 0x06u);\r
197 \r
198         /* Configure IMO based on settings from Clock DWR */\r
199         CY_SET_XTND_REG8((void CYFAR *)(CYREG_FASTCLK_IMO_CR), 0x52u);\r
200         CY_SET_XTND_REG8((void CYFAR *)(CYREG_IMO_TR1), (CY_GET_XTND_REG8((void CYFAR *)CYREG_FLSHID_CUST_TABLES_IMO_USB)));\r
201 \r
202         /* Configure PLL based on settings from Clock DWR */\r
203         CY_SET_XTND_REG16((void CYFAR *)(CYREG_FASTCLK_PLL_P), 0x0919u);\r
204         CY_SET_XTND_REG16((void CYFAR *)(CYREG_FASTCLK_PLL_CFG0), 0x1251u);\r
205         /* Wait up to 250us for the PLL to lock */\r
206         pllLock = 0u;\r
207         for (timeout = 250u / 10u; (timeout > 0u) && (pllLock != 0x03u); timeout--)\r
208         { \r
209                 pllLock = 0x03u & ((uint8)((uint8)pllLock << 1) | ((CY_GET_XTND_REG8((void CYFAR *)CYREG_FASTCLK_PLL_SR) & 0x01u) >> 0));\r
210                 CyDelayCycles(10u * 48u); /* Delay 10us based on 48MHz clock */\r
211         }\r
212         /* If we ran out of time the PLL didn't lock so go to the error function */\r
213         if (timeout == 0u)\r
214         {\r
215                 CyClockStartupError(CYCLOCKSTART_PLL_ERROR);\r
216         }\r
217 \r
218         /* Configure Bus/Master Clock based on settings from Clock DWR */\r
219         CY_SET_XTND_REG16((void CYFAR *)(CYREG_CLKDIST_MSTR0), 0x0100u);\r
220         CY_SET_XTND_REG8((void CYFAR *)(CYREG_CLKDIST_MSTR0), 0x07u);\r
221         CY_SET_XTND_REG8((void CYFAR *)(CYREG_CLKDIST_BCFG0), 0x00u);\r
222         CY_SET_XTND_REG8((void CYFAR *)(CYREG_CLKDIST_BCFG2), 0x48u);\r
223         CY_SET_XTND_REG8((void CYFAR *)(CYREG_CLKDIST_MSTR0), 0x00u);\r
224 \r
225         /* Configure USB Clock based on settings from Clock DWR */\r
226         CY_SET_XTND_REG8((void CYFAR *)(CYREG_CLKDIST_UCFG), 0x00u);\r
227         CY_SET_XTND_REG8((void CYFAR *)(CYREG_CLKDIST_LD), 0x02u);\r
228 \r
229         CY_SET_XTND_REG8((void CYFAR *)(CYREG_PM_ACT_CFG2), ((CY_GET_XTND_REG8((void CYFAR *)CYREG_PM_ACT_CFG2) | 0x02u)));\r
230 }\r
231 \r
232 \r
233 /* Analog API Functions */\r
234 \r
235 \r
236 /*******************************************************************************\r
237 * Function Name: AnalogSetDefault\r
238 ********************************************************************************\r
239 *\r
240 * Summary:\r
241 *  Sets up the analog portions of the chip to default values based on chip\r
242 *  configuration options from the project.\r
243 *\r
244 * Parameters:\r
245 *  void\r
246 *\r
247 * Return:\r
248 *  void\r
249 *\r
250 *******************************************************************************/\r
251 static void AnalogSetDefault(void);\r
252 static void AnalogSetDefault(void)\r
253 {\r
254         uint8 bg_xover_inl_trim = CY_GET_XTND_REG8((void CYFAR *)(CYREG_FLSHID_MFG_CFG_BG_XOVER_INL_TRIM + 1u));\r
255         CY_SET_XTND_REG8((void CYFAR *)(CYREG_BG_DFT0), (bg_xover_inl_trim & 0x07u));\r
256         CY_SET_XTND_REG8((void CYFAR *)(CYREG_BG_DFT1), ((bg_xover_inl_trim >> 4) & 0x0Fu));\r
257         CY_SET_XTND_REG8((void CYFAR *)CYREG_PUMP_CR0, 0x44u);\r
258 }\r
259 \r
260 \r
261 /*******************************************************************************\r
262 * Function Name: SetAnalogRoutingPumps\r
263 ********************************************************************************\r
264 *\r
265 * Summary:\r
266 * Enables or disables the analog pumps feeding analog routing switches.\r
267 * Intended to be called at startup, based on the Vdda system configuration;\r
268 * may be called during operation when the user informs us that the Vdda voltage\r
269 * crossed the pump threshold.\r
270 *\r
271 * Parameters:\r
272 *  enabled - 1 to enable the pumps, 0 to disable the pumps\r
273 *\r
274 * Return:\r
275 *  void\r
276 *\r
277 *******************************************************************************/\r
278 void SetAnalogRoutingPumps(uint8 enabled)\r
279 {\r
280         uint8 regValue = CY_GET_XTND_REG8((void CYFAR *)CYREG_PUMP_CR0);\r
281         if (enabled != 0u)\r
282         {\r
283                 regValue |= 0x00u;\r
284         }\r
285         else\r
286         {\r
287                 regValue &= (uint8)~0x00u;\r
288         }\r
289         CY_SET_XTND_REG8((void CYFAR *)CYREG_PUMP_CR0, regValue);\r
290 }\r
291 \r
292 #define CY_AMUX_UNUSED CYREG_BOOST_SR\r
293 \r
294 \r
295 /*******************************************************************************\r
296 * Function Name: cyfitter_cfg\r
297 ********************************************************************************\r
298 * Summary:\r
299 *  This function is called by the start-up code for the selected device. It\r
300 *  performs all of the necessary device configuration based on the design\r
301 *  settings.  This includes settings from the Design Wide Resources (DWR) such\r
302 *  as Clocks and Pins as well as any component configuration that is necessary.\r
303 *\r
304 * Parameters:  \r
305 *   void\r
306 *\r
307 * Return:\r
308 *   void\r
309 *\r
310 *******************************************************************************/\r
311 \r
312 void cyfitter_cfg(void)\r
313 {\r
314         /* IOPINS0_0 Address: CYREG_PRT0_DM0 Size (bytes): 8 */\r
315         static const uint8 CYCODE BS_IOPINS0_0_VAL[] = {\r
316                 0x00u, 0xFFu, 0xFFu, 0x00u, 0x03u, 0x00u, 0x00u, 0x00u};\r
317 \r
318         /* IOPINS0_7 Address: CYREG_PRT12_DR Size (bytes): 10 */\r
319         static const uint8 CYCODE BS_IOPINS0_7_VAL[] = {\r
320                 0x08u, 0x00u, 0x30u, 0x00u, 0x08u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u};\r
321 \r
322         /* IOPINS1_7 Address: CYREG_PRT12_DR + 0x0000000Bu Size (bytes): 5 */\r
323         static const uint8 CYCODE BS_IOPINS1_7_VAL[] = {\r
324                 0x00u, 0x00u, 0x00u, 0x00u, 0x10u};\r
325 \r
326         /* IOPINS0_8 Address: CYREG_PRT15_DR Size (bytes): 10 */\r
327         static const uint8 CYCODE BS_IOPINS0_8_VAL[] = {\r
328                 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0xC0u, 0x00u};\r
329 \r
330         /* IOPINS0_2 Address: CYREG_PRT2_DM0 Size (bytes): 8 */\r
331         static const uint8 CYCODE BS_IOPINS0_2_VAL[] = {\r
332                 0xFFu, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x01u};\r
333 \r
334         /* IOPINS0_3 Address: CYREG_PRT3_DR Size (bytes): 10 */\r
335         static const uint8 CYCODE BS_IOPINS0_3_VAL[] = {\r
336                 0x10u, 0x00u, 0x63u, 0x1Cu, 0x1Cu, 0x00u, 0x0Cu, 0x00u, 0x00u, 0x00u};\r
337 \r
338         /* IOPINS0_4 Address: CYREG_PRT4_DM0 Size (bytes): 8 */\r
339         static const uint8 CYCODE BS_IOPINS0_4_VAL[] = {\r
340                 0x00u, 0xFCu, 0xFCu, 0x00u, 0xF8u, 0x00u, 0x00u, 0x00u};\r
341 \r
342         /* IOPINS0_5 Address: CYREG_PRT5_DM0 Size (bytes): 8 */\r
343         static const uint8 CYCODE BS_IOPINS0_5_VAL[] = {\r
344                 0x0Fu, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x01u};\r
345 \r
346         /* IOPINS0_6 Address: CYREG_PRT6_DM0 Size (bytes): 8 */\r
347         static const uint8 CYCODE BS_IOPINS0_6_VAL[] = {\r
348                 0xF0u, 0x0Fu, 0x0Fu, 0x00u, 0x0Fu, 0x00u, 0x00u, 0x01u};\r
349 \r
350 #ifdef CYGlobalIntDisable\r
351         /* Disable interrupts by default. Let user enable if/when they want. */\r
352         CYGlobalIntDisable\r
353 #endif\r
354 \r
355 \r
356         /* Set Flash Cycles based on max possible frequency in case a glitch occurs during ClockSetup(). */\r
357         CY_SET_XTND_REG8((void CYFAR *)(CYREG_CACHE_CC_CTL), (((CYDEV_INSTRUCT_CACHE_ENABLED) != 0) ? 0x01u : 0x00u));\r
358         /* Setup clocks based on selections from Clock DWR */\r
359         ClockSetup();\r
360         /* Enable/Disable Debug functionality based on settings from System DWR */\r
361         CY_SET_XTND_REG8((void CYFAR *)CYREG_MLOGIC_DEBUG, (CY_GET_XTND_REG8((void CYFAR *)CYREG_MLOGIC_DEBUG) | 0x04u));\r
362 \r
363         {\r
364                 static const uint32 CYCODE cy_cfg_addr_table[] = {\r
365                         0x40004502u, /* Base address: 0x40004500 Count: 2 */\r
366                         0x4000520Au, /* Base address: 0x40005200 Count: 10 */\r
367                         0x40006401u, /* Base address: 0x40006400 Count: 1 */\r
368                         0x40006501u, /* Base address: 0x40006500 Count: 1 */\r
369                         0x40010043u, /* Base address: 0x40010000 Count: 67 */\r
370                         0x40010130u, /* Base address: 0x40010100 Count: 48 */\r
371                         0x4001023Au, /* Base address: 0x40010200 Count: 58 */\r
372                         0x4001034Cu, /* Base address: 0x40010300 Count: 76 */\r
373                         0x40010447u, /* Base address: 0x40010400 Count: 71 */\r
374                         0x4001054Du, /* Base address: 0x40010500 Count: 77 */\r
375                         0x40010649u, /* Base address: 0x40010600 Count: 73 */\r
376                         0x40010746u, /* Base address: 0x40010700 Count: 70 */\r
377                         0x4001090Du, /* Base address: 0x40010900 Count: 13 */\r
378                         0x40010A33u, /* Base address: 0x40010A00 Count: 51 */\r
379                         0x40010B38u, /* Base address: 0x40010B00 Count: 56 */\r
380                         0x40010D06u, /* Base address: 0x40010D00 Count: 6 */\r
381                         0x40010F03u, /* Base address: 0x40010F00 Count: 3 */\r
382                         0x40011503u, /* Base address: 0x40011500 Count: 3 */\r
383                         0x40011736u, /* Base address: 0x40011700 Count: 54 */\r
384                         0x40011902u, /* Base address: 0x40011900 Count: 2 */\r
385                         0x40011B02u, /* Base address: 0x40011B00 Count: 2 */\r
386                         0x4001400Du, /* Base address: 0x40014000 Count: 13 */\r
387                         0x4001410Fu, /* Base address: 0x40014100 Count: 15 */\r
388                         0x4001420Au, /* Base address: 0x40014200 Count: 10 */\r
389                         0x40014308u, /* Base address: 0x40014300 Count: 8 */\r
390                         0x4001440Bu, /* Base address: 0x40014400 Count: 11 */\r
391                         0x40014512u, /* Base address: 0x40014500 Count: 18 */\r
392                         0x4001460Cu, /* Base address: 0x40014600 Count: 12 */\r
393                         0x40014706u, /* Base address: 0x40014700 Count: 6 */\r
394                         0x4001480Au, /* Base address: 0x40014800 Count: 10 */\r
395                         0x40014909u, /* Base address: 0x40014900 Count: 9 */\r
396                         0x40014C02u, /* Base address: 0x40014C00 Count: 2 */\r
397                         0x40015006u, /* Base address: 0x40015000 Count: 6 */\r
398                         0x40015101u, /* Base address: 0x40015100 Count: 1 */\r
399                 };\r
400 \r
401                 static const cy_cfg_addrvalue_t CYCODE cy_cfg_data_table[] = {\r
402                         {0x36u, 0x02u},\r
403                         {0x7Eu, 0x02u},\r
404                         {0x00u, 0x01u},\r
405                         {0x01u, 0x01u},\r
406                         {0x18u, 0x08u},\r
407                         {0x19u, 0x04u},\r
408                         {0x1Cu, 0x61u},\r
409                         {0x20u, 0x98u},\r
410                         {0x21u, 0x50u},\r
411                         {0x30u, 0x03u},\r
412                         {0x31u, 0x06u},\r
413                         {0x7Cu, 0x40u},\r
414                         {0x33u, 0x03u},\r
415                         {0x86u, 0x0Fu},\r
416                         {0x06u, 0x44u},\r
417                         {0x07u, 0x03u},\r
418                         {0x09u, 0x10u},\r
419                         {0x10u, 0x44u},\r
420                         {0x12u, 0x22u},\r
421                         {0x16u, 0x03u},\r
422                         {0x17u, 0x04u},\r
423                         {0x19u, 0x04u},\r
424                         {0x1Au, 0x30u},\r
425                         {0x1Bu, 0x01u},\r
426                         {0x1Du, 0x08u},\r
427                         {0x1Eu, 0x40u},\r
428                         {0x21u, 0x04u},\r
429                         {0x23u, 0x02u},\r
430                         {0x24u, 0x08u},\r
431                         {0x28u, 0x44u},\r
432                         {0x2Au, 0x11u},\r
433                         {0x2Bu, 0x04u},\r
434                         {0x2Eu, 0x04u},\r
435                         {0x31u, 0x10u},\r
436                         {0x32u, 0x07u},\r
437                         {0x33u, 0x07u},\r
438                         {0x34u, 0x70u},\r
439                         {0x35u, 0x08u},\r
440                         {0x36u, 0x08u},\r
441                         {0x3Eu, 0x40u},\r
442                         {0x3Fu, 0x11u},\r
443                         {0x58u, 0x04u},\r
444                         {0x59u, 0x04u},\r
445                         {0x5Bu, 0x04u},\r
446                         {0x5Cu, 0x99u},\r
447                         {0x5Fu, 0x01u},\r
448                         {0x84u, 0x18u},\r
449                         {0x86u, 0x60u},\r
450                         {0x87u, 0x04u},\r
451                         {0x88u, 0x07u},\r
452                         {0x8Bu, 0x08u},\r
453                         {0x8Du, 0x08u},\r
454                         {0x8Fu, 0x10u},\r
455                         {0x90u, 0x28u},\r
456                         {0x92u, 0x50u},\r
457                         {0x93u, 0x03u},\r
458                         {0x98u, 0x04u},\r
459                         {0x9Bu, 0x04u},\r
460                         {0xA0u, 0x30u},\r
461                         {0xA2u, 0x48u},\r
462                         {0xA3u, 0x10u},\r
463                         {0xA5u, 0x04u},\r
464                         {0xA6u, 0x02u},\r
465                         {0xA7u, 0x01u},\r
466                         {0xA8u, 0x01u},\r
467                         {0xADu, 0x04u},\r
468                         {0xAEu, 0x07u},\r
469                         {0xAFu, 0x02u},\r
470                         {0xB1u, 0x18u},\r
471                         {0xB2u, 0x78u},\r
472                         {0xB4u, 0x07u},\r
473                         {0xB7u, 0x07u},\r
474                         {0xBEu, 0x14u},\r
475                         {0xBFu, 0x01u},\r
476                         {0xD6u, 0x08u},\r
477                         {0xD8u, 0x04u},\r
478                         {0xD9u, 0x04u},\r
479                         {0xDBu, 0x04u},\r
480                         {0xDCu, 0x90u},\r
481                         {0xDDu, 0x90u},\r
482                         {0xDFu, 0x01u},\r
483                         {0x00u, 0x04u},\r
484                         {0x05u, 0x08u},\r
485                         {0x06u, 0x08u},\r
486                         {0x09u, 0x80u},\r
487                         {0x0Au, 0x54u},\r
488                         {0x0Cu, 0x02u},\r
489                         {0x0Eu, 0x08u},\r
490                         {0x12u, 0x08u},\r
491                         {0x13u, 0x48u},\r
492                         {0x14u, 0x08u},\r
493                         {0x16u, 0x01u},\r
494                         {0x17u, 0x05u},\r
495                         {0x19u, 0x08u},\r
496                         {0x1Au, 0x16u},\r
497                         {0x1Bu, 0x10u},\r
498                         {0x1Du, 0x18u},\r
499                         {0x21u, 0x04u},\r
500                         {0x22u, 0x12u},\r
501                         {0x24u, 0x40u},\r
502                         {0x27u, 0x01u},\r
503                         {0x29u, 0x21u},\r
504                         {0x2Du, 0x02u},\r
505                         {0x2Eu, 0x40u},\r
506                         {0x2Fu, 0x20u},\r
507                         {0x30u, 0x40u},\r
508                         {0x31u, 0x24u},\r
509                         {0x33u, 0x20u},\r
510                         {0x35u, 0x20u},\r
511                         {0x37u, 0x01u},\r
512                         {0x39u, 0x08u},\r
513                         {0x3Bu, 0x10u},\r
514                         {0x3Du, 0x80u},\r
515                         {0x3Eu, 0x20u},\r
516                         {0x3Fu, 0x04u},\r
517                         {0x5Cu, 0x40u},\r
518                         {0x67u, 0x02u},\r
519                         {0x69u, 0x80u},\r
520                         {0x82u, 0x10u},\r
521                         {0x83u, 0x01u},\r
522                         {0xC0u, 0x64u},\r
523                         {0xC2u, 0x5Fu},\r
524                         {0xC4u, 0xF7u},\r
525                         {0xCAu, 0xD5u},\r
526                         {0xCCu, 0xAEu},\r
527                         {0xCEu, 0x76u},\r
528                         {0xD6u, 0x10u},\r
529                         {0xD8u, 0x10u},\r
530                         {0xE4u, 0x04u},\r
531                         {0x82u, 0x40u},\r
532                         {0x83u, 0x06u},\r
533                         {0x84u, 0x16u},\r
534                         {0x85u, 0x10u},\r
535                         {0x86u, 0x48u},\r
536                         {0x8Bu, 0x08u},\r
537                         {0x8Cu, 0x02u},\r
538                         {0x8Fu, 0x20u},\r
539                         {0x90u, 0x67u},\r
540                         {0x92u, 0x18u},\r
541                         {0x94u, 0x01u},\r
542                         {0x96u, 0x02u},\r
543                         {0x98u, 0x10u},\r
544                         {0x99u, 0x28u},\r
545                         {0x9Au, 0x2Du},\r
546                         {0x9Bu, 0x02u},\r
547                         {0x9Du, 0x01u},\r
548                         {0xA0u, 0x80u},\r
549                         {0xA1u, 0x48u},\r
550                         {0xA3u, 0x04u},\r
551                         {0xA4u, 0x02u},\r
552                         {0xA9u, 0x20u},\r
553                         {0xABu, 0x08u},\r
554                         {0xB0u, 0x07u},\r
555                         {0xB1u, 0x0Eu},\r
556                         {0xB2u, 0x80u},\r
557                         {0xB3u, 0x10u},\r
558                         {0xB4u, 0x70u},\r
559                         {0xB5u, 0x60u},\r
560                         {0xB6u, 0x08u},\r
561                         {0xB7u, 0x01u},\r
562                         {0xBBu, 0x30u},\r
563                         {0xBEu, 0x44u},\r
564                         {0xBFu, 0x44u},\r
565                         {0xC0u, 0x24u},\r
566                         {0xC1u, 0x06u},\r
567                         {0xC2u, 0x50u},\r
568                         {0xC5u, 0xCFu},\r
569                         {0xC6u, 0xD2u},\r
570                         {0xC7u, 0x0Eu},\r
571                         {0xC8u, 0x1Fu},\r
572                         {0xC9u, 0xFFu},\r
573                         {0xCAu, 0xFFu},\r
574                         {0xCBu, 0xFFu},\r
575                         {0xCFu, 0x2Cu},\r
576                         {0xD6u, 0x01u},\r
577                         {0xD8u, 0x04u},\r
578                         {0xD9u, 0x04u},\r
579                         {0xDAu, 0x04u},\r
580                         {0xDBu, 0x04u},\r
581                         {0xDCu, 0x99u},\r
582                         {0xDDu, 0x09u},\r
583                         {0xDFu, 0x01u},\r
584                         {0xE2u, 0xC0u},\r
585                         {0xE6u, 0x80u},\r
586                         {0xE8u, 0x40u},\r
587                         {0xE9u, 0x40u},\r
588                         {0xEEu, 0x08u},\r
589                         {0x00u, 0x88u},\r
590                         {0x02u, 0x80u},\r
591                         {0x09u, 0x04u},\r
592                         {0x0Au, 0x44u},\r
593                         {0x11u, 0x02u},\r
594                         {0x12u, 0x10u},\r
595                         {0x18u, 0x14u},\r
596                         {0x19u, 0xA1u},\r
597                         {0x1Au, 0x44u},\r
598                         {0x1Bu, 0x02u},\r
599                         {0x20u, 0x08u},\r
600                         {0x21u, 0x21u},\r
601                         {0x22u, 0x04u},\r
602                         {0x23u, 0x01u},\r
603                         {0x29u, 0x21u},\r
604                         {0x31u, 0x20u},\r
605                         {0x33u, 0x40u},\r
606                         {0x39u, 0xA2u},\r
607                         {0x3Bu, 0x08u},\r
608                         {0x40u, 0x04u},\r
609                         {0x42u, 0x40u},\r
610                         {0x48u, 0x54u},\r
611                         {0x49u, 0x80u},\r
612                         {0x4Au, 0x08u},\r
613                         {0x52u, 0x94u},\r
614                         {0x53u, 0x10u},\r
615                         {0x58u, 0x80u},\r
616                         {0x5Au, 0x2Au},\r
617                         {0x60u, 0x10u},\r
618                         {0x62u, 0x02u},\r
619                         {0x63u, 0x09u},\r
620                         {0x68u, 0x80u},\r
621                         {0x69u, 0x24u},\r
622                         {0x6Au, 0x80u},\r
623                         {0x71u, 0x84u},\r
624                         {0x73u, 0x44u},\r
625                         {0x81u, 0x05u},\r
626                         {0x82u, 0x04u},\r
627                         {0x87u, 0x1Cu},\r
628                         {0x8Du, 0x10u},\r
629                         {0x91u, 0x80u},\r
630                         {0x92u, 0x22u},\r
631                         {0x93u, 0x02u},\r
632                         {0x94u, 0x04u},\r
633                         {0x96u, 0x40u},\r
634                         {0x97u, 0x54u},\r
635                         {0x99u, 0x10u},\r
636                         {0x9Cu, 0x48u},\r
637                         {0x9Du, 0x25u},\r
638                         {0x9Eu, 0x29u},\r
639                         {0x9Fu, 0x0Cu},\r
640                         {0xA1u, 0x08u},\r
641                         {0xA2u, 0x02u},\r
642                         {0xA3u, 0x10u},\r
643                         {0xA5u, 0xE0u},\r
644                         {0xA6u, 0x0Cu},\r
645                         {0xABu, 0x10u},\r
646                         {0xACu, 0x02u},\r
647                         {0xADu, 0x04u},\r
648                         {0xAFu, 0x01u},\r
649                         {0xB5u, 0x02u},\r
650                         {0xC0u, 0x0Du},\r
651                         {0xC2u, 0x0Eu},\r
652                         {0xC4u, 0x0Cu},\r
653                         {0xCAu, 0x05u},\r
654                         {0xCCu, 0x0Cu},\r
655                         {0xCEu, 0x0Fu},\r
656                         {0xD0u, 0x05u},\r
657                         {0xD2u, 0x0Cu},\r
658                         {0xD6u, 0x0Fu},\r
659                         {0xD8u, 0x0Fu},\r
660                         {0xE0u, 0x01u},\r
661                         {0xE2u, 0x4Cu},\r
662                         {0xE4u, 0x02u},\r
663                         {0xE6u, 0x09u},\r
664                         {0xE8u, 0x40u},\r
665                         {0x04u, 0x24u},\r
666                         {0x06u, 0x49u},\r
667                         {0x0Cu, 0x24u},\r
668                         {0x0Eu, 0x12u},\r
669                         {0x0Fu, 0xFFu},\r
670                         {0x11u, 0xFFu},\r
671                         {0x12u, 0x04u},\r
672                         {0x15u, 0x96u},\r
673                         {0x16u, 0x03u},\r
674                         {0x17u, 0x69u},\r
675                         {0x19u, 0x55u},\r
676                         {0x1Au, 0x64u},\r
677                         {0x1Bu, 0xAAu},\r
678                         {0x1Du, 0x33u},\r
679                         {0x1Eu, 0x18u},\r
680                         {0x1Fu, 0xCCu},\r
681                         {0x21u, 0x0Fu},\r
682                         {0x22u, 0x20u},\r
683                         {0x23u, 0xF0u},\r
684                         {0x27u, 0xFFu},\r
685                         {0x32u, 0x07u},\r
686                         {0x34u, 0x40u},\r
687                         {0x35u, 0xFFu},\r
688                         {0x36u, 0x38u},\r
689                         {0x3Eu, 0x10u},\r
690                         {0x3Fu, 0x10u},\r
691                         {0x58u, 0x04u},\r
692                         {0x59u, 0x04u},\r
693                         {0x5Cu, 0x09u},\r
694                         {0x5Fu, 0x01u},\r
695                         {0x82u, 0x20u},\r
696                         {0x84u, 0x11u},\r
697                         {0x85u, 0x06u},\r
698                         {0x86u, 0x22u},\r
699                         {0x89u, 0x20u},\r
700                         {0x8Au, 0x10u},\r
701                         {0x8Bu, 0x18u},\r
702                         {0x8Eu, 0xC0u},\r
703                         {0x90u, 0x02u},\r
704                         {0x92u, 0x0Du},\r
705                         {0x94u, 0x0Du},\r
706                         {0x95u, 0x49u},\r
707                         {0x97u, 0x32u},\r
708                         {0x98u, 0x82u},\r
709                         {0x99u, 0x59u},\r
710                         {0x9Au, 0x38u},\r
711                         {0x9Bu, 0x24u},\r
712                         {0x9Cu, 0x0Du},\r
713                         {0xA0u, 0x0Du},\r
714                         {0xA4u, 0x42u},\r
715                         {0xA5u, 0x6Au},\r
716                         {0xA6u, 0x34u},\r
717                         {0xA7u, 0x11u},\r
718                         {0xA8u, 0x0Du},\r
719                         {0xACu, 0x0Du},\r
720                         {0xB0u, 0x0Fu},\r
721                         {0xB3u, 0x07u},\r
722                         {0xB5u, 0x38u},\r
723                         {0xB6u, 0xF0u},\r
724                         {0xB7u, 0x40u},\r
725                         {0xB9u, 0x08u},\r
726                         {0xBAu, 0x02u},\r
727                         {0xBBu, 0x20u},\r
728                         {0xBFu, 0x40u},\r
729                         {0xD4u, 0x09u},\r
730                         {0xD8u, 0x08u},\r
731                         {0xD9u, 0x08u},\r
732                         {0xDBu, 0x08u},\r
733                         {0xDCu, 0x99u},\r
734                         {0xDDu, 0x90u},\r
735                         {0xDFu, 0x01u},\r
736                         {0x00u, 0x08u},\r
737                         {0x03u, 0x02u},\r
738                         {0x05u, 0x54u},\r
739                         {0x06u, 0x81u},\r
740                         {0x0Au, 0xA6u},\r
741                         {0x0Du, 0x02u},\r
742                         {0x0Eu, 0x19u},\r
743                         {0x10u, 0x80u},\r
744                         {0x12u, 0x10u},\r
745                         {0x13u, 0x08u},\r
746                         {0x16u, 0x06u},\r
747                         {0x17u, 0x05u},\r
748                         {0x18u, 0x08u},\r
749                         {0x1Au, 0x22u},\r
750                         {0x1Du, 0x42u},\r
751                         {0x21u, 0x20u},\r
752                         {0x24u, 0x02u},\r
753                         {0x25u, 0x14u},\r
754                         {0x27u, 0x08u},\r
755                         {0x29u, 0x02u},\r
756                         {0x2Bu, 0x10u},\r
757                         {0x2Cu, 0x20u},\r
758                         {0x31u, 0x08u},\r
759                         {0x32u, 0x91u},\r
760                         {0x34u, 0x08u},\r
761                         {0x35u, 0x04u},\r
762                         {0x36u, 0x20u},\r
763                         {0x39u, 0x80u},\r
764                         {0x3Du, 0x28u},\r
765                         {0x3Eu, 0x08u},\r
766                         {0x4Cu, 0x01u},\r
767                         {0x4Du, 0x80u},\r
768                         {0x5Cu, 0x40u},\r
769                         {0x5Du, 0x08u},\r
770                         {0x5Eu, 0x02u},\r
771                         {0x5Fu, 0x20u},\r
772                         {0x65u, 0x80u},\r
773                         {0x6Du, 0x80u},\r
774                         {0x79u, 0x02u},\r
775                         {0x7Au, 0x80u},\r
776                         {0x7Fu, 0x01u},\r
777                         {0x81u, 0x62u},\r
778                         {0x88u, 0x41u},\r
779                         {0x89u, 0x01u},\r
780                         {0x8Eu, 0x30u},\r
781                         {0x8Fu, 0x10u},\r
782                         {0x91u, 0x86u},\r
783                         {0x92u, 0x84u},\r
784                         {0x93u, 0x02u},\r
785                         {0x9Cu, 0x88u},\r
786                         {0x9Eu, 0x29u},\r
787                         {0x9Fu, 0x04u},\r
788                         {0xA0u, 0xC4u},\r
789                         {0xA1u, 0x08u},\r
790                         {0xA3u, 0x12u},\r
791                         {0xA5u, 0x40u},\r
792                         {0xA6u, 0x04u},\r
793                         {0xA7u, 0x04u},\r
794                         {0xA9u, 0x40u},\r
795                         {0xABu, 0x40u},\r
796                         {0xACu, 0x40u},\r
797                         {0xAFu, 0x10u},\r
798                         {0xB0u, 0x10u},\r
799                         {0xC0u, 0xF5u},\r
800                         {0xC2u, 0xFFu},\r
801                         {0xC4u, 0xF8u},\r
802                         {0xCAu, 0x43u},\r
803                         {0xCCu, 0x6Fu},\r
804                         {0xCEu, 0x68u},\r
805                         {0xD6u, 0xF0u},\r
806                         {0xD8u, 0x10u},\r
807                         {0xDEu, 0x10u},\r
808                         {0xE0u, 0x05u},\r
809                         {0xE4u, 0x44u},\r
810                         {0xE6u, 0x02u},\r
811                         {0xEAu, 0x08u},\r
812                         {0xEEu, 0x09u},\r
813                         {0x00u, 0x01u},\r
814                         {0x01u, 0x86u},\r
815                         {0x04u, 0x07u},\r
816                         {0x05u, 0x04u},\r
817                         {0x06u, 0x18u},\r
818                         {0x07u, 0x40u},\r
819                         {0x08u, 0x01u},\r
820                         {0x0Bu, 0x86u},\r
821                         {0x0Cu, 0x04u},\r
822                         {0x0Du, 0x86u},\r
823                         {0x10u, 0x10u},\r
824                         {0x11u, 0x82u},\r
825                         {0x12u, 0x40u},\r
826                         {0x15u, 0x69u},\r
827                         {0x17u, 0x06u},\r
828                         {0x18u, 0x22u},\r
829                         {0x19u, 0x82u},\r
830                         {0x1Au, 0x08u},\r
831                         {0x1Bu, 0x04u},\r
832                         {0x1Cu, 0x01u},\r
833                         {0x1Du, 0x10u},\r
834                         {0x20u, 0x01u},\r
835                         {0x21u, 0x10u},\r
836                         {0x24u, 0x08u},\r
837                         {0x25u, 0x01u},\r
838                         {0x26u, 0x21u},\r
839                         {0x27u, 0xAEu},\r
840                         {0x29u, 0xE7u},\r
841                         {0x2Bu, 0x08u},\r
842                         {0x2Cu, 0x01u},\r
843                         {0x2Du, 0x86u},\r
844                         {0x30u, 0x08u},\r
845                         {0x31u, 0x10u},\r
846                         {0x33u, 0xE0u},\r
847                         {0x34u, 0x40u},\r
848                         {0x35u, 0x0Fu},\r
849                         {0x36u, 0x3Fu},\r
850                         {0x38u, 0x80u},\r
851                         {0x39u, 0x22u},\r
852                         {0x3Bu, 0x0Cu},\r
853                         {0x3Eu, 0x41u},\r
854                         {0x54u, 0x40u},\r
855                         {0x58u, 0x08u},\r
856                         {0x59u, 0x08u},\r
857                         {0x5Bu, 0x08u},\r
858                         {0x5Cu, 0x99u},\r
859                         {0x5Du, 0x90u},\r
860                         {0x5Fu, 0x01u},\r
861                         {0x82u, 0x03u},\r
862                         {0x84u, 0x04u},\r
863                         {0x86u, 0x01u},\r
864                         {0x8Cu, 0x04u},\r
865                         {0x8Eu, 0x02u},\r
866                         {0x8Fu, 0xFFu},\r
867                         {0x93u, 0xFFu},\r
868                         {0x95u, 0x69u},\r
869                         {0x97u, 0x96u},\r
870                         {0x99u, 0x55u},\r
871                         {0x9Au, 0x04u},\r
872                         {0x9Bu, 0xAAu},\r
873                         {0x9Du, 0x33u},\r
874                         {0x9Fu, 0xCCu},\r
875                         {0xA1u, 0x0Fu},\r
876                         {0xA3u, 0xF0u},\r
877                         {0xA6u, 0x04u},\r
878                         {0xA7u, 0xFFu},\r
879                         {0xB0u, 0x07u},\r
880                         {0xB7u, 0xFFu},\r
881                         {0xBFu, 0x40u},\r
882                         {0xD8u, 0x04u},\r
883                         {0xD9u, 0x04u},\r
884                         {0xDCu, 0x09u},\r
885                         {0xDFu, 0x01u},\r
886                         {0x00u, 0x08u},\r
887                         {0x01u, 0x02u},\r
888                         {0x03u, 0x02u},\r
889                         {0x04u, 0xA0u},\r
890                         {0x05u, 0x05u},\r
891                         {0x06u, 0x04u},\r
892                         {0x0Au, 0x04u},\r
893                         {0x0Cu, 0x20u},\r
894                         {0x0Eu, 0x09u},\r
895                         {0x0Fu, 0x80u},\r
896                         {0x11u, 0x04u},\r
897                         {0x16u, 0x02u},\r
898                         {0x17u, 0x05u},\r
899                         {0x19u, 0x02u},\r
900                         {0x1Cu, 0x40u},\r
901                         {0x1Du, 0x10u},\r
902                         {0x1Fu, 0x40u},\r
903                         {0x20u, 0x02u},\r
904                         {0x24u, 0x80u},\r
905                         {0x25u, 0x20u},\r
906                         {0x26u, 0x2Eu},\r
907                         {0x27u, 0x04u},\r
908                         {0x29u, 0x02u},\r
909                         {0x2Bu, 0x10u},\r
910                         {0x2Cu, 0x20u},\r
911                         {0x2Du, 0x80u},\r
912                         {0x2Fu, 0x48u},\r
913                         {0x31u, 0x08u},\r
914                         {0x32u, 0x91u},\r
915                         {0x35u, 0x01u},\r
916                         {0x37u, 0x54u},\r
917                         {0x39u, 0x80u},\r
918                         {0x3Du, 0x80u},\r
919                         {0x3Eu, 0x19u},\r
920                         {0x46u, 0x08u},\r
921                         {0x47u, 0x20u},\r
922                         {0x66u, 0x20u},\r
923                         {0x67u, 0x21u},\r
924                         {0x7Fu, 0x01u},\r
925                         {0x8Eu, 0x24u},\r
926                         {0x91u, 0x84u},\r
927                         {0x92u, 0x26u},\r
928                         {0x93u, 0x02u},\r
929                         {0x94u, 0x40u},\r
930                         {0x96u, 0x11u},\r
931                         {0x9Au, 0x10u},\r
932                         {0x9Du, 0x1Eu},\r
933                         {0x9Eu, 0x86u},\r
934                         {0x9Fu, 0x25u},\r
935                         {0xA0u, 0x04u},\r
936                         {0xA1u, 0x08u},\r
937                         {0xA2u, 0x80u},\r
938                         {0xA3u, 0x12u},\r
939                         {0xA4u, 0x21u},\r
940                         {0xA6u, 0x25u},\r
941                         {0xA8u, 0x04u},\r
942                         {0xABu, 0x04u},\r
943                         {0xACu, 0x80u},\r
944                         {0xB1u, 0x08u},\r
945                         {0xB2u, 0x01u},\r
946                         {0xC0u, 0xFDu},\r
947                         {0xC2u, 0xD2u},\r
948                         {0xC4u, 0xB4u},\r
949                         {0xCAu, 0xF3u},\r
950                         {0xCCu, 0xFFu},\r
951                         {0xCEu, 0xF8u},\r
952                         {0xD8u, 0x70u},\r
953                         {0xDEu, 0x10u},\r
954                         {0xEAu, 0x80u},\r
955                         {0xEEu, 0x06u},\r
956                         {0x8Du, 0x08u},\r
957                         {0x8Fu, 0x02u},\r
958                         {0x9Du, 0x28u},\r
959                         {0x9Fu, 0x02u},\r
960                         {0xA8u, 0x40u},\r
961                         {0xAEu, 0x28u},\r
962                         {0xB0u, 0x08u},\r
963                         {0xB2u, 0x18u},\r
964                         {0xB3u, 0x10u},\r
965                         {0xE0u, 0x50u},\r
966                         {0xE8u, 0x20u},\r
967                         {0xEAu, 0x88u},\r
968                         {0xECu, 0x20u},\r
969                         {0x08u, 0xFFu},\r
970                         {0x14u, 0xFFu},\r
971                         {0x15u, 0x02u},\r
972                         {0x1Au, 0xFFu},\r
973                         {0x1Cu, 0x33u},\r
974                         {0x1Eu, 0xCCu},\r
975                         {0x20u, 0x55u},\r
976                         {0x21u, 0x01u},\r
977                         {0x22u, 0xAAu},\r
978                         {0x28u, 0x69u},\r
979                         {0x2Au, 0x96u},\r
980                         {0x2Cu, 0x0Fu},\r
981                         {0x2Eu, 0xF0u},\r
982                         {0x31u, 0x02u},\r
983                         {0x35u, 0x01u},\r
984                         {0x36u, 0xFFu},\r
985                         {0x3Eu, 0x40u},\r
986                         {0x3Fu, 0x11u},\r
987                         {0x58u, 0x04u},\r
988                         {0x59u, 0x04u},\r
989                         {0x5Fu, 0x01u},\r
990                         {0x84u, 0x06u},\r
991                         {0x85u, 0x0Fu},\r
992                         {0x87u, 0xF0u},\r
993                         {0x8Au, 0x03u},\r
994                         {0x8Bu, 0xFFu},\r
995                         {0x8Eu, 0x05u},\r
996                         {0x91u, 0xFFu},\r
997                         {0x95u, 0x55u},\r
998                         {0x96u, 0x01u},\r
999                         {0x97u, 0xAAu},\r
1000                         {0x98u, 0x08u},\r
1001                         {0x99u, 0x33u},\r
1002                         {0x9Bu, 0xCCu},\r
1003                         {0x9Cu, 0x08u},\r
1004                         {0xA0u, 0x08u},\r
1005                         {0xA4u, 0x08u},\r
1006                         {0xA7u, 0xFFu},\r
1007                         {0xA9u, 0x96u},\r
1008                         {0xABu, 0x69u},\r
1009                         {0xB0u, 0x08u},\r
1010                         {0xB2u, 0x07u},\r
1011                         {0xB5u, 0xFFu},\r
1012                         {0xB8u, 0x02u},\r
1013                         {0xBEu, 0x01u},\r
1014                         {0xBFu, 0x10u},\r
1015                         {0xD8u, 0x0Bu},\r
1016                         {0xD9u, 0x04u},\r
1017                         {0xDBu, 0x04u},\r
1018                         {0xDCu, 0x09u},\r
1019                         {0xDFu, 0x01u},\r
1020                         {0x00u, 0x10u},\r
1021                         {0x05u, 0x28u},\r
1022                         {0x07u, 0x02u},\r
1023                         {0x09u, 0x10u},\r
1024                         {0x0Au, 0x02u},\r
1025                         {0x0Bu, 0x20u},\r
1026                         {0x0Du, 0x20u},\r
1027                         {0x0Eu, 0x21u},\r
1028                         {0x10u, 0x08u},\r
1029                         {0x11u, 0x40u},\r
1030                         {0x12u, 0x80u},\r
1031                         {0x14u, 0x40u},\r
1032                         {0x16u, 0x20u},\r
1033                         {0x1Au, 0x01u},\r
1034                         {0x1Eu, 0xA0u},\r
1035                         {0x20u, 0x40u},\r
1036                         {0x22u, 0x20u},\r
1037                         {0x25u, 0x20u},\r
1038                         {0x28u, 0x80u},\r
1039                         {0x2Cu, 0x08u},\r
1040                         {0x2Eu, 0x08u},\r
1041                         {0x32u, 0x08u},\r
1042                         {0x34u, 0x18u},\r
1043                         {0x36u, 0x01u},\r
1044                         {0x3Du, 0x20u},\r
1045                         {0x3Fu, 0x08u},\r
1046                         {0x5Cu, 0x02u},\r
1047                         {0x5Fu, 0x94u},\r
1048                         {0x7Fu, 0x80u},\r
1049                         {0x81u, 0x50u},\r
1050                         {0x82u, 0x20u},\r
1051                         {0x83u, 0x04u},\r
1052                         {0x86u, 0x40u},\r
1053                         {0x88u, 0x50u},\r
1054                         {0x8Au, 0x01u},\r
1055                         {0x8Bu, 0x04u},\r
1056                         {0x8Cu, 0x18u},\r
1057                         {0x8Eu, 0x81u},\r
1058                         {0x93u, 0x10u},\r
1059                         {0x98u, 0x82u},\r
1060                         {0x9Bu, 0x80u},\r
1061                         {0xA3u, 0x80u},\r
1062                         {0xB3u, 0x10u},\r
1063                         {0xC0u, 0xE2u},\r
1064                         {0xC2u, 0xE7u},\r
1065                         {0xC4u, 0x3Bu},\r
1066                         {0xCAu, 0x61u},\r
1067                         {0xCCu, 0xE2u},\r
1068                         {0xCEu, 0x60u},\r
1069                         {0xD6u, 0xF0u},\r
1070                         {0xDEu, 0x80u},\r
1071                         {0xE0u, 0xF0u},\r
1072                         {0xE4u, 0x24u},\r
1073                         {0xEAu, 0x08u},\r
1074                         {0xECu, 0x80u},\r
1075                         {0xEEu, 0x09u},\r
1076                         {0x83u, 0x80u},\r
1077                         {0x84u, 0x02u},\r
1078                         {0x98u, 0x80u},\r
1079                         {0xA3u, 0x80u},\r
1080                         {0xE2u, 0x0Cu},\r
1081                         {0xE6u, 0x09u},\r
1082                         {0x83u, 0x80u},\r
1083                         {0x84u, 0x80u},\r
1084                         {0xE6u, 0x02u},\r
1085                         {0x80u, 0x01u},\r
1086                         {0x94u, 0x02u},\r
1087                         {0xB5u, 0x04u},\r
1088                         {0x05u, 0x05u},\r
1089                         {0x06u, 0x0Au},\r
1090                         {0x0Eu, 0x99u},\r
1091                         {0x15u, 0x01u},\r
1092                         {0x17u, 0x14u},\r
1093                         {0x1Du, 0x8Du},\r
1094                         {0x1Eu, 0x02u},\r
1095                         {0x1Fu, 0x1Au},\r
1096                         {0x27u, 0x40u},\r
1097                         {0x2Eu, 0x02u},\r
1098                         {0x2Fu, 0x0Au},\r
1099                         {0x36u, 0x6Au},\r
1100                         {0x3Eu, 0x15u},\r
1101                         {0x3Fu, 0x80u},\r
1102                         {0x45u, 0xA8u},\r
1103                         {0x4Cu, 0x01u},\r
1104                         {0x4Du, 0x09u},\r
1105                         {0x4Eu, 0x08u},\r
1106                         {0x4Fu, 0x01u},\r
1107                         {0x56u, 0xA8u},\r
1108                         {0x57u, 0x40u},\r
1109                         {0x66u, 0x10u},\r
1110                         {0x6Cu, 0x10u},\r
1111                         {0x6Du, 0x80u},\r
1112                         {0x6Eu, 0x95u},\r
1113                         {0x6Fu, 0x11u},\r
1114                         {0x75u, 0x80u},\r
1115                         {0x76u, 0x02u},\r
1116                         {0x7Fu, 0x01u},\r
1117                         {0x93u, 0x02u},\r
1118                         {0x94u, 0x20u},\r
1119                         {0x96u, 0x11u},\r
1120                         {0x97u, 0x21u},\r
1121                         {0x9Au, 0x10u},\r
1122                         {0x9Bu, 0x04u},\r
1123                         {0x9Du, 0x8Du},\r
1124                         {0x9Eu, 0xAAu},\r
1125                         {0x9Fu, 0x51u},\r
1126                         {0xA1u, 0x20u},\r
1127                         {0xA2u, 0x2Eu},\r
1128                         {0xA5u, 0x40u},\r
1129                         {0xA6u, 0x01u},\r
1130                         {0xA7u, 0x48u},\r
1131                         {0xC0u, 0xF0u},\r
1132                         {0xC2u, 0xF0u},\r
1133                         {0xC4u, 0x70u},\r
1134                         {0xCAu, 0xB0u},\r
1135                         {0xCCu, 0xF0u},\r
1136                         {0xCEu, 0xF0u},\r
1137                         {0xD0u, 0x70u},\r
1138                         {0xD2u, 0x30u},\r
1139                         {0xD8u, 0x20u},\r
1140                         {0xDEu, 0x10u},\r
1141                         {0xEEu, 0x0Au},\r
1142                         {0x9Du, 0x20u},\r
1143                         {0xEEu, 0x0Au},\r
1144                         {0xB5u, 0x20u},\r
1145                         {0xE8u, 0x10u},\r
1146                         {0x33u, 0x80u},\r
1147                         {0x36u, 0x40u},\r
1148                         {0x56u, 0x08u},\r
1149                         {0x58u, 0x04u},\r
1150                         {0x5Eu, 0x02u},\r
1151                         {0x62u, 0x02u},\r
1152                         {0x66u, 0x04u},\r
1153                         {0x82u, 0x04u},\r
1154                         {0xCCu, 0x30u},\r
1155                         {0xD4u, 0x40u},\r
1156                         {0xD6u, 0xC0u},\r
1157                         {0xD8u, 0xC0u},\r
1158                         {0xE2u, 0x80u},\r
1159                         {0x52u, 0x20u},\r
1160                         {0x5Fu, 0x20u},\r
1161                         {0x8Fu, 0x04u},\r
1162                         {0x94u, 0x02u},\r
1163                         {0x9Eu, 0x08u},\r
1164                         {0xA6u, 0x40u},\r
1165                         {0xA7u, 0x80u},\r
1166                         {0xAAu, 0x01u},\r
1167                         {0xACu, 0x04u},\r
1168                         {0xAEu, 0x02u},\r
1169                         {0xB4u, 0x01u},\r
1170                         {0xD4u, 0x20u},\r
1171                         {0xD6u, 0x20u},\r
1172                         {0xEAu, 0x50u},\r
1173                         {0xEEu, 0x80u},\r
1174                         {0x86u, 0x08u},\r
1175                         {0x8Eu, 0x08u},\r
1176                         {0x94u, 0x02u},\r
1177                         {0x9Eu, 0x08u},\r
1178                         {0xA3u, 0x04u},\r
1179                         {0xA6u, 0x60u},\r
1180                         {0xA7u, 0x80u},\r
1181                         {0xABu, 0x20u},\r
1182                         {0xE6u, 0x40u},\r
1183                         {0xEAu, 0x80u},\r
1184                         {0x94u, 0x02u},\r
1185                         {0x98u, 0x20u},\r
1186                         {0xA3u, 0x04u},\r
1187                         {0xA6u, 0x48u},\r
1188                         {0xA7u, 0x80u},\r
1189                         {0xAAu, 0x20u},\r
1190                         {0xB0u, 0x20u},\r
1191                         {0xEEu, 0x80u},\r
1192                         {0x0Cu, 0x02u},\r
1193                         {0x12u, 0x20u},\r
1194                         {0x53u, 0x80u},\r
1195                         {0x55u, 0x80u},\r
1196                         {0x58u, 0x80u},\r
1197                         {0x5Cu, 0x40u},\r
1198                         {0x86u, 0x20u},\r
1199                         {0xC2u, 0x04u},\r
1200                         {0xC4u, 0x08u},\r
1201                         {0xD4u, 0x07u},\r
1202                         {0xD6u, 0x04u},\r
1203                         {0x01u, 0x20u},\r
1204                         {0x06u, 0x40u},\r
1205                         {0x07u, 0x08u},\r
1206                         {0x08u, 0x02u},\r
1207                         {0x0Bu, 0x08u},\r
1208                         {0x0Du, 0x04u},\r
1209                         {0x0Fu, 0x02u},\r
1210                         {0x80u, 0x02u},\r
1211                         {0x81u, 0x20u},\r
1212                         {0x85u, 0x04u},\r
1213                         {0x87u, 0x04u},\r
1214                         {0x94u, 0x40u},\r
1215                         {0x9Cu, 0x80u},\r
1216                         {0xA0u, 0x02u},\r
1217                         {0xA5u, 0x80u},\r
1218                         {0xA7u, 0x80u},\r
1219                         {0xC0u, 0x07u},\r
1220                         {0xC2u, 0x0Fu},\r
1221                         {0x80u, 0x40u},\r
1222                         {0x88u, 0x80u},\r
1223                         {0x8Fu, 0x80u},\r
1224                         {0x94u, 0x40u},\r
1225                         {0x9Bu, 0x08u},\r
1226                         {0x9Cu, 0x80u},\r
1227                         {0xA5u, 0x80u},\r
1228                         {0xA7u, 0x80u},\r
1229                         {0xA8u, 0x02u},\r
1230                         {0xAEu, 0x40u},\r
1231                         {0xAFu, 0x01u},\r
1232                         {0xE0u, 0x06u},\r
1233                         {0x08u, 0x08u},\r
1234                         {0x0Fu, 0x40u},\r
1235                         {0xAFu, 0x08u},\r
1236                         {0xB1u, 0x80u},\r
1237                         {0xC2u, 0x0Cu},\r
1238                         {0xE8u, 0x04u},\r
1239                         {0x22u, 0x08u},\r
1240                         {0x24u, 0x02u},\r
1241                         {0x94u, 0x02u},\r
1242                         {0x98u, 0x20u},\r
1243                         {0xA3u, 0x04u},\r
1244                         {0xA6u, 0x08u},\r
1245                         {0xAEu, 0x40u},\r
1246                         {0xAFu, 0x80u},\r
1247                         {0xC8u, 0x60u},\r
1248                         {0xEEu, 0x50u},\r
1249                         {0x05u, 0x02u},\r
1250                         {0x57u, 0x04u},\r
1251                         {0x58u, 0x20u},\r
1252                         {0x81u, 0x02u},\r
1253                         {0x98u, 0x20u},\r
1254                         {0xA3u, 0x04u},\r
1255                         {0xC0u, 0x20u},\r
1256                         {0xD4u, 0xC0u},\r
1257                         {0xE4u, 0x20u},\r
1258                         {0xACu, 0x08u},\r
1259                         {0xAFu, 0x40u},\r
1260                         {0x01u, 0x01u},\r
1261                         {0x09u, 0x01u},\r
1262                         {0x0Bu, 0x01u},\r
1263                         {0x0Du, 0x01u},\r
1264                         {0x11u, 0x01u},\r
1265                         {0x1Bu, 0x01u},\r
1266                         {0x00u, 0x0Au},\r
1267                 };\r
1268 \r
1269 \r
1270 \r
1271                 CYPACKED typedef struct {\r
1272                         void CYFAR *address;\r
1273                         uint16 size;\r
1274                 } CYPACKED_ATTR cfg_memset_t;\r
1275 \r
1276 \r
1277                 CYPACKED typedef struct {\r
1278                         void CYFAR *dest;\r
1279                         const void CYCODE *src;\r
1280                         uint16 size;\r
1281                 } CYPACKED_ATTR cfg_memcpy_t;\r
1282 \r
1283                 static const cfg_memset_t CYCODE cfg_memset_list [] = {\r
1284                         /* address, size */\r
1285                         {(void CYFAR *)(CYREG_PRT1_DR), 16u},\r
1286                         {(void CYFAR *)(CYDEV_UCFG_B0_P0_U0_BASE), 4096u},\r
1287                         {(void CYFAR *)(CYDEV_UCFG_B1_P2_U0_BASE), 512u},\r
1288                         {(void CYFAR *)(CYDEV_UCFG_B1_P3_U1_BASE), 1408u},\r
1289                         {(void CYFAR *)(CYDEV_UCFG_DSI0_BASE), 2560u},\r
1290                         {(void CYFAR *)(CYDEV_UCFG_DSI12_BASE), 512u},\r
1291                         {(void CYFAR *)(CYREG_BCTL0_MDCLK_EN), 32u},\r
1292                 };\r
1293 \r
1294                 /* UDB_1_1_1_CONFIG Address: CYDEV_UCFG_B1_P3_U0_BASE Size (bytes): 128 */\r
1295                 static const uint8 CYCODE BS_UDB_1_1_1_CONFIG_VAL[] = {\r
1296                         0x24u, 0xC0u, 0x10u, 0x02u, 0x11u, 0xC0u, 0x22u, 0x04u, 0x08u, 0xC0u, 0x00u, 0x08u, 0xDCu, 0x00u, 0x00u, 0x9Fu, \r
1297                         0x0Cu, 0x00u, 0xD0u, 0x60u, 0xD0u, 0x7Fu, 0x0Cu, 0x80u, 0x30u, 0x00u, 0x0Fu, 0xFFu, 0xDCu, 0x90u, 0x00u, 0x40u, \r
1298                         0x00u, 0xC0u, 0x80u, 0x01u, 0x21u, 0x00u, 0x1Eu, 0x00u, 0xD4u, 0x1Fu, 0x08u, 0x20u, 0x00u, 0x80u, 0x00u, 0x00u, \r
1299                         0x30u, 0xFFu, 0x0Fu, 0x00u, 0x80u, 0x00u, 0x40u, 0x00u, 0x00u, 0x00u, 0x02u, 0x00u, 0x00u, 0x00u, 0x50u, 0x01u, \r
1300                         0x26u, 0x03u, 0x10u, 0x00u, 0x05u, 0xDEu, 0xFBu, 0x0Cu, 0x1Fu, 0xFFu, 0xFFu, 0xFFu, 0x22u, 0x00u, 0xF0u, 0x08u, \r
1301                         0x04u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x02u, 0x24u, 0x08u, 0x04u, 0x08u, 0x08u, 0x09u, 0x99u, 0x00u, 0x01u, \r
1302                         0x00u, 0x00u, 0xC0u, 0x00u, 0x40u, 0x01u, 0x10u, 0x11u, 0xC0u, 0x01u, 0x00u, 0x11u, 0x40u, 0x01u, 0x40u, 0x01u, \r
1303                         0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u};\r
1304 \r
1305                 static const cfg_memcpy_t CYCODE cfg_memcpy_list [] = {\r
1306                         /* dest, src, size */\r
1307                         {(void CYFAR *)(CYDEV_UCFG_B1_P3_U0_BASE), BS_UDB_1_1_1_CONFIG_VAL, 128u},\r
1308                 };\r
1309 \r
1310                 uint8 CYDATA i;\r
1311 \r
1312                 /* Zero out critical memory blocks before beginning configuration */\r
1313                 for (i = 0u; i < (sizeof(cfg_memset_list)/sizeof(cfg_memset_list[0])); i++)\r
1314                 {\r
1315                         const cfg_memset_t CYCODE * CYDATA ms = &cfg_memset_list[i];\r
1316                         CYMEMZERO(ms->address, (uint32)(ms->size));\r
1317                 }\r
1318 \r
1319                 /* Copy device configuration data into registers */\r
1320                 for (i = 0u; i < (sizeof(cfg_memcpy_list)/sizeof(cfg_memcpy_list[0])); i++)\r
1321                 {\r
1322                         const cfg_memcpy_t CYCODE * CYDATA mc = &cfg_memcpy_list[i];\r
1323                         void * CYDATA destPtr = mc->dest;\r
1324                         const void CYCODE * CYDATA srcPtr = mc->src;\r
1325                         uint16 CYDATA numBytes = mc->size;\r
1326                         CYCONFIGCPYCODE(destPtr, srcPtr, numBytes);\r
1327                 }\r
1328 \r
1329                 cfg_write_bytes32(cy_cfg_addr_table, cy_cfg_data_table);\r
1330 \r
1331                 /* Enable digital routing */\r
1332                 CY_SET_XTND_REG8((void CYFAR *)CYREG_BCTL0_BANK_CTL, CY_GET_XTND_REG8((void CYFAR *)CYREG_BCTL0_BANK_CTL) | 0x02u);\r
1333                 CY_SET_XTND_REG8((void CYFAR *)CYREG_BCTL1_BANK_CTL, CY_GET_XTND_REG8((void CYFAR *)CYREG_BCTL1_BANK_CTL) | 0x02u);\r
1334 \r
1335                 /* Enable UDB array */\r
1336                 CY_SET_XTND_REG8((void CYFAR *)CYREG_PM_ACT_CFG0, CY_GET_XTND_REG8((void CYFAR *)CYREG_PM_ACT_CFG0) | 0x40u);\r
1337                 CY_SET_XTND_REG8((void CYFAR *)CYREG_PM_AVAIL_CR2, CY_GET_XTND_REG8((void CYFAR *)CYREG_PM_AVAIL_CR2) | 0x10u);\r
1338         }\r
1339 \r
1340         /* Perform second pass device configuration. These items must be configured in specific order after the regular configuration is done. */\r
1341         CYCONFIGCPYCODE((void CYFAR *)(CYREG_PRT0_DM0), (const void CYCODE *)(BS_IOPINS0_0_VAL), 8u);\r
1342         CYCONFIGCPYCODE((void CYFAR *)(CYREG_PRT12_DR), (const void CYCODE *)(BS_IOPINS0_7_VAL), 10u);\r
1343         CYCONFIGCPYCODE((void CYFAR *)(CYREG_PRT12_DR + 0x0000000Bu), (const void CYCODE *)(BS_IOPINS1_7_VAL), 5u);\r
1344         CYCONFIGCPYCODE((void CYFAR *)(CYREG_PRT15_DR), (const void CYCODE *)(BS_IOPINS0_8_VAL), 10u);\r
1345         CYCONFIGCPYCODE((void CYFAR *)(CYREG_PRT2_DM0), (const void CYCODE *)(BS_IOPINS0_2_VAL), 8u);\r
1346         CYCONFIGCPYCODE((void CYFAR *)(CYREG_PRT3_DR), (const void CYCODE *)(BS_IOPINS0_3_VAL), 10u);\r
1347         CYCONFIGCPYCODE((void CYFAR *)(CYREG_PRT4_DM0), (const void CYCODE *)(BS_IOPINS0_4_VAL), 8u);\r
1348         CYCONFIGCPYCODE((void CYFAR *)(CYREG_PRT5_DM0), (const void CYCODE *)(BS_IOPINS0_5_VAL), 8u);\r
1349         CYCONFIGCPYCODE((void CYFAR *)(CYREG_PRT6_DM0), (const void CYCODE *)(BS_IOPINS0_6_VAL), 8u);\r
1350 \r
1351         /* Switch Boost to the precision bandgap reference from its internal reference */\r
1352         CY_SET_REG8((void CYXDATA *)CYREG_BOOST_CR2, (CY_GET_REG8((void CYXDATA *)CYREG_BOOST_CR2) | 0x08u));\r
1353 \r
1354         /* Perform basic analog initialization to defaults */\r
1355         AnalogSetDefault();\r
1356 \r
1357         /* Configure alternate active mode */\r
1358         CYCONFIGCPY((void CYFAR *)CYDEV_PM_STBY_BASE, (const void CYFAR *)CYDEV_PM_ACT_BASE, 14u);\r
1359 }\r