]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - embedded/app/usbcan/can/lpc17xx_can.h
lpc17xx embedded: new function for obtaining chip bittiming constant parameters.
[lincan.git] / embedded / app / usbcan / can / lpc17xx_can.h
index 202ed2afca153f35d6875ea1fe1623d8b7c89434..9a8b25977de117fbd489eddc6e48f2765e967bec 100644 (file)
@@ -8,17 +8,19 @@
 
 #include "can/can.h"
 #include "can/canmsg.h"
+#include "can/can_bittiming.h"
 
 #ifdef __cplusplus
 extern "C"
 {
 #endif
 
-
+// CAN1, CAN2 and CAN Acceptance filter base addresses
 #define CAN1_REGS_BASE 0x40044000UL
 #define CAN2_REGS_BASE 0x40048000UL
 #define CANAF_REGS_BASE        0x4003C000UL
 
+// offset of CAN registers
 #define CAN_MOD_o              0x0000
 #define CAN_CMR_o              0x0004
 #define CAN_GSR_o              0x0008
@@ -44,7 +46,7 @@ extern "C"
 #define CAN_TDA3_o             0x0058
 #define CAN_TDB3_o             0x005C
 
-
+// offset of CAN Acceptance filter registers
 #define CANAF_AFMR_o           0x0000
 #define CANAF_SFF_sa_o         0x0004
 #define CANAF_SFF_GRP_sa_o     0x0008
@@ -146,21 +148,19 @@ extern "C"
 
 // CAN1_RX_BIT a CAN1_TX_BIT jiz definovany v system_def.h
 
+//----------------------------------
+
+#define MAX_TRANSMIT_WAIT_LOOPS 10000
 
 void CAN_init(struct canchip_t *chip);
 void CAN_send(struct canchip_t *chip, canmsg_t* msg);
 void CAN_recv(struct canchip_t *chip, canmsg_t* msg);
-void CAN_IRQHandler(void);
-void CAN_set_bittiming(struct canchip_t *chip, uint32_t brp, uint32_t sjw, uint32_t tseg1, uint32_t tseg2);
-
-//----------------------------------
 
 struct can_lmc1_chip_data
 {
        int flags;
 };
 
-#define CAN_LMC1_CHIP_CANBTR_SET       (1<<1)
 
 // board can-lmc1 specific functions:
 int can_lmc1_register(struct hwspecops_t *hwspecops);