PDL for FM4  Version1.2
Peripheral Driverl Library for FM4
pdl.h
Go to the documentation of this file.
1 /*******************************************************************************
2 * Copyright (C) 2013 Spansion LLC. All Rights Reserved.
3 *
4 * This software is owned and published by:
5 * Spansion LLC, 915 DeGuigne Dr. Sunnyvale, CA 94088-3453 ("Spansion").
6 *
7 * BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
8 * BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
9 *
10 * This software contains source code for use with Spansion
11 * components. This software is licensed by Spansion to be adapted only
12 * for use in systems utilizing Spansion components. Spansion shall not be
13 * responsible for misuse or illegal use of this software for devices not
14 * supported herein. Spansion is providing this software "AS IS" and will
15 * not be responsible for issues arising from incorrect user implementation
16 * of the software.
17 *
18 * SPANSION MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
19 * REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
20 * ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
21 * WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
22 * WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
23 * WARRANTY OF NONINFRINGEMENT.
24 * SPANSION SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
25 * NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
26 * LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
27 * LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
28 * INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
29 * INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
30 * SAVINGS OR PROFITS,
31 * EVEN IF SPANSION HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
32 * YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
33 * INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
34 * FROM, THE SOFTWARE.
35 *
36 * This software may be replicated in part or whole for the licensed use,
37 * with the restriction that this Disclaimer and Copyright notice must be
38 * included with each copy of this software, whether used in part or whole,
39 * at all times.
40 */
41 /******************************************************************************/
52 #ifndef __PDL_H__
53 #define __PDL_H__
54 
55 /******************************************************************************/
56 /* Include files */
57 /******************************************************************************/
58 #include "base_types.h"
59 #include "mcu.h"
60 #include <stdio.h> // for printf function
61 
62 /* C binding of definitions if building with C++ compiler */
63 #ifdef __cplusplus
64 extern "C"
65 {
66 #endif
67 
68 /******************************************************************************/
69 /* Global pre-processor symbols/macros ('#define') */
70 /******************************************************************************/
72 #define PDL_ZERO_STRUCT(x) pdl_memclr((uint8_t*)&(x), (uint32_t)(sizeof(x)))
73 
79 #define PDL_ON 1u
80 #define PDL_OFF 0u
81 
82 
88 #define PDL_TYPE0 0u
89 #define PDL_TYPE1 1u
90 #define PDL_TYPE2 2u
91 #define PDL_TYPE3 3u
92 #define PDL_TYPE4 4u
93 #define PDL_TYPE5 5u
94 #define PDL_TYPE6 6u
95 #define PDL_TYPE7 7u
96 #define PDL_TYPE8 8u
97 #define PDL_TYPE9 9u
98 
99 
103 #define PDL_DEVICE_TYPE_MB9BF56X 50u
104 
109 #define PDL_DEVICE_PACKAGE_K 10u
110 #define PDL_DEVICE_PACKAGE_L 20u
111 #define PDL_DEVICE_PACKAGE_M 30u
112 #define PDL_DEVICE_PACKAGE_N 40u
113 #define PDL_DEVICE_PACKAGE_R 50u
114 #define PDL_DEVICE_PACKAGE_S 60u
115 #define PDL_DEVICE_PACKAGE_T 70u
116 
117 /******************************************************************************/
118 /* User Setting Include file */
119 /******************************************************************************/
120 #include "pdl_user.h" // MUST be included here!
121 
126 #if (PDL_MCU == PDL_DEVICE_TYPE_MB9BF56X)
127  #define PDL_DEVICE_MB9BF56X PDL_ON
128 #else
129  #define PDL_DEVICE_MB9BF56X PDL_OFF
130 #endif
131 
137 #if (PDL_DEVICE_MB9BF56X == PDL_ON)
138  #if (PDL_PACKAGE == PDL_DEVICE_PACKAGE_M) || \
139  (PDL_PACKAGE == PDL_DEVICE_PACKAGE_N) || \
140  (PDL_PACKAGE == PDL_DEVICE_PACKAGE_R)
141  #define PDL_DEVICE_TYPE PDL_TYPE0
142  #else
143  #error Device Type not defined!
144  #endif
145 
146 #else
147  #error Device not found!
148 #endif
149 
150 
155 #define PDL_DEFAULT_INTERRUPT_LEVEL 0x0Fu
156 
167 // Activate code in adc.c if one or more are set to PDL_ON
168 #if (PDL_PERIPHERAL_ENABLE_ADC0 == PDL_ON) || \
169  (PDL_PERIPHERAL_ENABLE_ADC1 == PDL_ON) || \
170  (PDL_PERIPHERAL_ENABLE_ADC2 == PDL_ON)
171  #define PDL_PERIPHERAL_ADC_ACTIVE
172  #include "adc\adc.h"
173 #endif
174 
175 // Activate code in bt.c if one or more are set to PDL_ON
176 #if (PDL_PERIPHERAL_ENABLE_BT0 == PDL_ON) || \
177  (PDL_PERIPHERAL_ENABLE_BT1 == PDL_ON) || \
178  (PDL_PERIPHERAL_ENABLE_BT2 == PDL_ON) || \
179  (PDL_PERIPHERAL_ENABLE_BT3 == PDL_ON) || \
180  (PDL_PERIPHERAL_ENABLE_BT4 == PDL_ON) || \
181  (PDL_PERIPHERAL_ENABLE_BT5 == PDL_ON) || \
182  (PDL_PERIPHERAL_ENABLE_BT6 == PDL_ON) || \
183  (PDL_PERIPHERAL_ENABLE_BT7 == PDL_ON) || \
184  (PDL_PERIPHERAL_ENABLE_BT8 == PDL_ON) || \
185  (PDL_PERIPHERAL_ENABLE_BT9 == PDL_ON) || \
186  (PDL_PERIPHERAL_ENABLE_BT10 == PDL_ON) || \
187  (PDL_PERIPHERAL_ENABLE_BT11 == PDL_ON) || \
188  (PDL_PERIPHERAL_ENABLE_BT12 == PDL_ON) || \
189  (PDL_PERIPHERAL_ENABLE_BT13 == PDL_ON) || \
190  (PDL_PERIPHERAL_ENABLE_BT14 == PDL_ON) || \
191  (PDL_PERIPHERAL_ENABLE_BT15 == PDL_ON)
192  #define PDL_PERIPHERAL_BT_ACTIVE
193  #include "bt\bt.h"
194 #endif
195 
196 // Activate code in can.c if one or more are set to PDL_ON
197 #if (PDL_PERIPHERAL_ENABLE_CAN0 == PDL_ON) || \
198  (PDL_PERIPHERAL_ENABLE_CAN1 == PDL_ON)
199  #define PDL_PERIPHERAL_CAN_ACTIVE
200  #include "can\can.h"
201 #endif
202 
203 #if ((PDL_PERIPHERAL_ENABLE_CAN0 == PDL_ON) && (PDL_INTERRUPT_ENABLE_CAN0 == PDL_OFF)) || \
204  ((PDL_PERIPHERAL_ENABLE_CAN1 == PDL_ON) && (PDL_INTERRUPT_ENABLE_CAN1 == PDL_OFF))
205  #error CAN usage without interrupts not possible!
206 #endif
207 
208 // Activate code in crc.c if set to PDL_ON
209 #if (PDL_PERIPHERAL_ENABLE_CRC0 == PDL_ON)
210  #define PDL_PERIPHERAL_CRC_ACTIVE
211  #include "crc\crc.h"
212 #endif
213 
214 // Activate code in clk.c if set to PDL_ON or WC enabled
215 #if (PDL_PERIPHERAL_ENABLE_CLK == PDL_ON)
216  #define PDL_PERIPHERAL_CLK_ACTIVE
217  #include "clk\clk.h"
218 #endif
219 
220 // Activate code in crtrim.c if set to PDL_ON
221 #if (PDL_PERIPHERAL_ENABLE_CRTRIM == PDL_ON)
222  #define PDL_PERIPHERAL_CRTRIM_ACTIVE
223  #include "crtrim\crtrim.h"
224 #endif
225 
226 // Activate code in csv.c if set to PDL_ON
227 #if (PDL_PERIPHERAL_ENABLE_CSV == PDL_ON)
228  #define PDL_PERIPHERAL_CSV_ACTIVE
229  #include "csv\csv.h"
230 #endif
231 
232 // Activate code in dac.c if one or more are set to PDL_ON
233 #if (PDL_PERIPHERAL_ENABLE_DAC0 == PDL_ON)
234  #define PDL_PERIPHERAL_DAC_ACTIVE
235  #include "dac\dac.h"
236 #endif
237 
238 // Activate code for dma.c
239 #if ((PDL_PERIPHERAL_ENABLE_DMA0 == PDL_ON) || \
240  (PDL_PERIPHERAL_ENABLE_DMA1 == PDL_ON) || \
241  (PDL_PERIPHERAL_ENABLE_DMA2 == PDL_ON) || \
242  (PDL_PERIPHERAL_ENABLE_DMA3 == PDL_ON) || \
243  (PDL_PERIPHERAL_ENABLE_DMA4 == PDL_ON) || \
244  (PDL_PERIPHERAL_ENABLE_DMA5 == PDL_ON) || \
245  (PDL_PERIPHERAL_ENABLE_DMA6 == PDL_ON) || \
246  (PDL_PERIPHERAL_ENABLE_DMA7 == PDL_ON))
247  #define PDL_PERIPHERAL_DMA_ACTIVE
248  #include "dma\dma.h"
249 #endif
250 
251 // Activate code in dstc.c if set to PDL_ON
252 #if (PDL_PERIPHERAL_ENABLE_DSTC == PDL_ON)
253  #define PDL_PERIPHERAL_DSTC_ACTIVE
254  #include "dstc\dstc.h"
255 #endif
256 
257 // Activate code in dt.c if one or more are set to PDL_ON
258 #if (PDL_PERIPHERAL_ENABLE_DT0 == PDL_ON)
259  #define PDL_PERIPHERAL_DT_ACTIVE
260  #include "dt\dt.h"
261 #endif
262 
263 // Activate code in emac.c if one or more are set to PDL_ON
264 #if (PDL_PERIPHERAL_ENABLE_EMAC0 == PDL_ON) || \
265  (PDL_PERIPHERAL_ENABLE_EMAC1 == PDL_ON)
266  #define PDL_PERIPHERAL_EMAC_ACTIVE
267  #include "emac\emac.h"
268  #include "emac\emac_user.h"
269 #endif
270 
271 // Activate code in exint.c if one or more are set to PDL_ON
272 #if (PDL_PERIPHERAL_ENABLE_EXINT0 == PDL_ON) || \
273  (PDL_PERIPHERAL_ENABLE_EXINT1 == PDL_ON) || \
274  (PDL_PERIPHERAL_ENABLE_EXINT2 == PDL_ON) || \
275  (PDL_PERIPHERAL_ENABLE_EXINT3 == PDL_ON) || \
276  (PDL_PERIPHERAL_ENABLE_EXINT4 == PDL_ON) || \
277  (PDL_PERIPHERAL_ENABLE_EXINT5 == PDL_ON) || \
278  (PDL_PERIPHERAL_ENABLE_EXINT6 == PDL_ON) || \
279  (PDL_PERIPHERAL_ENABLE_EXINT7 == PDL_ON) || \
280  (PDL_PERIPHERAL_ENABLE_EXINT8 == PDL_ON) || \
281  (PDL_PERIPHERAL_ENABLE_EXINT9 == PDL_ON) || \
282  (PDL_PERIPHERAL_ENABLE_EXINT10 == PDL_ON) || \
283  (PDL_PERIPHERAL_ENABLE_EXINT11 == PDL_ON) || \
284  (PDL_PERIPHERAL_ENABLE_EXINT12 == PDL_ON) || \
285  (PDL_PERIPHERAL_ENABLE_EXINT13 == PDL_ON) || \
286  (PDL_PERIPHERAL_ENABLE_EXINT14 == PDL_ON) || \
287  (PDL_PERIPHERAL_ENABLE_EXINT15 == PDL_ON) || \
288  (PDL_PERIPHERAL_ENABLE_EXINT16_17_18_19 == PDL_ON) || \
289  (PDL_PERIPHERAL_ENABLE_EXINT20_21_22_23 == PDL_ON) || \
290  (PDL_PERIPHERAL_ENABLE_EXINT24_25_26_27 == PDL_ON) || \
291  (PDL_PERIPHERAL_ENABLE_EXINT28_29_30_31 == PDL_ON)
292  #define PDL_PERIPHERAL_EXINT_ACTIVE
293  #include "exint\exint.h"
294 #endif
295 
296 // Activate code in extif.c if set to PDL_ON
297 #if (PDL_PERIPHERAL_ENABLE_EXTIF == PDL_ON)
298  #define PDL_PERIPHERAL_EXTIF_ACTIVE
299  #include "extif\extif.h"
300 #endif
301 
302 // Activate code in flash.c if set to PDL_ON
303 #if (PDL_PERIPHERAL_ENABLE_FLASH == PDL_ON) || \
304  (PDL_PERIPHERAL_ENABLE_CRTRIM_FLASH == PDL_ON)
305  #define PDL_PERIPHERAL_FLASH_ACTIVE
306  #include "flash\flash.h"
307 #endif
308 
309 // Activate code in gpio.c if set to PDL_ON
310 #if (PDL_PERIPHERAL_ENABLE_GPIO == PDL_ON)
311  #define PDL_PERIPHERAL_GPIO_ACTIVE
312  #include "gpio\gpio.h"
313 #endif
314 
315 // Activate code in irqsel.c if set to PDL_ON
316 #if (PDL_PERIPHERAL_ENABLE_IRQSEL == PDL_ON)
317  #define PDL_PERIPHERAL_IRQSEL_ACTIVE
318  #include "irqsel\irqsel.h"
319 #endif
320 
321 // Activate code in lpm.c if set to PDL_ON
322 #if (PDL_PERIPHERAL_ENABLE_LPM == PDL_ON)
323  #define PDL_PERIPHERAL_LPM_ACTIVE
324  #include "lpm\lpm.h"
325 #endif
326 
327 // Activate code in lvd.c if set to PDL_ON
328 #if (PDL_PERIPHERAL_ENABLE_LVD == PDL_ON)
329  #define PDL_PERIPHERAL_LVD_ACTIVE
330  #include "lvd\lvd.h"
331 #endif
332 
333 // Activate code in mfs.c if one or more are set to PDL_ON
334 #if (PDL_PERIPHERAL_ENABLE_MFS0 == PDL_ON) || \
335  (PDL_PERIPHERAL_ENABLE_MFS1 == PDL_ON) || \
336  (PDL_PERIPHERAL_ENABLE_MFS2 == PDL_ON) || \
337  (PDL_PERIPHERAL_ENABLE_MFS3 == PDL_ON) || \
338  (PDL_PERIPHERAL_ENABLE_MFS4 == PDL_ON) || \
339  (PDL_PERIPHERAL_ENABLE_MFS5 == PDL_ON) || \
340  (PDL_PERIPHERAL_ENABLE_MFS6 == PDL_ON) || \
341  (PDL_PERIPHERAL_ENABLE_MFS7 == PDL_ON) || \
342  (PDL_PERIPHERAL_ENABLE_MFS8 == PDL_ON) || \
343  (PDL_PERIPHERAL_ENABLE_MFS9 == PDL_ON) || \
344  (PDL_PERIPHERAL_ENABLE_MFS10 == PDL_ON) || \
345  (PDL_PERIPHERAL_ENABLE_MFS11 == PDL_ON) || \
346  (PDL_PERIPHERAL_ENABLE_MFS12 == PDL_ON) || \
347  (PDL_PERIPHERAL_ENABLE_MFS13 == PDL_ON) || \
348  (PDL_PERIPHERAL_ENABLE_MFS14 == PDL_ON) || \
349  (PDL_PERIPHERAL_ENABLE_MFS15 == PDL_ON)
350  #define PDL_PERIPHERAL_MFS_ACTIVE
351  #include "mfs\mfs.h"
352 #endif
353 
354 // Activate code in mft_frt.c if one or more are set to PDL_ON
355 #if (PDL_PERIPHERAL_ENABLE_MFT0_FRT == PDL_ON) || \
356  (PDL_PERIPHERAL_ENABLE_MFT1_FRT == PDL_ON) || \
357  (PDL_PERIPHERAL_ENABLE_MFT2_FRT == PDL_ON)
358  #define PDL_PERIPHERAL_MFT_FRT_ACTIVE
359  #include "mft\mft_frt.h"
360 #endif
361 
362 // Activate code in mft_ocu.c if one or more are set to PDL_ON
363 #if (PDL_PERIPHERAL_ENABLE_MFT0_OCU == PDL_ON) || \
364  (PDL_PERIPHERAL_ENABLE_MFT1_OCU == PDL_ON) || \
365  (PDL_PERIPHERAL_ENABLE_MFT2_OCU == PDL_ON)
366  #define PDL_PERIPHERAL_MFT_OCU_ACTIVE
367  #include "mft\mft_ocu.h"
368 #endif
369 
370 // Activate code in mft_wfg.c if one or more are set to PDL_ON
371 #if (PDL_PERIPHERAL_ENABLE_MFT0_WFG == PDL_ON) || \
372  (PDL_PERIPHERAL_ENABLE_MFT1_WFG == PDL_ON) || \
373  (PDL_PERIPHERAL_ENABLE_MFT2_WFG == PDL_ON)
374  #define PDL_PERIPHERAL_MFT_WFG_ACTIVE
375  #include "mft\mft_wfg.h"
376 #endif
377 
378 // Activate code in mft_icu.c if one or more are set to PDL_ON
379 #if (PDL_PERIPHERAL_ENABLE_MFT0_ICU == PDL_ON) || \
380  (PDL_PERIPHERAL_ENABLE_MFT1_ICU == PDL_ON) || \
381  (PDL_PERIPHERAL_ENABLE_MFT2_ICU == PDL_ON)
382  #define PDL_PERIPHERAL_MFT_ICU_ACTIVE
383  #include "mft\mft_icu.h"
384 #endif
385 
386 // Activate code in mft_adcmp.c if one or more are set to PDL_ON
387 #if (PDL_PERIPHERAL_ENABLE_MFT0_ADCMP == PDL_ON) || \
388  (PDL_PERIPHERAL_ENABLE_MFT1_ADCMP == PDL_ON) || \
389  (PDL_PERIPHERAL_ENABLE_MFT2_ADCMP == PDL_ON)
390  #define PDL_PERIPHERAL_MFT_ADCMP_ACTIVE
391  #include "mft\mft_adcmp.h"
392 #endif
393 
394 // Activate code in ppg.c if one or more are set to PDL_ON
395 #if (PDL_PERIPHERAL_ENABLE_PPG == PDL_ON)
396  #define PDL_PERIPHERAL_PPG_ACTIVE
397  #include "ppg\ppg.h"
398 #endif
399 
400 // Activate code in qprc.c if set to PDL_ON
401 #if (PDL_PERIPHERAL_ENABLE_QPRC0 == PDL_ON) || \
402  (PDL_PERIPHERAL_ENABLE_QPRC1 == PDL_ON) || \
403  (PDL_PERIPHERAL_ENABLE_QPRC2 == PDL_ON) || \
404  (PDL_PERIPHERAL_ENABLE_QPRC3 == PDL_ON)
405  #define PDL_PERIPHERAL_QPRC_ACTIVE
406  #include "qprc\qprc.h"
407 #endif
408 
409 // Reset Cause
410 #if (PDL_PERIPHERAL_ENABLE_RESET == PDL_ON)
411  #define PDL_PERIPHERAL_RESET_ACTIVE
412  #include "reset\reset.h"
413 #endif
414 
415 // Real Time Clock
416 #if (PDL_PERIPHERAL_ENABLE_RTC0 == PDL_ON)
417  #define PDL_PERIPHERAL_RTC_ACTIVE
418  #include "rtc\rtc.h"
419 #endif
420 
421 // Unique ID
422 #if (PDL_PERIPHERAL_ENABLE_UID == PDL_ON)
423  #define PDL_PERIPHERAL_UID_ACTIVE
424  #include "uid\uid.h"
425 #endif
426 
427 // USB Device
428 #if ((PDL_PERIPHERAL_ENABLE_USB0_DEVICE == PDL_ON) || \
429  (PDL_PERIPHERAL_ENABLE_USB1_DEVICE == PDL_ON))
430  #define PDL_PERIPHERAL_USB_DEVICE_ACTIVE
431  #include "usb\usb.h"
432 #endif
433 
434 // USB Host
435 #if ((PDL_PERIPHERAL_ENABLE_USB0_HOST == PDL_ON) || \
436  (PDL_PERIPHERAL_ENABLE_USB1_HOST == PDL_ON))
437  #define PDL_PERIPHERAL_USB_HOST_ACTIVE
438  #include "usb\usb.h"
439 #endif
440 
441 // Activate code in wc.c if one or more are set to PDL_ON
442 #if (PDL_PERIPHERAL_ENABLE_WC0 == PDL_ON)
443  #define PDL_PERIPHERAL_WC_ACTIVE
444  #include "wc\wc.h"
445 #endif
446 
447 // Activate code in wdg.c is set to PDL_ON
448 #if (PDL_PERIPHERAL_ENABLE_HWWDG == PDL_ON) || \
449  (PDL_PERIPHERAL_ENABLE_SWWDG == PDL_ON)
450  #define PDL_PERIPHERAL_WDG_ACTIVE
451  #include "wdg\wdg.h"
452 #endif
453 
454 // Activate code in sd.c is set to PDL_ON
455 #if (PDL_PERIPHERAL_ENABLE_SD == PDL_ON)
456  #define PDL_PERIPHERAL_SD_ACTIVE
457  #include "sd\sd.h"
458  #include "sd\sdcard.h"
459  #include "sd\sdcmd.h"
460 #endif
461 
466 // ADC
467 #define PDL_PERIPHERAL_ADC_AVAILABLE PDL_ON
468 
469 // Base Timer
470 #define PDL_PERIPHERAL_BT_AVAILABLE PDL_ON
471 
472 // CAN
473 #define PDL_PERIPHERAL_CAN_AVAILABLE PDL_ON
474 
475 // CRC
476 #define PDL_PERIPHERAL_CRC_AVAILABLE PDL_ON
477 
478 // Clock
479 #define PDL_PERIPHERAL_CLK_AVAILABLE PDL_ON
480 
481 // DAC
482 #define PDL_PERIPHERAL_DAC_AVAILABLE PDL_ON
483 
484 // Dual Timer
485 #define PDL_PERIPHERAL_DT_AVAILABLE PDL_ON
486 
487 // DMA
488 #define PDL_PERIPHERAL_DMA_AVAILABLE PDL_ON
489 
490 // CR Trimming
491 #define PDL_PERIPHERAL_CRTRIM_AVAILABLE PDL_ON
492 
493 // CSV
494 #define PDL_PERIPHERAL_CSV_AVAILABLE PDL_ON
495 
496 // External interrupt
497 #define PDL_PERIPHERAL_EXINT_AVAILABLE PDL_ON
498 
499 // Flash
500 #define PDL_PERIPHERAL_MAINFLASH_AVAILABLE PDL_ON
501 
502 // Work Flash
503 #define PDL_PERIPHERAL_WORKFLASH_AVAILABLE PDL_OFF
504 
505 // Dual-OP Flash
506 #define PDL_PERIPHERAL_DUALOPFLASH_AVAILABLE PDL_OFF
507 
508 // ECC-Flash
509 #define PDL_PERIPHERAL_ECCFLASH_AVAILABLE PDL_OFF
510 
511 // LVD
512 #define PDL_PERIPHERAL_LVD_AVAILABLE PDL_ON
513 
514 // MFS
515 #define PDL_PERIPHERAL_MFS_AVAILABLE PDL_ON
516 
517 // QPRC
518 #define PDL_PERIPHERAL_QPRC_AVAILABLE PDL_ON
519 
520 // RESET
521 #define PDL_PERIPHERAL_RESET_AVAILABLE PDL_ON
522 
523 // Watch counter
524 #define PDL_PERIPHERAL_WC_AVAILABLE PDL_ON
525 
526 // Hardware watchdog
527 #define PDL_PERIPHERAL_HWWDG_AVAILABLE PDL_ON
528 
529 // Software watchdog
530 #define PDL_PERIPHERAL_SWWDG_AVAILABLE PDL_ON
531 
532 // RTC
533 #define PDL_PERIPHERAL_RTC_AVAILABLE PDL_OFF
534 
535 // CEC
536 #define PDL_PERIPHERAL_CEC_AVAILABLE PDL_OFF
537 
538 // LCD
539 #define PDL_PERIPHERAL_LCD_AVAILABLE PDL_OFF
540 
541 // Unique ID
542 #define PDL_PERIPHERAL_UID_AVAILABLE PDL_ON
543 
544 // USB Device
545 #define PDL_PERIPHERAL_USB_DEVICE_AVAILABLE PDL_ON
546 
547 // USB Host
548 #define PDL_PERIPHERAL_USB_HOST_AVAILABLE PDL_ON
549 
550 /******************************************************************************/
551 /* Parameter check of pdl_user.h settings */
552 /******************************************************************************/
553 
554 #if (PDL_NO_FLASH_RAMCODE != PDL_ON) && (PDL_NO_FLASH_RAMCODE != PDL_OFF)
555  #error PDL_NO_FLASH_RAMCODE in pdl_user.h is not defined as either PDL_ON or PDL_OFF!
556 #endif
557 
558 // Value check
559 
560 #if ((PDL_DMA_CHANNELS < 1u) || (PDL_DMA_CHANNELS > 8u))
561  #error PDL_DMA_CHANNELS in pdl_user.h value out of range!
562 #endif
563 
564 /******************************************************************************/
565 /* Feature check */
566 /******************************************************************************/
567 
579 #if ((PDL_DEVICE_TYPE == PDL_TYPE0) || \
580  (PDL_DEVICE_TYPE == PDL_TYPE1))
581  #define PDL_DSM_SUPPORT PDL_ON
582 #else
583  #define PDL_DSM_SUPPORT PDL_OFF
584 #endif
585 
592 
593 #define PDL_INT_TYPE_A 0u
594 
595 #define PDL_INT_TYPE_B 1u
596 
597 #define PDL_INT_TYPE_C 2u
598 
599 #if (PDL_DEVICE_TYPE == PDL_TYPE0) || \
600  (PDL_DEVICE_TYPE == PDL_TYPE1) || \
601  (PDL_DEVICE_TYPE == PDL_TYPE2) || \
602  (PDL_DEVICE_TYPE == PDL_TYPE4) || \
603  (PDL_DEVICE_TYPE == PDL_TYPE5) || \
604  (PDL_DEVICE_TYPE == PDL_TYPE6) || \
605  (PDL_DEVICE_TYPE == PDL_TYPE8) || \
606  (PDL_DEVICE_TYPE == PDL_TYPE9)
607  #define PDL_MCU_INT_TYPE PDL_INT_TYPE_A
608 #elif (PDL_DEVICE_TYPE == PDL_TYPE3) || \
609  (PDL_DEVICE_TYPE == PDL_TYPE7)
610  #define PDL_MCU_INT_TYPE PDL_INT_TYPE_C
611 #else
612  #error MCU Interrupt Type not found!
613 #endif
614 
619 #if (PDL_MCU_INT_TYPE == PDL_INT_TYPE_A)
620  #define CSV_IRQHandler(void) IRQ000_Handler(void)
621  #define SWDT_IRQHandler(void) IRQ001_Handler(void)
622  #define LVD_IRQHandler(void) IRQ002_Handler(void)
623  #define IRQ003SEL_IRQHandler(void) IRQ003_Handler(void)
624  #define IRQ004SEL_IRQHandler(void) IRQ004_Handler(void)
625  #define IRQ005SEL_IRQ_Handler(void) IRQ005_Handler(void)
626  #define IRQ006SEL_IRQHandler(void) IRQ006_Handler(void)
627  #define IRQ007SEL_IRQHandler(void) IRQ007_Handler(void)
628  #define IRQ008SEL_IRQHandler(void) IRQ008_Handler(void)
629  #define IRQ009SEL_IRQHandler(void) IRQ009_Handler(void)
630  #define IRQ010SEL_IRQHandler(void) IRQ010_Handler(void)
631  #define EXINT0_IRQHandler(void) IRQ011_Handler(void)
632  #define EXINT1_IRQHandler(void) IRQ012_Handler(void)
633  #define EXINT2_IRQHandler(void) IRQ013_Handler(void)
634  #define EXINT3_IRQHandler(void) IRQ014_Handler(void)
635  #define EXINT4_IRQHandler(void) IRQ015_Handler(void)
636  #define EXINT5_IRQHandler(void) IRQ016_Handler(void)
637  #define EXINT6_IRQHandler(void) IRQ017_Handler(void)
638  #define EXINT7_IRQHandler(void) IRQ018_Handler(void)
639  #define QPRC0_IRQHandler(void) IRQ019_Handler(void)
640  #define QPRC1_IRQHandler(void) IRQ020_Handler(void)
641  #define WFG0_DTIF0_IRQHandler(void) IRQ021_Handler(void)
642  #define WFG1_DTIF1_IRQHandler(void) IRQ022_Handler(void)
643  #define WFG2_DTIF2_IRQHandler(void) IRQ023_Handler(void)
644  #define FRT0_PEAK_IRQHandler(void) IRQ024_Handler(void)
645  #define FRT0_ZERO_IRQHandler(void) IRQ025_Handler(void)
646  #define ICU0_IRQHandler(void) IRQ026_Handler(void)
647  #define OCU0_IRQHandler(void) IRQ027_Handler(void)
648  #define FRT1_PEAK_IRQHandler(void) IRQ028_Handler(void)
649  #define FRT1_ZERO_IRQHandler(void) IRQ029_Handler(void)
650  #define ICU1_IRQHandler(void) IRQ030_Handler(void)
651  #define OCU1_IRQHandler(void) IRQ031_Handler(void)
652  #define FRT2_PEAK_IRQHandler(void) IRQ032_Handler(void)
653  #define FRT2_ZERO_IRQHandler(void) IRQ033_Handler(void)
654  #define ICU2_IRQHandler(void) IRQ034_Handler(void)
655  #define OCU2_IRQHandler(void) IRQ035_Handler(void)
656  #define PPG00_02_04_IRQHandler(void) IRQ036_Handler(void)
657  #define PPG08_10_12_IRQHandler(void) IRQ037_Handler(void)
658  #define PPG16_18_20_IRQHandler(void) IRQ038_Handler(void)
659  #define BT0_IRQHandler(void) IRQ039_Handler(void)
660  #define BT1_IRQHandler(void) IRQ040_Handler(void)
661  #define BT2_IRQHandler(void) IRQ041_Handler(void)
662  #define BT3_IRQHandler(void) IRQ042_Handler(void)
663  #define BT4_IRQHandler(void) IRQ043_Handler(void)
664  #define BT5_IRQHandler(void) IRQ044_Handler(void)
665  #define BT6_IRQHandler(void) IRQ045_Handler(void)
666  #define BT7_IRQHandler(void) IRQ046_Handler(void)
667  #define DT1_2_IRQHandler(void) IRQ047_Handler(void)
668  #define WC_IRQHandler(void) IRQ048_Handler(void)
669  #define EXTBUS_ERR_IRQHandler(void) IRQ049_Handler(void)
670  #define RTC_IRQHandler(void) IRQ050_Handler(void)
671  #define EXINT8_IRQHandler(void) IRQ051_Handler(void)
672  #define EXINT9_IRQHandler(void) IRQ052_Handler(void)
673  #define EXINT10_IRQHandler(void) IRQ053_Handler(void)
674  #define EXINT11_IRQHandler(void) IRQ054_Handler(void)
675  #define EXINT12_IRQHandler(void) IRQ055_Handler(void)
676  #define EXINT13_IRQHandler(void) IRQ056_Handler(void)
677  #define EXINT14_IRQHandler(void) IRQ057_Handler(void)
678  #define EXINT15_IRQHandler(void) IRQ058_Handler(void)
679  #define TIM_IRQHandler(void) IRQ059_Handler(void)
680  #define MFS0_RX_IRQHandler(void) IRQ060_Handler(void)
681  #define MFS0_TX_IRQHandler(void) IRQ061_Handler(void)
682  #define MFS1_RX_IRQHandler(void) IRQ062_Handler(void)
683  #define MFS1_TX_IRQHandler(void) IRQ063_Handler(void)
684  #define MFS2_RX_IRQHandler(void) IRQ064_Handler(void)
685  #define MFS2_TX_IRQHandler(void) IRQ065_Handler(void)
686  #define MFS3_RX_IRQHandler(void) IRQ066_Handler(void)
687  #define MFS3_TX_IRQHandler(void) IRQ067_Handler(void)
688  #define MFS4_RX_IRQHandler(void) IRQ068_Handler(void)
689  #define MFS4_TX_IRQHandler(void) IRQ069_Handler(void)
690  #define MFS5_RX_IRQHandler(void) IRQ070_Handler(void)
691  #define MFS5_TX_IRQHandler(void) IRQ071_Handler(void)
692  #define MFS6_RX_IRQHandler(void) IRQ072_Handler(void)
693  #define MFS6_TX_IRQHandler(void) IRQ073_Handler(void)
694  #define MFS7_RX_IRQHandler(void) IRQ074_Handler(void)
695  #define MFS7_TX_IRQHandler(void) IRQ075_Handler(void)
696  #define ADC0_IRQHandler(void) IRQ076_Handler(void)
697  #define ADC1_IRQHandler(void) IRQ077_Handler(void)
698  #define USB0_IRQHandler(void) IRQ078_Handler(void)
699  #define USB0_HOST_IRQHandler(void) IRQ079_Handler(void)
700  #define CAN0_IRQHandler(void) IRQ080_Handler(void)
701  #define CAN1_IRQHandler(void) IRQ081_Handler(void)
702  #define ETHER0_IRQHandler(void) IRQ082_Handler(void)
703  #define DMAC0_IRQHandler(void) IRQ083_Handler(void)
704  #define DMAC1_IRQHandler(void) IRQ084_Handler(void)
705  #define DMAC2_IRQHandler(void) IRQ085_Handler(void)
706  #define DMAC3_IRQHandler(void) IRQ086_Handler(void)
707  #define DMAC4_IRQHandler(void) IRQ087_Handler(void)
708  #define DMAC5_IRQHandler(void) IRQ088_Handler(void)
709  #define DMAC6_IRQHandler(void) IRQ089_Handler(void)
710  #define DMAC7_IRQHandler(void) IRQ090_Handler(void)
711  #define DSTC_IRQHandler(void) IRQ091_Handler(void)
712  #define EXINT16_17_18_19_IRQHandler(void) IRQ092_Handler(void)
713  #define EXINT20_21_22_23_IRQHandler(void) IRQ093_Handler(void)
714  #define EXINT24_25_26_27_IRQHandler(void) IRQ094_Handler(void)
715  #define EXINT28_29_30_31_IRQHandler(void) IRQ095_Handler(void)
716  #define QPRC2_IRQHandler(void) IRQ096_Handler(void)
717  #define QPRC3_IRQHandler(void) IRQ097_Handler(void)
718  #define BT8_IRQHandler(void) IRQ098_Handler(void)
719  #define BT9_IRQHandler(void) IRQ099_Handler(void)
720  #define BT10_IRQHandler(void) IRQ100_Handler(void)
721  #define BT11_IRQHandler(void) IRQ101_Handler(void)
722  #define BT12_13_14_15_IRQHandler(void) IRQ102_Handler(void)
723  #define MFS8_RX_IRQHandler(void) IRQ103_Handler(void)
724  #define MFS8_TX_IRQHandler(void) IRQ104_Handler(void)
725  #define MFS9_RX_IRQHandler(void) IRQ105_Handler(void)
726  #define MFS9_TX_IRQHandler(void) IRQ106_Handler(void)
727  #define MFS10_RX_IRQHandler(void) IRQ107_Handler(void)
728  #define MFS10_TX_IRQHandler(void) IRQ108_Handler(void)
729  #define MFS11_RX_IRQHandler(void) IRQ109_Handler(void)
730  #define MFS11_TX_IRQHandler(void) IRQ110_Handler(void)
731  #define ADC2_IRQHandler(void) IRQ111_Handler(void)
732 // IRQ112_Handler(void) RESERVED
733  #define USB1_IRQHandler(void) IRQ113_Handler(void)
734  #define USB1_HOST_IRQHandler(void) IRQ114_Handler(void)
735 // IRQ115_Handler(void) RESERVED
736 // IRQ116_Handler(void) RESERVED
737 // IRQ117_Handler(void) RESERVED
738  #define SD_IRQHandler(void) IRQ118_Handler(void)
739  #define FLASH_IRQHandler(void) IRQ119_Handler(void)
740  #define MFS12_RX_IRQHandler(void) IRQ120_Handler(void)
741  #define MFS12_TX_IRQHandler(void) IRQ121_Handler(void)
742  #define MFS13_RX_IRQHandler(void) IRQ122_Handler(void)
743  #define MFS13_TX_IRQHandler(void) IRQ123_Handler(void)
744  #define MFS14_RX_IRQHandler(void) IRQ124_Handler(void)
745  #define MFS14_TX_IRQHandler(void) IRQ125_Handler(void)
746  #define MFS15_RX_IRQHandler(void) IRQ126_Handler(void)
747  #define MFS15_TX_IRQHandler(void) IRQ127_Handler(void)
748 #else
749  #error Interrupt Type not found!
750 #endif
751 
752 /******************************************************************************/
753 /* Global type definitions ('typedef') */
754 /******************************************************************************/
755 
756 /*****************************************************************************/
757 /* Global variable declarations ('extern', definition in C source) */
758 /*****************************************************************************/
759 
760 /*****************************************************************************/
761 /* Global function prototypes ('extern', definition in C source) */
762 /*****************************************************************************/
763 
764 /******************************************************************************
765  * Global function protoypes
766  ******************************************************************************/
767 extern void pdl_memclr(uint8_t* pu32Address, uint32_t u32Count);
768 
773 extern void PDL_WAIT_LOOP_HOOK(void);
774 
775 #ifdef __cplusplus
776 }
777 #endif
778 
779 #endif /* __PDL_H__ */
780 
781 /******************************************************************************/
782 /* EOF (not truncated) */
783 /******************************************************************************/
784