Go to the documentation of this file.
19 #define BYTE_REF(addr) (*((volatile unsigned char*)addr))
20 #define WORD_REF(addr) (*((volatile unsigned short*)addr))
21 #define LONG_REF(addr) (*((volatile unsigned long*)addr))
23 #define PUT_FIELD(field, val) (((val) << field##_SHIFT) & field##_MASK)
24 #define GET_FIELD(reg, field) (((reg) & field##_MASK) >> field##_SHIFT)
35 #define SCR_ADDR 0xfffff000
36 #define SCR BYTE_REF(SCR_ADDR)
38 #define SCR_WDTH8 0x01
41 #define SCR_BETEN 0x10
49 #define MRR_ADDR 0xfffff004
50 #define MRR LONG_REF(MRR_ADDR)
61 #define CSGBA_ADDR 0xfffff100
62 #define CSGBB_ADDR 0xfffff102
64 #define CSGBC_ADDR 0xfffff104
65 #define CSGBD_ADDR 0xfffff106
67 #define CSGBA WORD_REF(CSGBA_ADDR)
68 #define CSGBB WORD_REF(CSGBB_ADDR)
69 #define CSGBC WORD_REF(CSGBC_ADDR)
70 #define CSGBD WORD_REF(CSGBD_ADDR)
75 #define CSA_ADDR 0xfffff110
76 #define CSB_ADDR 0xfffff112
77 #define CSC_ADDR 0xfffff114
78 #define CSD_ADDR 0xfffff116
80 #define CSA WORD_REF(CSA_ADDR)
81 #define CSB WORD_REF(CSB_ADDR)
82 #define CSC WORD_REF(CSC_ADDR)
83 #define CSD WORD_REF(CSD_ADDR)
86 #define CSA_SIZ_MASK 0x000e
87 #define CSA_SIZ_SHIFT 1
88 #define CSA_WS_MASK 0x0070
89 #define CSA_WS_SHIFT 4
90 #define CSA_BSW 0x0080
91 #define CSA_FLASH 0x0100
95 #define CSB_SIZ_MASK 0x000e
96 #define CSB_SIZ_SHIFT 1
97 #define CSB_WS_MASK 0x0070
98 #define CSB_WS_SHIFT 4
99 #define CSB_BSW 0x0080
100 #define CSB_FLASH 0x0100
101 #define CSB_UPSIZ_MASK 0x1800
102 #define CSB_UPSIZ_SHIFT 11
103 #define CSB_ROP 0x2000
104 #define CSB_SOP 0x4000
105 #define CSB_RO 0x8000
107 #define CSC_EN 0x0001
108 #define CSC_SIZ_MASK 0x000e
109 #define CSC_SIZ_SHIFT 1
110 #define CSC_WS_MASK 0x0070
111 #define CSC_WS_SHIFT 4
112 #define CSC_BSW 0x0080
113 #define CSC_FLASH 0x0100
114 #define CSC_UPSIZ_MASK 0x1800
115 #define CSC_UPSIZ_SHIFT 11
116 #define CSC_ROP 0x2000
117 #define CSC_SOP 0x4000
118 #define CSC_RO 0x8000
120 #define CSD_EN 0x0001
121 #define CSD_SIZ_MASK 0x000e
122 #define CSD_SIZ_SHIFT 1
123 #define CSD_WS_MASK 0x0070
124 #define CSD_WS_SHIFT 4
125 #define CSD_BSW 0x0080
126 #define CSD_FLASH 0x0100
127 #define CSD_DRAM 0x0200
128 #define CSD_COMB 0x0400
129 #define CSD_UPSIZ_MASK 0x1800
130 #define CSD_UPSIZ_SHIFT 11
131 #define CSD_ROP 0x2000
132 #define CSD_SOP 0x4000
133 #define CSD_RO 0x8000
138 #define EMUCS_ADDR 0xfffff118
139 #define EMUCS WORD_REF(EMUCS_ADDR)
141 #define EMUCS_WS_MASK 0x0070
142 #define EMUCS_WS_SHIFT 4
153 #define PLLCR_ADDR 0xfffff200
154 #define PLLCR WORD_REF(PLLCR_ADDR)
156 #define PLLCR_DISPLL 0x0008
157 #define PLLCR_CLKEN 0x0010
158 #define PLLCR_PRESC 0x0020
159 #define PLLCR_SYSCLK_SEL_MASK 0x0700
160 #define PLLCR_SYSCLK_SEL_SHIFT 8
161 #define PLLCR_LCDCLK_SEL_MASK 0x3800
162 #define PLLCR_LCDCLK_SEL_SHIFT 11
165 #define PLLCR_PIXCLK_SEL_MASK PLLCR_LCDCLK_SEL_MASK
166 #define PLLCR_PIXCLK_SEL_SHIFT PLLCR_LCDCLK_SEL_SHIFT
171 #define PLLFSR_ADDR 0xfffff202
172 #define PLLFSR WORD_REF(PLLFSR_ADDR)
174 #define PLLFSR_PC_MASK 0x00ff
175 #define PLLFSR_PC_SHIFT 0
176 #define PLLFSR_QC_MASK 0x0f00
177 #define PLLFSR_QC_SHIFT 8
178 #define PLLFSR_PROT 0x4000
179 #define PLLFSR_CLK32 0x8000
184 #define PCTRL_ADDR 0xfffff207
185 #define PCTRL BYTE_REF(PCTRL_ADDR)
187 #define PCTRL_WIDTH_MASK 0x1f
188 #define PCTRL_WIDTH_SHIFT 0
189 #define PCTRL_PCEN 0x80
200 #define IVR_ADDR 0xfffff300
201 #define IVR BYTE_REF(IVR_ADDR)
203 #define IVR_VECTOR_MASK 0xF8
208 #define ICR_ADDR 0xfffff302
209 #define ICR WORD_REF(ICR_ADDR)
211 #define ICR_POL5 0x0080
212 #define ICR_ET6 0x0100
213 #define ICR_ET3 0x0200
214 #define ICR_ET2 0x0400
215 #define ICR_ET1 0x0800
216 #define ICR_POL6 0x1000
217 #define ICR_POL3 0x2000
218 #define ICR_POL2 0x4000
219 #define ICR_POL1 0x8000
224 #define IMR_ADDR 0xfffff304
225 #define IMR LONG_REF(IMR_ADDR)
231 #define SPI2_IRQ_NUM 0
232 #define TMR_IRQ_NUM 1
233 #define UART1_IRQ_NUM 2
234 #define WDT_IRQ_NUM 3
235 #define RTC_IRQ_NUM 4
236 #define TMR2_IRQ_NUM 5
238 #define PWM1_IRQ_NUM 7
239 #define INT0_IRQ_NUM 8
240 #define INT1_IRQ_NUM 9
241 #define INT2_IRQ_NUM 10
242 #define INT3_IRQ_NUM 11
243 #define UART2_IRQ_NUM 12
244 #define PWM2_IRQ_NUM 13
245 #define IRQ1_IRQ_NUM 16
246 #define IRQ2_IRQ_NUM 17
247 #define IRQ3_IRQ_NUM 18
248 #define IRQ6_IRQ_NUM 19
249 #define IRQ5_IRQ_NUM 20
250 #define SPI1_IRQ_NUM 21
251 #define SAM_IRQ_NUM 22
252 #define EMIQ_IRQ_NUM 23
254 #define SPI_IRQ_NUM SPI2_IRQ_NUM
257 #define SPIM_IRQ_NUM SPI_IRQ_NUM
258 #define TMR1_IRQ_NUM TMR_IRQ_NUM
259 #define UART_IRQ_NUM UART1_IRQ_NUM
264 #define IMR_MSPI (1 << SPI_IRQ_NUM)
265 #define IMR_MTMR (1 << TMR_IRQ_NUM)
266 #define IMR_MUART (1 << UART_IRQ_NUM)
267 #define IMR_MWDT (1 << WDT_IRQ_NUM)
268 #define IMR_MRTC (1 << RTC_IRQ_NUM)
269 #define IMR_MKB (1 << KB_IRQ_NUM)
270 #define IMR_MPWM (1 << PWM_IRQ_NUM)
271 #define IMR_MINT0 (1 << INT0_IRQ_NUM)
272 #define IMR_MINT1 (1 << INT1_IRQ_NUM)
273 #define IMR_MINT2 (1 << INT2_IRQ_NUM)
274 #define IMR_MINT3 (1 << INT3_IRQ_NUM)
275 #define IMR_MIRQ1 (1 << IRQ1_IRQ_NUM)
276 #define IMR_MIRQ2 (1 << IRQ2_IRQ_NUM)
277 #define IMR_MIRQ3 (1 << IRQ3_IRQ_NUM)
278 #define IMR_MIRQ6 (1 << IRQ6_IRQ_NUM)
279 #define IMR_MIRQ5 (1 << IRQ5_IRQ_NUM)
280 #define IMR_MSAM (1 << SAM_IRQ_NUM)
281 #define IMR_MEMIQ (1 << EMIQ_IRQ_NUM)
284 #define IMR_MSPIM IMR_MSPI
285 #define IMR_MTMR1 IMR_MTMR
290 #define ISR_ADDR 0xfffff30c
291 #define ISR LONG_REF(ISR_ADDR)
293 #define ISR_SPI (1 << SPI_IRQ_NUM)
294 #define ISR_TMR (1 << TMR_IRQ_NUM)
295 #define ISR_UART (1 << UART_IRQ_NUM)
296 #define ISR_WDT (1 << WDT_IRQ_NUM)
297 #define ISR_RTC (1 << RTC_IRQ_NUM)
298 #define ISR_KB (1 << KB_IRQ_NUM)
299 #define ISR_PWM (1 << PWM_IRQ_NUM)
300 #define ISR_INT0 (1 << INT0_IRQ_NUM)
301 #define ISR_INT1 (1 << INT1_IRQ_NUM)
302 #define ISR_INT2 (1 << INT2_IRQ_NUM)
303 #define ISR_INT3 (1 << INT3_IRQ_NUM)
304 #define ISR_IRQ1 (1 << IRQ1_IRQ_NUM)
305 #define ISR_IRQ2 (1 << IRQ2_IRQ_NUM)
306 #define ISR_IRQ3 (1 << IRQ3_IRQ_NUM)
307 #define ISR_IRQ6 (1 << IRQ6_IRQ_NUM)
308 #define ISR_IRQ5 (1 << IRQ5_IRQ_NUM)
309 #define ISR_SAM (1 << SAM_IRQ_NUM)
310 #define ISR_EMIQ (1 << EMIQ_IRQ_NUM)
313 #define ISR_SPIM ISR_SPI
314 #define ISR_TMR1 ISR_TMR
319 #define IPR_ADDR 0xfffff30c
320 #define IPR LONG_REF(IPR_ADDR)
322 #define IPR_SPI (1 << SPI_IRQ_NUM)
323 #define IPR_TMR (1 << TMR_IRQ_NUM)
324 #define IPR_UART (1 << UART_IRQ_NUM)
325 #define IPR_WDT (1 << WDT_IRQ_NUM)
326 #define IPR_RTC (1 << RTC_IRQ_NUM)
327 #define IPR_KB (1 << KB_IRQ_NUM)
328 #define IPR_PWM (1 << PWM_IRQ_NUM)
329 #define IPR_INT0 (1 << INT0_IRQ_NUM)
330 #define IPR_INT1 (1 << INT1_IRQ_NUM)
331 #define IPR_INT2 (1 << INT2_IRQ_NUM)
332 #define IPR_INT3 (1 << INT3_IRQ_NUM)
333 #define IPR_IRQ1 (1 << IRQ1_IRQ_NUM)
334 #define IPR_IRQ2 (1 << IRQ2_IRQ_NUM)
335 #define IPR_IRQ3 (1 << IRQ3_IRQ_NUM)
336 #define IPR_IRQ6 (1 << IRQ6_IRQ_NUM)
337 #define IPR_IRQ5 (1 << IRQ5_IRQ_NUM)
338 #define IPR_SAM (1 << SAM_IRQ_NUM)
339 #define IPR_EMIQ (1 << EMIQ_IRQ_NUM)
342 #define IPR_SPIM IPR_SPI
343 #define IPR_TMR1 IPR_TMR
354 #define PADIR_ADDR 0xfffff400
355 #define PADATA_ADDR 0xfffff401
356 #define PAPUEN_ADDR 0xfffff402
358 #define PADIR BYTE_REF(PADIR_ADDR)
359 #define PADATA BYTE_REF(PADATA_ADDR)
360 #define PAPUEN BYTE_REF(PAPUEN_ADDR)
362 #define PA(x) (1 << (x))
367 #define PBDIR_ADDR 0xfffff408
368 #define PBDATA_ADDR 0xfffff409
369 #define PBPUEN_ADDR 0xfffff40a
370 #define PBSEL_ADDR 0xfffff40b
372 #define PBDIR BYTE_REF(PBDIR_ADDR)
373 #define PBDATA BYTE_REF(PBDATA_ADDR)
374 #define PBPUEN BYTE_REF(PBPUEN_ADDR)
375 #define PBSEL BYTE_REF(PBSEL_ADDR)
377 #define PB(x) (1 << (x))
381 #define PB_CSC0_RAS0 0x04
382 #define PB_CSC1_RAS1 0x08
383 #define PB_CSD0_CAS0 0x10
384 #define PB_CSD1_CAS1 0x20
385 #define PB_TIN_TOUT 0x40
391 #define PCDIR_ADDR 0xfffff410
392 #define PCDATA_ADDR 0xfffff411
393 #define PCPDEN_ADDR 0xfffff412
394 #define PCSEL_ADDR 0xfffff413
396 #define PCDIR BYTE_REF(PCDIR_ADDR)
397 #define PCDATA BYTE_REF(PCDATA_ADDR)
398 #define PCPDEN BYTE_REF(PCPDEN_ADDR)
399 #define PCSEL BYTE_REF(PCSEL_ADDR)
401 #define PC(x) (1 << (x))
415 #define PDDIR_ADDR 0xfffff418
416 #define PDDATA_ADDR 0xfffff419
417 #define PDPUEN_ADDR 0xfffff41a
418 #define PDSEL_ADDR 0xfffff41b
419 #define PDPOL_ADDR 0xfffff41c
420 #define PDIRQEN_ADDR 0xfffff41d
421 #define PDKBEN_ADDR 0xfffff41e
422 #define PDIQEG_ADDR 0xfffff41f
424 #define PDDIR BYTE_REF(PDDIR_ADDR)
425 #define PDDATA BYTE_REF(PDDATA_ADDR)
426 #define PDPUEN BYTE_REF(PDPUEN_ADDR)
427 #define PDSEL BYTE_REF(PDSEL_ADDR)
428 #define PDPOL BYTE_REF(PDPOL_ADDR)
429 #define PDIRQEN BYTE_REF(PDIRQEN_ADDR)
430 #define PDKBEN BYTE_REF(PDKBEN_ADDR)
431 #define PDIQEG BYTE_REF(PDIQEG_ADDR)
433 #define PD(x) (1 << (x))
447 #define PEDIR_ADDR 0xfffff420
448 #define PEDATA_ADDR 0xfffff421
449 #define PEPUEN_ADDR 0xfffff422
450 #define PESEL_ADDR 0xfffff423
452 #define PEDIR BYTE_REF(PEDIR_ADDR)
453 #define PEDATA BYTE_REF(PEDATA_ADDR)
454 #define PEPUEN BYTE_REF(PEPUEN_ADDR)
455 #define PESEL BYTE_REF(PESEL_ADDR)
457 #define PE(x) (1 << (x))
459 #define PE_SPMTXD 0x01
460 #define PE_SPMRXD 0x02
461 #define PE_SPMCLK 0x04
471 #define PFDIR_ADDR 0xfffff428
472 #define PFDATA_ADDR 0xfffff429
473 #define PFPUEN_ADDR 0xfffff42a
474 #define PFSEL_ADDR 0xfffff42b
476 #define PFDIR BYTE_REF(PFDIR_ADDR)
477 #define PFDATA BYTE_REF(PFDATA_ADDR)
478 #define PFPUEN BYTE_REF(PFPUEN_ADDR)
479 #define PFSEL BYTE_REF(PFSEL_ADDR)
481 #define PF(x) (1 << (x))
483 #define PF_LCONTRAST 0x01
495 #define PGDIR_ADDR 0xfffff430
496 #define PGDATA_ADDR 0xfffff431
497 #define PGPUEN_ADDR 0xfffff432
498 #define PGSEL_ADDR 0xfffff433
500 #define PGDIR BYTE_REF(PGDIR_ADDR)
501 #define PGDATA BYTE_REF(PGDATA_ADDR)
502 #define PGPUEN BYTE_REF(PGPUEN_ADDR)
503 #define PGSEL BYTE_REF(PGSEL_ADDR)
505 #define PG(x) (1 << (x))
507 #define PG_BUSW_DTACK 0x01
509 #define PG_EMUIRQ 0x04
510 #define PG_HIZ_P_D 0x08
511 #define PG_EMUCS 0x10
512 #define PG_EMUBRK 0x20
517 #define PJDIR_ADDR 0xfffff438
518 #define PJDATA_ADDR 0xfffff439
519 #define PJPUEN_ADDR 0xfffff43A
520 #define PJSEL_ADDR 0xfffff43B
522 #define PJDIR BYTE_REF(PJDIR_ADDR)
523 #define PJDATA BYTE_REF(PJDATA_ADDR)
524 #define PJPUEN BYTE_REF(PJPUEN_ADDR)
525 #define PJSEL BYTE_REF(PJSEL_ADDR)
527 #define PJ(x) (1 << (x))
532 #define PKDIR_ADDR 0xfffff440
533 #define PKDATA_ADDR 0xfffff441
534 #define PKPUEN_ADDR 0xfffff442
535 #define PKSEL_ADDR 0xfffff443
537 #define PKDIR BYTE_REF(PKDIR_ADDR)
538 #define PKDATA BYTE_REF(PKDATA_ADDR)
539 #define PKPUEN BYTE_REF(PKPUEN_ADDR)
540 #define PKSEL BYTE_REF(PKSEL_ADDR)
542 #define PK(x) (1 << (x))
544 #define PK_DATAREADY 0x01
554 #define PJDIR_ADDR 0xfffff438
555 #define PJDATA_ADDR 0xfffff439
556 #define PJPUEN_ADDR 0xfffff43A
557 #define PJSEL_ADDR 0xfffff43B
559 #define PJDIR BYTE_REF(PJDIR_ADDR)
560 #define PJDATA BYTE_REF(PJDATA_ADDR)
561 #define PJPUEN BYTE_REF(PJPUEN_ADDR)
562 #define PJSEL BYTE_REF(PJSEL_ADDR)
564 #define PJ(x) (1 << (x))
568 #define PJ_SPICLK1 0x04
578 #define PMDIR_ADDR 0xfffff448
579 #define PMDATA_ADDR 0xfffff449
580 #define PMPUEN_ADDR 0xfffff44a
581 #define PMSEL_ADDR 0xfffff44b
583 #define PMDIR BYTE_REF(PMDIR_ADDR)
584 #define PMDATA BYTE_REF(PMDATA_ADDR)
585 #define PMPUEN BYTE_REF(PMPUEN_ADDR)
586 #define PMSEL BYTE_REF(PMSEL_ADDR)
588 #define PM(x) (1 << (x))
590 #define PM_SDCLK 0x01
594 #define PM_SDA10 0x10
606 #define PWMC_ADDR 0xfffff500
607 #define PWMC WORD_REF(PWMC_ADDR)
609 #define PWMC_CLKSEL_MASK 0x0003
610 #define PWMC_CLKSEL_SHIFT 0
611 #define PWMC_REPEAT_MASK 0x000c
612 #define PWMC_REPEAT_SHIFT 2
613 #define PWMC_EN 0x0010
614 #define PMNC_FIFOAV 0x0020
615 #define PWMC_IRQEN 0x0040
616 #define PWMC_IRQ 0x0080
617 #define PWMC_PRESCALER_MASK 0x7f00
618 #define PWMC_PRESCALER_SHIFT 8
619 #define PWMC_CLKSRC 0x8000
622 #define PWMC_PWMEN PWMC_EN
627 #define PWMS_ADDR 0xfffff502
628 #define PWMS WORD_REF(PWMS_ADDR)
633 #define PWMP_ADDR 0xfffff504
634 #define PWMP BYTE_REF(PWMP_ADDR)
639 #define PWMCNT_ADDR 0xfffff505
640 #define PWMCNT BYTE_REF(PWMCNT_ADDR)
651 #define TCTL_ADDR 0xfffff600
652 #define TCTL WORD_REF(TCTL_ADDR)
654 #define TCTL_TEN 0x0001
655 #define TCTL_CLKSOURCE_MASK 0x000e
656 #define TCTL_CLKSOURCE_STOP 0x0000
657 #define TCTL_CLKSOURCE_SYSCLK 0x0002
658 #define TCTL_CLKSOURCE_SYSCLK_16 0x0004
659 #define TCTL_CLKSOURCE_TIN 0x0006
660 #define TCTL_CLKSOURCE_32KHZ 0x0008
661 #define TCTL_IRQEN 0x0010
662 #define TCTL_OM 0x0020
663 #define TCTL_CAP_MASK 0x00c0
664 #define TCTL_CAP_RE 0x0040
665 #define TCTL_CAP_FE 0x0080
666 #define TCTL_FRR 0x0010
669 #define TCTL1_ADDR TCTL_ADDR
675 #define TPRER_ADDR 0xfffff602
676 #define TPRER WORD_REF(TPRER_ADDR)
679 #define TPRER1_ADDR TPRER_ADDR
685 #define TCMP_ADDR 0xfffff604
686 #define TCMP WORD_REF(TCMP_ADDR)
689 #define TCMP1_ADDR TCMP_ADDR
695 #define TCR_ADDR 0xfffff606
696 #define TCR WORD_REF(TCR_ADDR)
699 #define TCR1_ADDR TCR_ADDR
705 #define TCN_ADDR 0xfffff608
706 #define TCN WORD_REF(TCN_ADDR)
709 #define TCN1_ADDR TCN_ADDR
715 #define TSTAT_ADDR 0xfffff60a
716 #define TSTAT WORD_REF(TSTAT_ADDR)
718 #define TSTAT_COMP 0x0001
719 #define TSTAT_CAPT 0x0001
722 #define TSTAT1_ADDR TSTAT_ADDR
734 #define SPIMDATA_ADDR 0xfffff800
735 #define SPIMDATA WORD_REF(SPIMDATA_ADDR)
740 #define SPIMCONT_ADDR 0xfffff802
741 #define SPIMCONT WORD_REF(SPIMCONT_ADDR)
743 #define SPIMCONT_BIT_COUNT_MASK 0x000f
744 #define SPIMCONT_BIT_COUNT_SHIFT 0
745 #define SPIMCONT_POL 0x0010
746 #define SPIMCONT_PHA 0x0020
747 #define SPIMCONT_IRQEN 0x0040
748 #define SPIMCONT_IRQ 0x0080
749 #define SPIMCONT_XCH 0x0100
750 #define SPIMCONT_ENABLE 0x0200
751 #define SPIMCONT_DATA_RATE_MASK 0xe000
752 #define SPIMCONT_DATA_RATE_SHIFT 13
755 #define SPIMCONT_SPIMIRQ SPIMCONT_IRQ
756 #define SPIMCONT_SPIMEN SPIMCONT_ENABLE
768 #define USTCNT_ADDR 0xfffff900
769 #define USTCNT WORD_REF(USTCNT_ADDR)
771 #define USTCNT_TXAE 0x0001
772 #define USTCNT_TXHE 0x0002
773 #define USTCNT_TXEE 0x0004
774 #define USTCNT_RXRE 0x0008
775 #define USTCNT_RXHE 0x0010
776 #define USTCNT_RXFE 0x0020
777 #define USTCNT_CTSD 0x0040
778 #define USTCNT_ODEN 0x0080
779 #define USTCNT_8_7 0x0100
780 #define USTCNT_STOP 0x0200
781 #define USTCNT_ODD 0x0400
782 #define USTCNT_PEN 0x0800
783 #define USTCNT_CLKM 0x1000
784 #define USTCNT_TXEN 0x2000
785 #define USTCNT_RXEN 0x4000
786 #define USTCNT_UEN 0x8000
789 #define USTCNT_TXAVAILEN USTCNT_TXAE
790 #define USTCNT_TXHALFEN USTCNT_TXHE
791 #define USTCNT_TXEMPTYEN USTCNT_TXEE
792 #define USTCNT_RXREADYEN USTCNT_RXRE
793 #define USTCNT_RXHALFEN USTCNT_RXHE
794 #define USTCNT_RXFULLEN USTCNT_RXFE
795 #define USTCNT_CTSDELTAEN USTCNT_CTSD
796 #define USTCNT_ODD_EVEN USTCNT_ODD
797 #define USTCNT_PARITYEN USTCNT_PEN
798 #define USTCNT_CLKMODE USTCNT_CLKM
799 #define USTCNT_UARTEN USTCNT_UEN
804 #define UBAUD_ADDR 0xfffff902
805 #define UBAUD WORD_REF(UBAUD_ADDR)
807 #define UBAUD_PRESCALER_MASK 0x003f
808 #define UBAUD_PRESCALER_SHIFT 0
809 #define UBAUD_DIVIDE_MASK 0x0700
810 #define UBAUD_DIVIDE_SHIFT 8
811 #define UBAUD_BAUD_SRC 0x0800
812 #define UBAUD_UCLKDIR 0x2000
817 #define URX_ADDR 0xfffff904
818 #define URX WORD_REF(URX_ADDR)
820 #define URX_RXDATA_ADDR 0xfffff905
821 #define URX_RXDATA BYTE_REF(URX_RXDATA_ADDR)
823 #define URX_RXDATA_MASK 0x00ff
824 #define URX_RXDATA_SHIFT 0
825 #define URX_PARITY_ERROR 0x0100
826 #define URX_BREAK 0x0200
827 #define URX_FRAME_ERROR 0x0400
828 #define URX_OVRUN 0x0800
829 #define URX_OLD_DATA 0x1000
830 #define URX_DATA_READY 0x2000
831 #define URX_FIFO_HALF 0x4000
832 #define URX_FIFO_FULL 0x8000
837 #define UTX_ADDR 0xfffff906
838 #define UTX WORD_REF(UTX_ADDR)
840 #define UTX_TXDATA_ADDR 0xfffff907
841 #define UTX_TXDATA BYTE_REF(UTX_TXDATA_ADDR)
843 #define UTX_TXDATA_MASK 0x00ff
844 #define UTX_TXDATA_SHIFT 0
845 #define UTX_CTS_DELTA 0x0100
846 #define UTX_CTS_STAT 0x0200
847 #define UTX_BUSY 0x0400
848 #define UTX_NOCTS 0x0800
849 #define UTX_SEND_BREAK 0x1000
850 #define UTX_TX_AVAIL 0x2000
851 #define UTX_FIFO_HALF 0x4000
852 #define UTX_FIFO_EMPTY 0x8000
855 #define UTX_CTS_STATUS UTX_CTS_STAT
856 #define UTX_IGNORE_CTS UTX_NOCTS
861 #define UMISC_ADDR 0xfffff908
862 #define UMISC WORD_REF(UMISC_ADDR)
864 #define UMISC_TX_POL 0x0004
865 #define UMISC_RX_POL 0x0008
866 #define UMISC_IRDA_LOOP 0x0010
867 #define UMISC_IRDA_EN 0x0020
868 #define UMISC_RTS 0x0040
869 #define UMISC_RTSCONT 0x0080
870 #define UMISC_IR_TEST 0x0400
871 #define UMISC_BAUD_RESET 0x0800
872 #define UMISC_LOOP 0x1000
873 #define UMISC_FORCE_PERR 0x2000
874 #define UMISC_CLKSRC 0x4000
875 #define UMISC_BAUD_TEST 0x8000
880 #define NIPR_ADDR 0xfffff90a
881 #define NIPR WORD_REF(NIPR_ADDR)
883 #define NIPR_STEP_VALUE_MASK 0x00ff
884 #define NIPR_STEP_VALUE_SHIFT 0
885 #define NIPR_SELECT_MASK 0x0700
886 #define NIPR_SELECT_SHIFT 8
887 #define NIPR_PRE_SEL 0x8000
892 volatile unsigned short int ustcnt;
893 volatile unsigned short int ubaud;
895 volatile unsigned short int w;
897 volatile unsigned char status;
898 volatile unsigned char rxdata;
902 volatile unsigned short int w;
904 volatile unsigned char status;
905 volatile unsigned char txdata;
908 volatile unsigned short int umisc;
909 volatile unsigned short int nipr;
926 #define LSSA_ADDR 0xfffffa00
927 #define LSSA LONG_REF(LSSA_ADDR)
929 #define LSSA_SSA_MASK 0x1ffffffe
934 #define LVPW_ADDR 0xfffffa05
935 #define LVPW BYTE_REF(LVPW_ADDR)
940 #define LXMAX_ADDR 0xfffffa08
941 #define LXMAX WORD_REF(LXMAX_ADDR)
943 #define LXMAX_XM_MASK 0x02f0
948 #define LYMAX_ADDR 0xfffffa0a
949 #define LYMAX WORD_REF(LYMAX_ADDR)
951 #define LYMAX_YM_MASK 0x01ff
956 #define LCXP_ADDR 0xfffffa18
957 #define LCXP WORD_REF(LCXP_ADDR)
959 #define LCXP_CC_MASK 0xc000
960 #define LCXP_CC_TRAMSPARENT 0x0000
961 #define LCXP_CC_BLACK 0x4000
962 #define LCXP_CC_REVERSED 0x8000
963 #define LCXP_CC_WHITE 0xc000
964 #define LCXP_CXP_MASK 0x02ff
969 #define LCYP_ADDR 0xfffffa1a
970 #define LCYP WORD_REF(LCYP_ADDR)
972 #define LCYP_CYP_MASK 0x01ff
977 #define LCWCH_ADDR 0xfffffa1c
978 #define LCWCH WORD_REF(LCWCH_ADDR)
980 #define LCWCH_CH_MASK 0x001f
981 #define LCWCH_CH_SHIFT 0
982 #define LCWCH_CW_MASK 0x1f00
983 #define LCWCH_CW_SHIFT 8
988 #define LBLKC_ADDR 0xfffffa1f
989 #define LBLKC BYTE_REF(LBLKC_ADDR)
991 #define LBLKC_BD_MASK 0x7f
992 #define LBLKC_BD_SHIFT 0
993 #define LBLKC_BKEN 0x80
998 #define LPICF_ADDR 0xfffffa20
999 #define LPICF BYTE_REF(LPICF_ADDR)
1001 #define LPICF_GS_MASK 0x03
1002 #define LPICF_GS_BW 0x00
1003 #define LPICF_GS_GRAY_4 0x01
1004 #define LPICF_GS_GRAY_16 0x02
1005 #define LPICF_PBSIZ_MASK 0x0c
1006 #define LPICF_PBSIZ_1 0x00
1007 #define LPICF_PBSIZ_2 0x04
1008 #define LPICF_PBSIZ_4 0x08
1013 #define LPOLCF_ADDR 0xfffffa21
1014 #define LPOLCF BYTE_REF(LPOLCF_ADDR)
1016 #define LPOLCF_PIXPOL 0x01
1017 #define LPOLCF_LPPOL 0x02
1018 #define LPOLCF_FLMPOL 0x04
1019 #define LPOLCF_LCKPOL 0x08
1024 #define LACDRC_ADDR 0xfffffa23
1025 #define LACDRC BYTE_REF(LACDRC_ADDR)
1027 #define LACDRC_ACDSLT 0x80
1028 #define LACDRC_ACD_MASK 0x0f
1029 #define LACDRC_ACD_SHIFT 0
1034 #define LPXCD_ADDR 0xfffffa25
1035 #define LPXCD BYTE_REF(LPXCD_ADDR)
1037 #define LPXCD_PCD_MASK 0x3f
1038 #define LPXCD_PCD_SHIFT 0
1043 #define LCKCON_ADDR 0xfffffa27
1044 #define LCKCON BYTE_REF(LCKCON_ADDR)
1046 #define LCKCON_DWS_MASK 0x0f
1047 #define LCKCON_DWS_SHIFT 0
1048 #define LCKCON_DWIDTH 0x40
1049 #define LCKCON_LCDON 0x80
1052 #define LCKCON_DW_MASK LCKCON_DWS_MASK
1053 #define LCKCON_DW_SHIFT LCKCON_DWS_SHIFT
1058 #define LRRA_ADDR 0xfffffa29
1059 #define LRRA BYTE_REF(LRRA_ADDR)
1064 #define LPOSR_ADDR 0xfffffa2d
1065 #define LPOSR BYTE_REF(LPOSR_ADDR)
1067 #define LPOSR_POS_MASK 0x0f
1068 #define LPOSR_POS_SHIFT 0
1073 #define LFRCM_ADDR 0xfffffa31
1074 #define LFRCM BYTE_REF(LFRCM_ADDR)
1076 #define LFRCM_YMOD_MASK 0x0f
1077 #define LFRCM_YMOD_SHIFT 0
1078 #define LFRCM_XMOD_MASK 0xf0
1079 #define LFRCM_XMOD_SHIFT 4
1084 #define LGPMR_ADDR 0xfffffa33
1085 #define LGPMR BYTE_REF(LGPMR_ADDR)
1087 #define LGPMR_G1_MASK 0x0f
1088 #define LGPMR_G1_SHIFT 0
1089 #define LGPMR_G2_MASK 0xf0
1090 #define LGPMR_G2_SHIFT 4
1095 #define PWMR_ADDR 0xfffffa36
1096 #define PWMR WORD_REF(PWMR_ADDR)
1098 #define PWMR_PW_MASK 0x00ff
1099 #define PWMR_PW_SHIFT 0
1100 #define PWMR_CCPEN 0x0100
1101 #define PWMR_SRC_MASK 0x0600
1102 #define PWMR_SRC_LINE 0x0000
1103 #define PWMR_SRC_PIXEL 0x0200
1104 #define PWMR_SRC_LCD 0x4000
1115 #define RTCTIME_ADDR 0xfffffb00
1116 #define RTCTIME LONG_REF(RTCTIME_ADDR)
1118 #define RTCTIME_SECONDS_MASK 0x0000003f
1119 #define RTCTIME_SECONDS_SHIFT 0
1120 #define RTCTIME_MINUTES_MASK 0x003f0000
1121 #define RTCTIME_MINUTES_SHIFT 16
1122 #define RTCTIME_HOURS_MASK 0x1f000000
1123 #define RTCTIME_HOURS_SHIFT 24
1128 #define RTCALRM_ADDR 0xfffffb04
1129 #define RTCALRM LONG_REF(RTCALRM_ADDR)
1131 #define RTCALRM_SECONDS_MASK 0x0000003f
1132 #define RTCALRM_SECONDS_SHIFT 0
1133 #define RTCALRM_MINUTES_MASK 0x003f0000
1134 #define RTCALRM_MINUTES_SHIFT 16
1135 #define RTCALRM_HOURS_MASK 0x1f000000
1136 #define RTCALRM_HOURS_SHIFT 24
1141 #define WATCHDOG_ADDR 0xfffffb0a
1142 #define WATCHDOG WORD_REF(WATCHDOG_ADDR)
1144 #define WATCHDOG_EN 0x0001
1145 #define WATCHDOG_ISEL 0x0002
1146 #define WATCHDOG_INTF 0x0080
1147 #define WATCHDOG_CNT_MASK 0x0300
1148 #define WATCHDOG_CNT_SHIFT 8
1153 #define RTCCTL_ADDR 0xfffffb0c
1154 #define RTCCTL WORD_REF(RTCCTL_ADDR)
1156 #define RTCCTL_XTL 0x0020
1157 #define RTCCTL_EN 0x0080
1160 #define RTCCTL_384 RTCCTL_XTL
1161 #define RTCCTL_ENABLE RTCCTL_EN
1166 #define RTCISR_ADDR 0xfffffb0e
1167 #define RTCISR WORD_REF(RTCISR_ADDR)
1169 #define RTCISR_SW 0x0001
1170 #define RTCISR_MIN 0x0002
1171 #define RTCISR_ALM 0x0004
1172 #define RTCISR_DAY 0x0008
1173 #define RTCISR_1HZ 0x0010
1174 #define RTCISR_HR 0x0020
1175 #define RTCISR_SAM0 0x0100
1176 #define RTCISR_SAM1 0x0200
1177 #define RTCISR_SAM2 0x0400
1178 #define RTCISR_SAM3 0x0800
1179 #define RTCISR_SAM4 0x1000
1180 #define RTCISR_SAM5 0x2000
1181 #define RTCISR_SAM6 0x4000
1182 #define RTCISR_SAM7 0x8000
1187 #define RTCIENR_ADDR 0xfffffb10
1188 #define RTCIENR WORD_REF(RTCIENR_ADDR)
1190 #define RTCIENR_SW 0x0001
1191 #define RTCIENR_MIN 0x0002
1192 #define RTCIENR_ALM 0x0004
1193 #define RTCIENR_DAY 0x0008
1194 #define RTCIENR_1HZ 0x0010
1195 #define RTCIENR_HR 0x0020
1196 #define RTCIENR_SAM0 0x0100
1197 #define RTCIENR_SAM1 0x0200
1198 #define RTCIENR_SAM2 0x0400
1199 #define RTCIENR_SAM3 0x0800
1200 #define RTCIENR_SAM4 0x1000
1201 #define RTCIENR_SAM5 0x2000
1202 #define RTCIENR_SAM6 0x4000
1203 #define RTCIENR_SAM7 0x8000
1208 #define STPWCH_ADDR 0xfffffb12
1209 #define STPWCH WORD_REF(STPWCH_ADDR)
1211 #define STPWCH_CNT_MASK 0x003f
1212 #define SPTWCH_CNT_SHIFT 0
1217 #define DAYR_ADDR 0xfffffb1a
1218 #define DAYR WORD_REF(DAYR_ADDR)
1220 #define DAYR_DAYS_MASK 0x1ff
1221 #define DAYR_DAYS_SHIFT 0
1226 #define DAYALARM_ADDR 0xfffffb1c
1227 #define DAYALARM WORD_REF(DAYALARM_ADDR)
1229 #define DAYALARM_DAYSAL_MASK 0x01ff
1230 #define DAYALARM_DAYSAL_SHIFT 0
1241 #define DRAMMC_ADDR 0xfffffc00
1242 #define DRAMMC WORD_REF(DRAMMC_ADDR)
1244 #define DRAMMC_ROW12_MASK 0xc000
1245 #define DRAMMC_ROW12_PA10 0x0000
1246 #define DRAMMC_ROW12_PA21 0x4000
1247 #define DRAMMC_ROW12_PA23 0x8000
1248 #define DRAMMC_ROW0_MASK 0x3000
1249 #define DRAMMC_ROW0_PA11 0x0000
1250 #define DRAMMC_ROW0_PA22 0x1000
1251 #define DRAMMC_ROW0_PA23 0x2000
1252 #define DRAMMC_ROW11 0x0800
1253 #define DRAMMC_ROW10 0x0400
1254 #define DRAMMC_ROW9 0x0200
1255 #define DRAMMC_ROW8 0x0100
1256 #define DRAMMC_COL10 0x0080
1257 #define DRAMMC_COL9 0x0040
1258 #define DRAMMC_COL8 0x0020
1259 #define DRAMMC_REF_MASK 0x001f
1260 #define DRAMMC_REF_SHIFT 0
1265 #define DRAMC_ADDR 0xfffffc02
1266 #define DRAMC WORD_REF(DRAMC_ADDR)
1268 #define DRAMC_DWE 0x0001
1269 #define DRAMC_RST 0x0002
1270 #define DRAMC_LPR 0x0004
1271 #define DRAMC_SLW 0x0008
1272 #define DRAMC_LSP 0x0010
1273 #define DRAMC_MSW 0x0020
1274 #define DRAMC_WS_MASK 0x00c0
1275 #define DRAMC_WS_SHIFT 6
1276 #define DRAMC_PGSZ_MASK 0x0300
1277 #define DRAMC_PGSZ_SHIFT 8
1278 #define DRAMC_PGSZ_256K 0x0000
1279 #define DRAMC_PGSZ_512K 0x0100
1280 #define DRAMC_PGSZ_1024K 0x0200
1281 #define DRAMC_PGSZ_2048K 0x0300
1282 #define DRAMC_EDO 0x0400
1283 #define DRAMC_CLK 0x0800
1284 #define DRAMC_BC_MASK 0x3000
1285 #define DRAMC_BC_SHIFT 12
1286 #define DRAMC_RM 0x4000
1287 #define DRAMC_EN 0x8000
1299 #define ICEMACR_ADDR 0xfffffd00
1300 #define ICEMACR LONG_REF(ICEMACR_ADDR)
1305 #define ICEMAMR_ADDR 0xfffffd04
1306 #define ICEMAMR LONG_REF(ICEMAMR_ADDR)
1311 #define ICEMCCR_ADDR 0xfffffd08
1312 #define ICEMCCR WORD_REF(ICEMCCR_ADDR)
1314 #define ICEMCCR_PD 0x0001
1315 #define ICEMCCR_RW 0x0002
1320 #define ICEMCMR_ADDR 0xfffffd0a
1321 #define ICEMCMR WORD_REF(ICEMCMR_ADDR)
1323 #define ICEMCMR_PDM 0x0001
1324 #define ICEMCMR_RWM 0x0002
1329 #define ICEMCR_ADDR 0xfffffd0c
1330 #define ICEMCR WORD_REF(ICEMCR_ADDR)
1332 #define ICEMCR_CEN 0x0001
1333 #define ICEMCR_PBEN 0x0002
1334 #define ICEMCR_SB 0x0004
1335 #define ICEMCR_HMDIS 0x0008
1336 #define ICEMCR_BBIEN 0x0010
1341 #define ICEMSR_ADDR 0xfffffd0e
1342 #define ICEMSR WORD_REF(ICEMSR_ADDR)
1344 #define ICEMSR_EMUEN 0x0001
1345 #define ICEMSR_BRKIRQ 0x0002
1346 #define ICEMSR_BBIRQ 0x0004
1347 #define ICEMSR_EMIRQ 0x0008