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