|
@@ -380,3 +380,169 @@
|
|
|
*/
|
|
|
#define PCDIR_ADDR 0xfffff410 /* Port C direction reg */
|
|
|
#define PCDATA_ADDR 0xfffff411 /* Port C data register */
|
|
|
+#define PCPDEN_ADDR 0xfffff412 /* Port C Pull-Down enb. reg */
|
|
|
+#define PCSEL_ADDR 0xfffff413 /* Port C Select Register */
|
|
|
+
|
|
|
+#define PCDIR BYTE_REF(PCDIR_ADDR)
|
|
|
+#define PCDATA BYTE_REF(PCDATA_ADDR)
|
|
|
+#define PCPDEN BYTE_REF(PCPDEN_ADDR)
|
|
|
+#define PCSEL BYTE_REF(PCSEL_ADDR)
|
|
|
+
|
|
|
+#define PC(x) (1 << (x))
|
|
|
+
|
|
|
+#define PC_LD0 0x01 /* Use LD0 as PC[0] */
|
|
|
+#define PC_LD1 0x02 /* Use LD1 as PC[1] */
|
|
|
+#define PC_LD2 0x04 /* Use LD2 as PC[2] */
|
|
|
+#define PC_LD3 0x08 /* Use LD3 as PC[3] */
|
|
|
+#define PC_LFLM 0x10 /* Use LFLM as PC[4] */
|
|
|
+#define PC_LLP 0x20 /* Use LLP as PC[5] */
|
|
|
+#define PC_LCLK 0x40 /* Use LCLK as PC[6] */
|
|
|
+#define PC_LACD 0x80 /* Use LACD as PC[7] */
|
|
|
+
|
|
|
+/*
|
|
|
+ * Port D
|
|
|
+ */
|
|
|
+#define PDDIR_ADDR 0xfffff418 /* Port D direction reg */
|
|
|
+#define PDDATA_ADDR 0xfffff419 /* Port D data register */
|
|
|
+#define PDPUEN_ADDR 0xfffff41a /* Port D Pull-Up enable reg */
|
|
|
+#define PDSEL_ADDR 0xfffff41b /* Port D Select Register */
|
|
|
+#define PDPOL_ADDR 0xfffff41c /* Port D Polarity Register */
|
|
|
+#define PDIRQEN_ADDR 0xfffff41d /* Port D IRQ enable register */
|
|
|
+#define PDKBEN_ADDR 0xfffff41e /* Port D Keyboard Enable reg */
|
|
|
+#define PDIQEG_ADDR 0xfffff41f /* Port D IRQ Edge Register */
|
|
|
+
|
|
|
+#define PDDIR BYTE_REF(PDDIR_ADDR)
|
|
|
+#define PDDATA BYTE_REF(PDDATA_ADDR)
|
|
|
+#define PDPUEN BYTE_REF(PDPUEN_ADDR)
|
|
|
+#define PDSEL BYTE_REF(PDSEL_ADDR)
|
|
|
+#define PDPOL BYTE_REF(PDPOL_ADDR)
|
|
|
+#define PDIRQEN BYTE_REF(PDIRQEN_ADDR)
|
|
|
+#define PDKBEN BYTE_REF(PDKBEN_ADDR)
|
|
|
+#define PDIQEG BYTE_REF(PDIQEG_ADDR)
|
|
|
+
|
|
|
+#define PD(x) (1 << (x))
|
|
|
+
|
|
|
+#define PD_INT0 0x01 /* Use INT0 as PD[0] */
|
|
|
+#define PD_INT1 0x02 /* Use INT1 as PD[1] */
|
|
|
+#define PD_INT2 0x04 /* Use INT2 as PD[2] */
|
|
|
+#define PD_INT3 0x08 /* Use INT3 as PD[3] */
|
|
|
+#define PD_IRQ1 0x10 /* Use IRQ1 as PD[4] */
|
|
|
+#define PD_IRQ2 0x20 /* Use IRQ2 as PD[5] */
|
|
|
+#define PD_IRQ3 0x40 /* Use IRQ3 as PD[6] */
|
|
|
+#define PD_IRQ6 0x80 /* Use IRQ6 as PD[7] */
|
|
|
+
|
|
|
+/*
|
|
|
+ * Port E
|
|
|
+ */
|
|
|
+#define PEDIR_ADDR 0xfffff420 /* Port E direction reg */
|
|
|
+#define PEDATA_ADDR 0xfffff421 /* Port E data register */
|
|
|
+#define PEPUEN_ADDR 0xfffff422 /* Port E Pull-Up enable reg */
|
|
|
+#define PESEL_ADDR 0xfffff423 /* Port E Select Register */
|
|
|
+
|
|
|
+#define PEDIR BYTE_REF(PEDIR_ADDR)
|
|
|
+#define PEDATA BYTE_REF(PEDATA_ADDR)
|
|
|
+#define PEPUEN BYTE_REF(PEPUEN_ADDR)
|
|
|
+#define PESEL BYTE_REF(PESEL_ADDR)
|
|
|
+
|
|
|
+#define PE(x) (1 << (x))
|
|
|
+
|
|
|
+#define PE_SPMTXD 0x01 /* Use SPMTXD as PE[0] */
|
|
|
+#define PE_SPMRXD 0x02 /* Use SPMRXD as PE[1] */
|
|
|
+#define PE_SPMCLK 0x04 /* Use SPMCLK as PE[2] */
|
|
|
+#define PE_DWE 0x08 /* Use DWE as PE[3] */
|
|
|
+#define PE_RXD 0x10 /* Use RXD as PE[4] */
|
|
|
+#define PE_TXD 0x20 /* Use TXD as PE[5] */
|
|
|
+#define PE_RTS 0x40 /* Use RTS as PE[6] */
|
|
|
+#define PE_CTS 0x80 /* Use CTS as PE[7] */
|
|
|
+
|
|
|
+/*
|
|
|
+ * Port F
|
|
|
+ */
|
|
|
+#define PFDIR_ADDR 0xfffff428 /* Port F direction reg */
|
|
|
+#define PFDATA_ADDR 0xfffff429 /* Port F data register */
|
|
|
+#define PFPUEN_ADDR 0xfffff42a /* Port F Pull-Up enable reg */
|
|
|
+#define PFSEL_ADDR 0xfffff42b /* Port F Select Register */
|
|
|
+
|
|
|
+#define PFDIR BYTE_REF(PFDIR_ADDR)
|
|
|
+#define PFDATA BYTE_REF(PFDATA_ADDR)
|
|
|
+#define PFPUEN BYTE_REF(PFPUEN_ADDR)
|
|
|
+#define PFSEL BYTE_REF(PFSEL_ADDR)
|
|
|
+
|
|
|
+#define PF(x) (1 << (x))
|
|
|
+
|
|
|
+#define PF_LCONTRAST 0x01 /* Use LCONTRAST as PF[0] */
|
|
|
+#define PF_IRQ5 0x02 /* Use IRQ5 as PF[1] */
|
|
|
+#define PF_CLKO 0x04 /* Use CLKO as PF[2] */
|
|
|
+#define PF_A20 0x08 /* Use A20 as PF[3] */
|
|
|
+#define PF_A21 0x10 /* Use A21 as PF[4] */
|
|
|
+#define PF_A22 0x20 /* Use A22 as PF[5] */
|
|
|
+#define PF_A23 0x40 /* Use A23 as PF[6] */
|
|
|
+#define PF_CSA1 0x80 /* Use CSA1 as PF[7] */
|
|
|
+
|
|
|
+/*
|
|
|
+ * Port G
|
|
|
+ */
|
|
|
+#define PGDIR_ADDR 0xfffff430 /* Port G direction reg */
|
|
|
+#define PGDATA_ADDR 0xfffff431 /* Port G data register */
|
|
|
+#define PGPUEN_ADDR 0xfffff432 /* Port G Pull-Up enable reg */
|
|
|
+#define PGSEL_ADDR 0xfffff433 /* Port G Select Register */
|
|
|
+
|
|
|
+#define PGDIR BYTE_REF(PGDIR_ADDR)
|
|
|
+#define PGDATA BYTE_REF(PGDATA_ADDR)
|
|
|
+#define PGPUEN BYTE_REF(PGPUEN_ADDR)
|
|
|
+#define PGSEL BYTE_REF(PGSEL_ADDR)
|
|
|
+
|
|
|
+#define PG(x) (1 << (x))
|
|
|
+
|
|
|
+#define PG_BUSW_DTACK 0x01 /* Use BUSW/DTACK as PG[0] */
|
|
|
+#define PG_A0 0x02 /* Use A0 as PG[1] */
|
|
|
+#define PG_EMUIRQ 0x04 /* Use EMUIRQ as PG[2] */
|
|
|
+#define PG_HIZ_P_D 0x08 /* Use HIZ/P/D as PG[3] */
|
|
|
+#define PG_EMUCS 0x10 /* Use EMUCS as PG[4] */
|
|
|
+#define PG_EMUBRK 0x20 /* Use EMUBRK as PG[5] */
|
|
|
+
|
|
|
+/**********
|
|
|
+ *
|
|
|
+ * 0xFFFFF5xx -- Pulse-Width Modulator (PWM)
|
|
|
+ *
|
|
|
+ **********/
|
|
|
+
|
|
|
+/*
|
|
|
+ * PWM Control Register
|
|
|
+ */
|
|
|
+#define PWMC_ADDR 0xfffff500
|
|
|
+#define PWMC WORD_REF(PWMC_ADDR)
|
|
|
+
|
|
|
+#define PWMC_CLKSEL_MASK 0x0003 /* Clock Selection */
|
|
|
+#define PWMC_CLKSEL_SHIFT 0
|
|
|
+#define PWMC_REPEAT_MASK 0x000c /* Sample Repeats */
|
|
|
+#define PWMC_REPEAT_SHIFT 2
|
|
|
+#define PWMC_EN 0x0010 /* Enable PWM */
|
|
|
+#define PMNC_FIFOAV 0x0020 /* FIFO Available */
|
|
|
+#define PWMC_IRQEN 0x0040 /* Interrupt Request Enable */
|
|
|
+#define PWMC_IRQ 0x0080 /* Interrupt Request (FIFO empty) */
|
|
|
+#define PWMC_PRESCALER_MASK 0x7f00 /* Incoming Clock prescaler */
|
|
|
+#define PWMC_PRESCALER_SHIFT 8
|
|
|
+#define PWMC_CLKSRC 0x8000 /* Clock Source Select */
|
|
|
+
|
|
|
+/* '328-compatible definitions */
|
|
|
+#define PWMC_PWMEN PWMC_EN
|
|
|
+
|
|
|
+/*
|
|
|
+ * PWM Sample Register
|
|
|
+ */
|
|
|
+#define PWMS_ADDR 0xfffff502
|
|
|
+#define PWMS WORD_REF(PWMS_ADDR)
|
|
|
+
|
|
|
+/*
|
|
|
+ * PWM Period Register
|
|
|
+ */
|
|
|
+#define PWMP_ADDR 0xfffff504
|
|
|
+#define PWMP BYTE_REF(PWMP_ADDR)
|
|
|
+
|
|
|
+/*
|
|
|
+ * PWM Counter Register
|
|
|
+ */
|
|
|
+#define PWMCNT_ADDR 0xfffff505
|
|
|
+#define PWMCNT BYTE_REF(PWMCNT_ADDR)
|
|
|
+
|