/******************************************************************************
COPYRIGHT 2003 STMicroelectronics 
Source File Name : st72561_reg.c
Group            : IPSW,CMG - IPDF
Author           : MCD Application Team
Date First Issued: 23/09/2003
********************************Documentation**********************************
General Purpose - This file declares all the hardware registers for 
												metrowerks and cosmic compiler.

********************************Revision History*******************************
_______________________________________________________________________________
Date :23/09/2003    Release:2.0 
Date: 12/03/2004    1.Updated SCI 1 register names
                    2.Updated ITC regsiter names 
Date :2/06/2004     1.Address information added for metrowerks registers
                    2.remove #pragma        	   		        	      
******************************************************************************/
#include "ST7lib_config.h"
#ifdef _HIWARE_      
/*---------------------------------------------------------------------------*/ 

/* IO Ports Hardware Registers                                               */
  volatile unsigned char PADR    @0x00;	          /* PORT A data Register    */
  volatile unsigned char PADDR   @0x01;        /* Data direction register    */
  volatile unsigned char PAOR    @0x02;	               /* Option register    */  
                                                     
/* PORT B register                                                           */
 volatile unsigned char PBDR    @0x03;	          /* PORT B data Register    */
 volatile unsigned char PBDDR   @0x04;        /* Data direction register     */
 volatile unsigned char PBOR    @0x05;                /* Option Register     */

    
/* PORT C register                                                           */
 volatile unsigned char PCDR    @0x06;	          /* PORT C data Register    */
 volatile unsigned char PCDDR   @0x07;        /* Data direction register     */
 volatile unsigned char PCOR    @0x08;	               /* Option register    */


/* PORT D register                                                           */
 volatile unsigned char PDDR    @0x09;	          /* PORT D data Register    */
 volatile unsigned char PDDDR   @0x0A;        /* Data direction register     */
 volatile unsigned char PDOR    @0x0B;	               /* Option register    */  
                                                     
/* PORT E register                                                           */
 volatile unsigned char PEDR    @0x0C;	          /* PORT E data Register    */
 volatile unsigned char PEDDR   @0x0D;        /* Data direction register     */
 volatile unsigned char PEOR    @0x0E;	               /* Option register    */


/* PORT F register                                                           */
 volatile unsigned char PFDR    @0x0F;	          /* PORT F data Register    */
 volatile unsigned char PFDDR   @0x10;        /* Data direction register     */
 volatile unsigned char PFOR    @0x11;                /* Option Register     */

/*---------------------------------------------------------------------------*/    
 
/* SPI Hardware Registers                                                    */

 volatile unsigned char SPIDR   @0x21;          /* SPI Data I/O Register     */
 volatile unsigned char SPICR   @0x22;           /* SPI Control register     */
 volatile unsigned char SPICSR  @0x23;    /* SPI Control/Status register     */

/* FLASH Hardware Registers                                                  */
 volatile unsigned char FCSR    @0x24;        /* Control/Status Register     */
        
/* ITC Hardware Registers                                                    */
 volatile unsigned char FCSR    @0x24;        /* Control/Status Register     */
        
/* ITC Hardware Registers                                                    */
 volatile unsigned char ITSPR0 @0x25;   /*Interrupt SoftwarePriority Reg0    */
 volatile unsigned char ITSPR1 @0x26;   /*Interrupt SoftwarePriority Reg1    */    
 volatile unsigned char ITSPR2 @0x27;   /*Interrupt SoftwarePriority Reg2    */
 volatile unsigned char ITSPR3 @0x28;   /*Interrupt SoftwarePriority Reg3    */    
 volatile unsigned char EICR0 @0x29;    /*external Interrupt ControlReg 0    */    
 volatile unsigned char EICR1 @0x2A;    /* External InterruptControl Reg1    */        
    
/* AWU Hardware Registers                                                    */
 volatile unsigned char AWUCSR @0x2B;     /* AWU Control/Status Register     */
 volatile unsigned char AWUPR @0x2C;  /* Autowake up from halt Prescaler     */    

/* CKCTRL Hardware Registers                                                 */
 volatile unsigned char SICSR @0x2D; /* System Integrity Ctrl/Status Reg     */
 volatile unsigned char MCCSR @0x2E; /* Main Clock Cntrl/Status register     */    
    
/* WDG Hardware Registers                                                    */
 volatile unsigned char WDGCR @0x2F;                 /* Control register     */
 volatile unsigned char WWDGR @0x30;         /* window watchdog Register     */

