/* * C include file for EE 308 * Spring, 2000 */ #ifndef __HC12_H #define __HC12_H 1 /* base address of register block, change this if you relocate the register * block. */ #define _BASE 0x0000 #define PORTA (* (volatile unsigned char *)(_BASE+0x00)) #define PORTB (* (volatile unsigned char *)(_BASE+0x01)) #define DDRA (* (volatile unsigned char *)(_BASE+0x02)) #define DDRB (* (volatile unsigned char *)(_BASE+0x03)) #define PORTE (* (volatile unsigned char *)(_BASE+0x08)) #define DDRE (* (volatile unsigned char *)(_BASE+0x09)) #define PEAR (* (volatile unsigned char *)(_BASE+0x0a)) #define MODE (* (volatile unsigned char *)(_BASE+0x0b)) #define PUCR (* (volatile unsigned char *)(_BASE+0x0c)) #define RDRIV (* (volatile unsigned char *)(_BASE+0x0d)) #define INITRM (* (volatile unsigned char *)(_BASE+0x10)) #define INITRG (* (volatile unsigned char *)(_BASE+0x11)) #define INITEE (* (volatile unsigned char *)(_BASE+0x12)) #define MISC (* (volatile unsigned char *)(_BASE+0x13)) #define RTICTL (* (volatile unsigned char *)(_BASE+0x14)) #define RTIFLG (* (volatile unsigned char *)(_BASE+0x15)) #define COPCTL (* (volatile unsigned char *)(_BASE+0x16)) #define COPRST (* (volatile unsigned char *)(_BASE+0x17)) #define ITST0 (* (volatile unsigned char *)(_BASE+0x18)) #define ITST1 (* (volatile unsigned char *)(_BASE+0x19)) #define ITST2 (* (volatile unsigned char *)(_BASE+0x1a)) #define ITST3 (* (volatile unsigned char *)(_BASE+0x1b)) #define INTCR (* (volatile unsigned char *)(_BASE+0x1e)) #define HPRIO (* (volatile unsigned char *)(_BASE+0x1f)) #define BRKCT0 (* (volatile unsigned char *)(_BASE+0x20)) #define BRKCT1 (* (volatile unsigned char *)(_BASE+0x21)) #define BRKA (* (volatile unsigned int *)(_BASE+0x22)) #define BRKD (* (volatile unsigned int *)(_BASE+0x24)) #define PWCLK (* (volatile unsigned char *)(_BASE+0x40)) #define PWPOL (* (volatile unsigned char *)(_BASE+0x41)) #define PWEN (* (volatile unsigned char *)(_BASE+0x42)) #define PWPRES (* (volatile unsigned char *)(_BASE+0x43)) #define PWSCAL0 (* (volatile unsigned char *)(_BASE+0x44)) #define PWSCNT0 (* (volatile unsigned char *)(_BASE+0x45)) #define PWSCAL1 (* (volatile unsigned char *)(_BASE+0x46)) #define PWSCNT1 (* (volatile unsigned char *)(_BASE+0x47)) #define PWCNT0 (* (volatile unsigned char *)(_BASE+0x48)) #define PWCNT1 (* (volatile unsigned char *)(_BASE+0x49)) #define PWCNT2 (* (volatile unsigned char *)(_BASE+0x4a)) #define PWCNT3 (* (volatile unsigned char *)(_BASE+0x4b)) #define PWPER0 (* (volatile unsigned char *)(_BASE+0x4c)) #define PWPER1 (* (volatile unsigned char *)(_BASE+0x4d)) #define PWPER2 (* (volatile unsigned char *)(_BASE+0x4e)) #define PWPER3 (* (volatile unsigned char *)(_BASE+0x4f)) #define PWDTY0 (* (volatile unsigned char *)(_BASE+0x50)) #define PWDTY1 (* (volatile unsigned char *)(_BASE+0x51)) #define PWDTY2 (* (volatile unsigned char *)(_BASE+0x52)) #define PWDTY3 (* (volatile unsigned char *)(_BASE+0x53)) #define PWCTL (* (volatile unsigned char *)(_BASE+0x54)) #define PWTST (* (volatile unsigned char *)(_BASE+0x55)) #define PORTP (* (volatile unsigned char *)(_BASE+0x56)) #define DDRP (* (volatile unsigned char *)(_BASE+0x57)) #define ATDCTL0 (* (volatile unsigned char *)(_BASE+0x60)) #define ATDCTL1 (* (volatile unsigned char *)(_BASE+0x61)) #define ATDCTL2 (* (volatile unsigned char *)(_BASE+0x62)) #define ATDCTL3 (* (volatile unsigned char *)(_BASE+0x63)) #define ATDCTL4 (* (volatile unsigned char *)(_BASE+0x64)) #define ATDCTL5 (* (volatile unsigned char *)(_BASE+0x65)) #define ATDSTAT (* (volatile unsigned int *)(_BASE+0x66)) #define ATDTEST (* (volatile unsigned int *)(_BASE+0x68)) #define PORTAD (* (volatile unsigned char *)(_BASE+0x6f)) #define ADR0H (* (volatile unsigned char *)(_BASE+0x70)) #define ADR1H (* (volatile unsigned char *)(_BASE+0x72)) #define ADR2H (* (volatile unsigned char *)(_BASE+0x74)) #define ADR3H (* (volatile unsigned char *)(_BASE+0x76)) #define ADR4H (* (volatile unsigned char *)(_BASE+0x78)) #define ADR5H (* (volatile unsigned char *)(_BASE+0x7a)) #define ADR6H (* (volatile unsigned char *)(_BASE+0x7c)) #define ADR7H (* (volatile unsigned char *)(_BASE+0x7e)) #define TIOS (* (volatile unsigned char *)(_BASE+0x80)) #define CFORC (* (volatile unsigned char *)(_BASE+0x81)) #define OC7M (* (volatile unsigned char *)(_BASE+0x82)) #define OC7D (* (volatile unsigned char *)(_BASE+0x83)) #define TCNT (* (volatile unsigned int *)(_BASE+0x84)) #define TSCR (* (volatile unsigned char *)(_BASE+0x86)) #define TQCR (* (volatile unsigned char *)(_BASE+0x87)) #define TCTL1 (* (volatile unsigned char *)(_BASE+0x88)) #define TCTL2 (* (volatile unsigned char *)(_BASE+0x89)) #define TCTL3 (* (volatile unsigned char *)(_BASE+0x8a)) #define TCTL4 (* (volatile unsigned char *)(_BASE+0x8b)) #define TMSK1 (* (volatile unsigned char *)(_BASE+0x8c)) #define TMSK2 (* (volatile unsigned char *)(_BASE+0x8d)) #define TFLG1 (* (volatile unsigned char *)(_BASE+0x8e)) #define TFLG2 (* (volatile unsigned char *)(_BASE+0x8f)) #define TC0 (* (volatile unsigned int *)(_BASE+0x90)) #define TC1 (* (volatile unsigned int *)(_BASE+0x92)) #define TC2 (* (volatile unsigned int *)(_BASE+0x94)) #define TC3 (* (volatile unsigned int *)(_BASE+0x96)) #define TC4 (* (volatile unsigned int *)(_BASE+0x98)) #define TC5 (* (volatile unsigned int *)(_BASE+0x9a)) #define TC6 (* (volatile unsigned int *)(_BASE+0x9c)) #define TC7 (* (volatile unsigned int *)(_BASE+0x9e)) #define PACTL (* (volatile unsigned char *)(_BASE+0xa0)) #define PAFLG (* (volatile unsigned char *)(_BASE+0xa1)) #define PACNT (* (volatile unsigned int *)(_BASE+0xa2)) #define TIMTST (* (volatile unsigned char *)(_BASE+0xad)) #define PORTT (* (volatile unsigned char *)(_BASE+0xae)) #define DDRT (* (volatile unsigned char *)(_BASE+0xaf)) #define SC0BDH (* (volatile unsigned char *)(_BASE+0xc0)) #define SC0BDL (* (volatile unsigned char *)(_BASE+0xc1)) #define SC0CR1 (* (volatile unsigned char *)(_BASE+0xc2)) #define SC0CR2 (* (volatile unsigned char *)(_BASE+0xc3)) #define SC0SR1 (* (volatile unsigned char *)(_BASE+0xc4)) #define SC0SR2 (* (volatile unsigned char *)(_BASE+0xc5)) #define SC0DRH (* (volatile unsigned char *)(_BASE+0xc6)) #define SC0DRL (* (volatile unsigned char *)(_BASE+0xc7)) #define SP0CR1 (* (volatile unsigned char *)(_BASE+0xd0)) #define SP0CR2 (* (volatile unsigned char *)(_BASE+0xd1)) #define SP0BR (* (volatile unsigned char *)(_BASE+0xd2)) #define SP0SR (* (volatile unsigned char *)(_BASE+0xd3)) #define SP0DR (* (volatile unsigned char *)(_BASE+0xd5)) #define PORTS (* (volatile unsigned char *)(_BASE+0xd6)) #define DDRS (* (volatile unsigned char *)(_BASE+0xd7)) #define PURDS (* (volatile unsigned char *)(_BASE+0xdb)) #define EEMCR (* (volatile unsigned char *)(_BASE+0xf0)) #define EEPROT (* (volatile unsigned char *)(_BASE+0xf1)) #define EETST (* (volatile unsigned char *)(_BASE+0xf2)) #define EEPROG (* (volatile unsigned char *)(_BASE+0xf3)) #define FEELCK (* (volatile unsigned char *)(_BASE+0xf4)) #define FEEMCR (* (volatile unsigned char *)(_BASE+0xf5)) #define FEETST (* (volatile unsigned char *)(_BASE+0xf6)) #define FEECTL (* (volatile unsigned char *)(_BASE+0xf7)) #define BCR1 (* (volatile unsigned char *)(_BASE+0xf8)) #define BSVR (* (volatile unsigned char *)(_BASE+0xf9)) #define BCR2 (* (volatile unsigned char *)(_BASE+0xfa)) #define BDR (* (volatile unsigned char *)(_BASE+0xfb)) #define BARD (* (volatile unsigned char *)(_BASE+0xfc)) #define DLCSCR (* (volatile unsigned char *)(_BASE+0xfd)) #define PORTDLC (* (volatile unsigned char *)(_BASE+0xfe)) #define DDRDLC (* (volatile unsigned char *)(_BASE+0xff)) #define enable() _asm(" cli"); #define disable() _asm(" sei"); #endif