#include <reg517a.h>

struct CANSTRUCT {
  unsigned char BL1;
  unsigned char BL2;
  unsigned char OC;
  unsigned char BRP;
  unsigned char RR1;
  unsigned char RR2;
  unsigned char RIM1;
  unsigned char RIM2;
  unsigned char TRS1;
  unsigned char TRS2;
  unsigned char IMSK;
  unsigned char dummy1[5];
  unsigned char MOD;
  unsigned char INT;
  unsigned char CTRL;
  unsigned char dummy2;
  unsigned char CC;
  unsigned char TCEC;
  unsigned char TCD;
  unsigned char dummy3;
  unsigned char TRR1;
  unsigned char TRR2;
  unsigned char RRP1;
  unsigned char RRP2;
  unsigned char TSCH;
  unsigned char TSCL;
  unsigned char dummy4[10];
  unsigned char P0PDR;
  unsigned char P0PR;
  unsigned char P0LR;
  unsigned char dummy5;
  unsigned char P1PDR;
  unsigned char P1PR;
  unsigned char P1LR;
  unsigned char dummy6;
  unsigned int  TIME_STAMP[8];
  unsigned int  DESCRIPTOR[16];
} xdata CAN _at_ 0xf700;


void main(void) {
  unsigned char value;

  CAN.P0PDR = 0xf0;       /* configure CAN P0 pins 0-3 for input and */
                          /* pins 4-7 for output                     */
  while(1) {
    
    value = CAN.P0PR;     /* read CAN P0 port                        */
    value <<= 4;          /* shift low nibble to high nibble         */
    CAN.P0LR = value;     /* output data at CAN P0 pins 4-7          */

  }

}