/* PWMART hardware Registers                                                 */    
 volatile unsigned char PWMDCR3 @0x31;           /* PWM Duty Cycle Reg 3     */
 volatile unsigned char PWMDCR2 @0x32;           /* PWM Duty Cycle Reg 2     */
 volatile unsigned char PWMDCR1 @0x33;           /* PWM Duty Cycle Reg 1     */    
 volatile unsigned char PWMDCR0 @0x34;           /* PWM Duty Cycle Reg 0     */    
 volatile unsigned char PWMCR @0x35;             /* PWM Duty Control Reg     */    
 volatile unsigned char ARTCSR @0x36;          /* ART Control/Status Reg     */
 volatile unsigned char ARTCAR @0x37;          /* ART Counter Access Reg     */
 volatile unsigned char ARTARR @0x38;             /* ART Auto Reload Reg     */
 volatile unsigned char ARTICCSR @0x39;/*ART Input Capture Ctrl/Stats reg    */
 volatile unsigned char ARTICR1 @0x3A;            /* Input Capture reg 1     */
 volatile unsigned char ARTICR2 @0x3B;            /* Input Capture reg 2     */

/* 8 BIT TIMER REGISTERS                                                     */    
 volatile unsigned char T8CR2 @0x3C;               /* Control Register 2     */
 volatile unsigned char T8CR1 @0x3D;               /* Control Register 1     */
 volatile unsigned char T8CSR @0x3E;          /* Control/Status Register     */
 volatile unsigned char T8IC1R @0x3F;        /* Input capture 1 register     */
 volatile unsigned char T8OC1R @0x40;        /* Output Compare 1 Register    */
 volatile unsigned char T8CTR @0x41;            /*Timer Counter Register     */
 volatile unsigned char T8ACTR @0x42;           /* Alternate Counter Reg     */
 volatile unsigned char T8IC2R @0x43;        /*Input Capture Register 2      */
 volatile unsigned char T8OC2R @0x44;            /* Output Compare 2 Reg     */
                                                                              
/* ADC port hardware registers                                               */   
 volatile unsigned char ADCCSR @0x45;         /* Control/Status Register     */
 volatile unsigned char ADCDRH @0x46;              /* Data Register High     */    
 volatile unsigned char ADCDRL @0x47;               /* Data Register Low     */

/* SCI Hardware Registers                                                    */
 volatile unsigned char SCISR @0x48;                      /* Status Register */
 volatile unsigned char SCIDR @0x49;                        /* Data Register */
 volatile unsigned char SCIBRR @0x4A;                  /* Baud Rate Register */
 volatile unsigned char SCICR1 @0x4B;                  /* Control Register 1 */
 volatile unsigned char SCICR2 @0x4C;                  /* Control Register 2 */
 volatile unsigned char SCICR3 @0x4D;                  /* Control Register 3 */
 volatile unsigned char SCIERPR @0x4E;      /*Extended Receive Prescaler Reg */
 volatile unsigned char SCIETPR @0x4F;    /* Extended Transmit Prescaler Reg */


/* 16 Bit TIMER                                                              */
 volatile unsigned char TACR2 @0x51;                   /* Control Register 2 */
 volatile unsigned char TACR1 @0x52;                   /* Control Register 1 */
 volatile unsigned char TACSR @0x53;              /* Control/Status Register */
 volatile unsigned char TAIC1HR @0x54;               /* Input Capture 1 High */
 volatile unsigned char TAIC1LR @0x55;                /* Input Capture 1 Low */
 volatile unsigned char TAOC1HR @0x56;              /* Output Compare 1 High */
 volatile unsigned char TAOC1LR @0x57;               /* Output Compare 1 Low */
 volatile unsigned char TACHR @0x58;                         /* Counter High */
 volatile unsigned char TACLR @0x59;                          /* Counter Low */
 volatile unsigned char TAACHR @0x5A;              /* Alternate Counter High */
 volatile unsigned char TAACLR @0x5B;               /* Alternate Counter Low */
 volatile unsigned char TAIC2HR @0x5C;               /* Input Capture 2 High */
 volatile unsigned char TAIC2LR @0x5D;                /* Input Capture 2 Low */
 volatile unsigned char TAOC2HR @0x5E;              /* Output Compare 2 High */
 volatile unsigned char TAOC2LR @0x5F;               /* Output Compare 2 Low */
   
  
/* 16 bit regisgers TIMERA                                                   */
 volatile unsigned int  TAIC1R @0x54;          /* Input Capture 1 Register */
 volatile unsigned int  TAOC1R @0x56;         /* Output Compare 1 Register */
 volatile unsigned int  TACR   @0x58;                  /* Counter Register */
 volatile unsigned int  TAACR  @0x5A;        /* Alternate Counter Register */
 volatile unsigned int  TAIC2R @0x5C;          /* Input Capture 2 Register */
 volatile unsigned int  TAOC2R @0x5E;         /* Output Compare 2 Register */ 



