-extern struct canhardware_t *hardware_p;
-
-//---------------------------------------------------------------------------------
-//---------------------------------------------------------------------------------
-
-
-static inline void can_write_register(struct canchip_t *chip, uint32_t data, uint32_t reg_offs){
-
- uint32_t address = chip->chip_base_addr + reg_offs;
- (*(volatile uint32_t*)(address)) = data;
-
-}
-
-static inline uint32_t can_read_register(struct canchip_t *chip, uint32_t reg_offs){
-
- uint32_t address = chip->chip_base_addr + reg_offs;
- return (*(volatile uint32_t*)(address));
-
-}
-
-//---------------------------------------------------------------------------------
-//---------------------------------------------------------------------------------
-
-
-// interrupt handler
-// for transmitting - irq when one message was transmitted (for check if another message is pending in can msg queue)
-// for receiving - irq when message was received and is available in Receive buffer
-
-void CAN_IRQHandler(){
-
- uint32_t i;
-
- struct canchip_t *chip;
- chip = hardware_p->candevice[0]->chip[0];
-
- i = can_read_register(chip, CAN_ICR_o);
-
- if(i & (CAN_ICR_TI1 | CAN_ICR_RI))
- lpc17xx_irq_handler(0, chip);
-
- if(i & CAN_ICR_DOI)
- can_write_register(chip, CAN_CMR_CDO, CAN_CMR_o);
-
-
-}
-