/*-------------------------------------------------------------------------
at89x51cc01.h

Header file for Atmel Wireless & uC 89C51CC01

Copyright (c) Corvin Zahn (zahn at zac.de)
All rights reserved.
-------------------------------------------------------------------------*/

#ifndef _AT89X51CC01_H
#define _AT89X51CC01_H

#include <at89x52.h>

/* P4 */
sfr  at 0xC0 P4;
sbit at 0xC0 P4_0;
sbit at 0xC1 P4_1;


/* T2CON */
sbit at 0xC9 CT2;
sbit at 0xC8 CPRL2;


/* Watchdog */
sfr  at 0xA6 WDTRST;
sfr  at 0xA7 WDTPRG;


/* Serial Port */
sfr  at 0xB9 SADEN;
sfr  at 0xA9 SADDR;


/* PCA */
sfr  at 0xD8 CCON;

sbit at 0xD8 CCF0;
sbit at 0xD9 CCF1;
sbit at 0xDA CCF2;
sbit at 0xDB CCF3;
sbit at 0xDC CCF4;
sbit at 0xDE CR;
sbit at 0xDF CF;

sfr  at 0xD9 CMOD;
sfr  at 0xE9 CL;
sfr  at 0xF9 CH;
sfr  at 0xDA CCAPM0;
sfr  at 0xDB CCAPM1;
sfr  at 0xDC CCAPM2;
sfr  at 0xDD CCAPM3;
sfr  at 0xDE CCAPM4;
sfr  at 0xFA CCAP0H;
sfr  at 0xFB CCAP1H;
sfr  at 0xFC CCAP2H;
sfr  at 0xFD CCAP3H;
sfr  at 0xFE CCAP4H;
sfr  at 0xEA CCAP0L;
sfr  at 0xEB CCAP1L;
sfr  at 0xEC CCAP2L;
sfr  at 0xED CCAP3L;
sfr  at 0xEE CCAP4L;


/* Interrupt Priority */
sfr  at 0xB8 IPL0;
sbit at 0xBE PPC;

sfr  at 0xB7 IPH0;
#define PX0H 0x01
#define PT0H 0x02
#define PX1H 0x04
#define PT1H 0x08
#define PSH  0x10
#define PT2H 0x20
#define PPCH 0x40

sfr  at 0xF8 IPL1;
sbit at 0xF8 PCANL;
sbit at 0xF9 PADCL;
sbit at 0xFA POVRL;

sfr  at 0xF7 IPH1;
#define PCANH 0x01
#define PADCL 0x02
#define POVRL 0x04


/* ADC */
sfr  at 0xF3 ADCON;
sfr  at 0xF6 ADCF;
sfr  at 0xF2 ADCLK;
sfr  at 0xF5 ADDH;
sfr  at 0xF4 ADDL;


/* CAN */
sfr  at 0xAB CANGCON;
sfr  at 0xAA CANGSTA;
sfr  at 0x9B CANGIT;
sfr  at 0xB4 CANBT1;
sfr  at 0xB5 CANBT2;
sfr  at 0xB6 CANBT3;
sfr  at 0xCE CANEN1;
sfr  at 0xCF CANEN2;
sfr  at 0xC1 CANGIE;
sfr  at 0xC2 CANIE1;
sfr  at 0xC3 CANIE2;
sfr  at 0xBA CANSIT1;
sfr  at 0xBB CANSIT2;
sfr  at 0xA1 CANTCON;
sfr  at 0xAD CANTIMH;
sfr  at 0xAC CANTIML;
sfr  at 0xAF CANSTMH;
sfr  at 0xAE CANSTML;
sfr  at 0xA5 CANTTCH;
sfr  at 0xA4 CANTTCL;
sfr  at 0x9C CANTEC;
sfr  at 0x9D CANREC;
sfr  at 0xB1 CANPAGE;
sfr  at 0xB2 CANSTCH;
sfr  at 0xB3 CANCONCH;
sfr  at 0xA3 CANMSG;
sfr  at 0xBC CANIDT1;
sfr  at 0xBD CANIDT2;
sfr  at 0xBE CANIDT3;
sfr  at 0xBF CANIDT4;
sfr  at 0xC4 CANIDM1;
sfr  at 0xC5 CANIDM2;
sfr  at 0xC6 CANIDM3;
sfr  at 0xC7 CANIDM4;


/* Other SFRs */
sfr  at 0x8E AUXR;
sfr  at 0xA2 AUXR1;
sfr  at 0x8F CKCON;
sfr  at 0xD1 FCON;
sfr  at 0xD2 EECON;


/* IEN0 */
sfr  at 0xA8 IEN0;
sbit at 0xAE EC;

/* IEN1 */
sfr  at 0xE8 IEN1;
sbit at 0xE8 ECAN;
sbit at 0xE9 EADC;
sbit at 0xEA ETIM;

#endif  /* _AT89X51CC01_H */


