
#define APBBR_set_address(addr) 
{ APBBR_ADDR_LSB_REG = ( (addr)     & ((uint16)0x00FF) ) ; \
  APBBR_ADDR_MSB_REG = (((addr)>>8) & ((uint16)0x00FF) ) ; } 

uint32 APBBR_read_data(uint16 addr)
{
	
  uint32 *tmp;
  tmp=APBBR_RDATA_MMSB_ADDR;
  //save the EA bit in Carry bit in PSW register and disable interrupts
  CY=EA;
  EA=0;

  //set the address  
  APBBR_set_address(addr);

  //do the APB access
  APBBR_OPCODE_REG=APBBR_OP_SINGLE_READ;
  _nop_ ();
  

  EA=CY;        
  //get the resulting data  
  return *tmp;						
}