/* SCI Hardware Registers                                                    */
 volatile unsigned char SCI2SR @0x60;                 /* Status Register     */
 volatile unsigned char SCI2DR @0x61;                   /* Data Register     */
 volatile unsigned char SCI2BRR @0x62;             /* Baud Rate Register     */
 volatile unsigned char SCI2CR1 @0x63;             /* Control Register 1     */
 volatile unsigned char SCI2CR2 @0x64;             /* Control Register 2     */
 volatile unsigned char SCI2CR3 @0x65;             /* Control Register 3     */
 volatile unsigned char SCI2ERPR @0x66; /*Extended Receive Prescaler Reg     */
 volatile unsigned char SCI2ETPR @0x67;/*Extended Transmit Prescaler Reg     */


/* CAN Hardware Registers */   
    volatile unsigned char CAN_CMCR @0x68; /* CAN Master Control Register*/
    volatile unsigned char CAN_CMSR @0x69; /* Master status Register     */
    volatile unsigned char CAN_CTSR @0x6A; /* Transmit Status Register   */
    volatile unsigned char CAN_CTPR @0x6B; /* Transmit Priority register */
    volatile unsigned char CAN_CRFR @0x6C; /* Receive FIFO Register      */
    volatile unsigned char CAN_CIER @0x6D; /* Interrupt Enable Register  */
    volatile unsigned char CAN_CDGR @0x6E; /* Diagnosis Register         */
    volatile unsigned char CAN_CPSR @0x6F; /* Page selection register    */

/*  Tx MailBox/Receive FIFO Registers */
    volatile unsigned char CAN_MCSR  	@0x70;   /* For Tx */
    volatile unsigned char CAN_MFMI  	@0x70;   /* For Receive FIFO */
    volatile unsigned char CAN_MDLC  	@0x71;
    volatile unsigned char CAN_MIDR0 	@0x72;
    volatile unsigned char CAN_MIDR1 	@0x73;
    volatile unsigned char CAN_MIDR2	@0x74;
    volatile unsigned char CAN_MIDR3 	@0x75;
    volatile unsigned char CAN_MDAR[8]  @0x76;
//    volatile unsigned int  CAN_MDAW[4]	@0x76;
     
	
    volatile unsigned char CAN_MTSLR 	@0x7e;
    volatile unsigned char CAN_MTSHR 	@0x7f;
    
    volatile unsigned int  CAN_MIDR01 	@0x72;
    volatile unsigned int  CAN_MIDR23 	@0x74;

/*  Configuaration/Diagnosis Registers */    
    
    volatile unsigned char CAN_CESR  	@0x70;
    volatile unsigned char CAN_CEIER 	@0x71;
    volatile unsigned char CAN_TECR  	@0x72;
    volatile unsigned char CAN_RECR  	@0x73;
    volatile unsigned char CAN_CBTR0 	@0x74;
    volatile unsigned char CAN_CBTR1 	@0x75;
    volatile unsigned char CAN_unknown1 	@0x76;
    volatile unsigned char CAN_unknown2 	@0x77;
    volatile unsigned char CAN_CFMR0 	@0x78;
    volatile unsigned char CAN_CFMR1 	@0x79;
    volatile unsigned char CAN_CFCR0 	@0x7a;
    volatile unsigned char CAN_CFCR1 	@0x7b;
    volatile unsigned char CAN_CFCR2 	@0x7c;
    volatile unsigned char CAN_unknown3 	@0x7d;
    volatile unsigned char CAN_unknown4 	@0x7e;
    volatile unsigned char CAN_unknown5 	@0x7f;

/*  Acceptance Filter Registers*/

    volatile unsigned char CAN_CFxR0 @0x70;
    volatile unsigned char CAN_CFxR1 @0x71;
    volatile unsigned char CAN_CFxR2 @0x72;
    volatile unsigned char CAN_CFxR3 @0x73;
    volatile unsigned char CAN_CFxR4 @0x74;
    volatile unsigned char CAN_CFxR5 @0x75;
    volatile unsigned char CAN_CFxR6 @0x76;
    volatile unsigned char CAN_CFxR7 @0x77;

    volatile unsigned char CAN_CFyR0 @0x78;
    volatile unsigned char CAN_CFyR1 @0x79;
    volatile unsigned char CAN_CFyR2 @0x7a;
    volatile unsigned char CAN_CFyR3 @0x7b;
    volatile unsigned char CAN_CFyR4 @0x7c;
    volatile unsigned char CAN_CFyR5 @0x7d;
    volatile unsigned char CAN_CFyR6 @0x7e;
    volatile unsigned char CAN_CFyR7 @0x7f;

    volatile unsigned int CAN_CFxR01 @0x70;
    volatile unsigned int CAN_CFxR23 @0x72;
    volatile unsigned int CAN_CFxR45 @0x74;
    volatile unsigned int CAN_CFxR67 @0x76;

    volatile unsigned int CAN_CFyR01 @0x78;
    volatile unsigned int CAN_CFyR23 @0x7a;
    volatile unsigned int CAN_CFyR45 @0x7c;
    volatile unsigned int CAN_CFyR67 @0x7e;

 
#endif /*_HIWARE_                                                            */
