C:/nxpdrv/LPC1700CMSIS/Drivers/include/lpc17xx_can.h
Go to the documentation of this file.00001 /***********************************************************************/ 00021 /* Peripheral group ----------------------------------------------------------- */ 00027 #ifndef LPC17XX_CAN_H_ 00028 #define LPC17XX_CAN_H_ 00029 00030 /* Includes ------------------------------------------------------------------- */ 00031 #include "LPC17xx.h" 00032 #include "lpc_types.h" 00033 00034 #ifdef __cplusplus 00035 extern "C" 00036 { 00037 #endif 00038 00039 00040 /* Private Macros ------------------------------------------------------------- */ 00045 #define ID_11 1 00046 #define MAX_HW_FULLCAN_OBJ 64 00047 #define MAX_SW_FULLCAN_OBJ 32 00048 00049 00055 #define CAN_MOD_RM ((uint32_t)(1)) 00056 00057 #define CAN_MOD_LOM ((uint32_t)(1<<1)) 00058 00059 #define CAN_MOD_STM ((uint32_t)(1<<2)) 00060 00061 #define CAN_MOD_TPM ((uint32_t)(1<<3)) 00062 00063 #define CAN_MOD_SM ((uint32_t)(1<<4)) 00064 00065 #define CAN_MOD_RPM ((uint32_t)(1<<5)) 00066 00067 #define CAN_MOD_TM ((uint32_t)(1<<7)) 00068 /*********************************************************************/ 00072 #define CAN_CMR_TR ((uint32_t)(1)) 00073 00074 #define CAN_CMR_AT ((uint32_t)(1<<1)) 00075 00076 #define CAN_CMR_RRB ((uint32_t)(1<<2)) 00077 00078 #define CAN_CMR_CDO ((uint32_t)(1<<3)) 00079 00080 #define CAN_CMR_SRR ((uint32_t)(1<<4)) 00081 00082 #define CAN_CMR_STB1 ((uint32_t)(1<<5)) 00083 00084 #define CAN_CMR_STB2 ((uint32_t)(1<<6)) 00085 00086 #define CAN_CMR_STB3 ((uint32_t)(1<<7)) 00087 00088 /*********************************************************************/ 00092 #define CAN_GSR_RBS ((uint32_t)(1)) 00093 00094 #define CAN_GSR_DOS ((uint32_t)(1<<1)) 00095 00096 #define CAN_GSR_TBS ((uint32_t)(1<<2)) 00097 00098 #define CAN_GSR_TCS ((uint32_t)(1<<3)) 00099 00100 #define CAN_GSR_RS ((uint32_t)(1<<4)) 00101 00102 #define CAN_GSR_TS ((uint32_t)(1<<5)) 00103 00104 #define CAN_GSR_ES ((uint32_t)(1<<6)) 00105 00106 #define CAN_GSR_BS ((uint32_t)(1<<7)) 00107 00108 #define CAN_GSR_RXERR(n) ((uint32_t)((n&0xFF)<<16)) 00109 00110 #define CAN_GSR_TXERR(n) ((uint32_t)(n&0xFF)<<24)) 00111 00112 /*********************************************************************/ 00116 #define CAN_ICR_RI ((uint32_t)(1)) 00117 00118 #define CAN_ICR_TI1 ((uint32_t)(1<<1)) 00119 00120 #define CAN_ICR_EI ((uint32_t)(1<<2)) 00121 00122 #define CAN_ICR_DOI ((uint32_t)(1<<3)) 00123 00124 #define CAN_ICR_WUI ((uint32_t)(1<<4)) 00125 00126 #define CAN_ICR_EPI ((uint32_t)(1<<5)) 00127 00128 #define CAN_ICR_ALI ((uint32_t)(1<<6)) 00129 00130 #define CAN_ICR_BEI ((uint32_t)(1<<7)) 00131 00132 #define CAN_ICR_IDI ((uint32_t)(1<<8)) 00133 00134 #define CAN_ICR_TI2 ((uint32_t)(1<<9)) 00135 00136 #define CAN_ICR_TI3 ((uint32_t)(1<<10)) 00137 00138 #define CAN_ICR_ERRBIT(n) ((uint32_t)((n&0x1F)<<16)) 00139 00140 #define CAN_ICR_ERRDIR ((uint32_t)(1<<21)) 00141 00142 #define CAN_ICR_ERRC(n) ((uint32_t)((n&0x3)<<22)) 00143 00144 #define CAN_ICR_ALCBIT(n) ((uint32_t)((n&0xFF)<<24)) 00145 00146 /*********************************************************************/ 00150 #define CAN_IER_RIE ((uint32_t)(1)) 00151 00152 #define CAN_IER_TIE1 ((uint32_t)(1<<1)) 00153 00154 #define CAN_IER_EIE ((uint32_t)(1<<2)) 00155 00156 #define CAN_IER_DOIE ((uint32_t)(1<<3)) 00157 00158 #define CAN_IER_WUIE ((uint32_t)(1<<4)) 00159 00160 #define CAN_IER_EPIE ((uint32_t)(1<<5)) 00161 00162 #define CAN_IER_ALIE ((uint32_t)(1<<6)) 00163 00164 #define CAN_IER_BEIE ((uint32_t)(1<<7)) 00165 00166 #define CAN_IER_IDIE ((uint32_t)(1<<8)) 00167 00168 #define CAN_IER_TIE2 ((uint32_t)(1<<9)) 00169 00170 #define CAN_IER_TIE3 ((uint32_t)(1<<10)) 00171 00172 /*********************************************************************/ 00176 #define CAN_BTR_BRP(n) ((uint32_t)(n&0x3FF)) 00177 00178 #define CAN_BTR_SJM(n) ((uint32_t)((n&0x3)<<14)) 00179 00180 #define CAN_BTR_TESG1(n) ((uint32_t)(n&0xF)<<16)) 00181 00182 #define CAN_BTR_TESG2(n) ((uint32_t)(n&0xF)<<20)) 00183 00184 #define CAN_BTR_SAM(n) ((uint32_t)(1<<23)) 00185 00186 /*********************************************************************/ 00190 #define CAN_EWL_EWL(n) ((uint32_t)(n&0xFF)) 00191 00192 /*********************************************************************/ 00196 #define CAN_SR_RBS ((uint32_t)(1)) 00197 00198 #define CAN_SR_DOS ((uint32_t)(1<<1)) 00199 00200 #define CAN_SR_TBS1 ((uint32_t)(1<<2)) 00201 00202 #define CAN_SR_TCS1 ((uint32_t)(1<<3)) 00203 00204 #define CAN_SR_RS ((uint32_t)(1<<4)) 00205 00206 #define CAN_SR_TS1 ((uint32_t)(1<<5)) 00207 00208 #define CAN_SR_ES ((uint32_t)(1<<6)) 00209 00210 #define CAN_SR_BS ((uint32_t)(1<<7)) 00211 00212 #define CAN_SR_TBS2 ((uint32_t)(1<<10)) 00213 00214 #define CAN_SR_TCS2 ((uint32_t)(1<<11)) 00215 00216 #define CAN_SR_TS2 ((uint32_t)(1<<13)) 00217 00218 #define CAN_SR_TBS3 ((uint32_t)(1<<18)) 00219 00220 #define CAN_SR_TCS3 ((uint32_t)(1<<19)) 00221 00222 #define CAN_SR_TS3 ((uint32_t)(1<<21)) 00223 00224 /*********************************************************************/ 00228 #define CAN_RFS_ID_INDEX(n) ((uint32_t)(n&0x3FF)) 00229 00230 #define CAN_RFS_BP ((uint32_t)(1<<10)) 00231 00232 #define CAN_RFS_DLC(n) ((uint32_t)((n&0xF)<<16) 00233 00234 #define CAN_RFS_RTR ((uint32_t)(1<<30)) 00235 00236 #define CAN_RFS_FF ((uint32_t)(1<<31)) 00237 00238 /*********************************************************************/ 00242 #define CAN_RID_ID_11(n) ((uint32_t)(n&0x7FF)) 00243 00244 #define CAN_RID_ID_29(n) ((uint32_t)(n&0x1FFFFFFF)) 00245 00246 /*********************************************************************/ 00250 #define CAN_RDA_DATA1(n) ((uint32_t)(n&0xFF)) 00251 00252 #define CAN_RDA_DATA2(n) ((uint32_t)((n&0xFF)<<8)) 00253 00254 #define CAN_RDA_DATA3(n) ((uint32_t)((n&0xFF)<<16)) 00255 00256 #define CAN_RDA_DATA4(n) ((uint32_t)((n&0xFF)<<24)) 00257 00258 /*********************************************************************/ 00262 #define CAN_RDB_DATA5(n) ((uint32_t)(n&0xFF)) 00263 00264 #define CAN_RDB_DATA6(n) ((uint32_t)((n&0xFF)<<8)) 00265 00266 #define CAN_RDB_DATA7(n) ((uint32_t)((n&0xFF)<<16)) 00267 00268 #define CAN_RDB_DATA8(n) ((uint32_t)((n&0xFF)<<24)) 00269 00270 /*********************************************************************/ 00274 #define CAN_TFI_PRIO(n) ((uint32_t)(n&0xFF)) 00275 00276 #define CAN_TFI_DLC(n) ((uint32_t)((n&0xF)<<16)) 00277 00278 #define CAN_TFI_RTR ((uint32_t)(1<<30)) 00279 00280 #define CAN_TFI_FF ((uint32_t)(1<<31)) 00281 00282 /*********************************************************************/ 00286 #define CAN_TID_ID11(n) ((uint32_t)(n&0x7FF)) 00287 00288 #define CAN_TID_ID29(n) ((uint32_t)(n&0x1FFFFFFF)) 00289 00290 /*********************************************************************/ 00294 #define CAN_TDA_DATA1(n) ((uint32_t)(n&0xFF)) 00295 00296 #define CAN_TDA_DATA2(n) ((uint32_t)((n&0xFF)<<8)) 00297 00298 #define CAN_TDA_DATA3(n) ((uint32_t)((n&0xFF)<<16)) 00299 00300 #define CAN_TDA_DATA4(n) ((uint32_t)((n&0xFF)<<24)) 00301 00302 /*********************************************************************/ 00306 #define CAN_TDA_DATA5(n) ((uint32_t)(n&0xFF)) 00307 00308 #define CAN_TDA_DATA6(n) ((uint32_t)((n&0xFF)<<8)) 00309 00310 #define CAN_TDA_DATA7(n) ((uint32_t)((n&0xFF)<<16)) 00311 00312 #define CAN_TDA_DATA8(n) ((uint32_t)((n&0xFF)<<24)) 00313 00314 /*********************************************************************/ 00318 #define CAN1SLEEPCLR ((uint32_t)(1<<1)) 00319 00320 #define CAN2SLEEPCLR ((uint32_t)(1<<2)) 00321 00322 /*********************************************************************/ 00326 #define CAN_WAKEFLAGES_CAN1WAKE ((uint32_t)(1<<1)) 00327 00328 #define CAN_WAKEFLAGES_CAN2WAKE ((uint32_t)(1<<2)) 00329 00330 /*********************************************************************/ 00334 #define CAN_TSR_TS1 ((uint32_t)(1)) 00335 00336 #define CAN_TSR_TS2 ((uint32_t)(1<<1)) 00337 00338 #define CAN_TSR_TBS1 ((uint32_t)(1<<8)) 00339 00340 #define CAN_TSR_TBS2 ((uint32_t)(1<<9)) 00341 00342 #define CAN_TSR_TCS1 ((uint32_t)(1<<16)) 00343 00344 #define CAN_TSR_TCS2 ((uint32_t)(1<<17)) 00345 00346 /*********************************************************************/ 00350 #define CAN_RSR_RS1 ((uint32_t)(1)) 00351 00352 #define CAN_RSR_RS2 ((uint32_t)(1<<1)) 00353 00354 #define CAN_RSR_RB1 ((uint32_t)(1<<8)) 00355 00356 #define CAN_RSR_RB2 ((uint32_t)(1<<9)) 00357 00358 #define CAN_RSR_DOS1 ((uint32_t)(1<<16)) 00359 00360 #define CAN_RSR_DOS2 ((uint32_t)(1<<17)) 00361 00362 /*********************************************************************/ 00366 #define CAN_MSR_E1 ((uint32_t)(1)) 00367 00368 #define CAN_MSR_E2 ((uint32_t)(1<<1)) 00369 00370 #define CAN_MSR_BS1 ((uint32_t)(1<<8)) 00371 00372 #define CAN_MSR_BS2 ((uint32_t)(1<<9)) 00373 00374 /*********************************************************************/ 00378 #define CAN_AFMR_AccOff ((uint32_t)(1)) 00379 00380 #define CAN_AFMR_AccBP ((uint32_t)(1<<1)) 00381 00382 #define CAN_AFMR_eFCAN ((uint32_t)(1<<2)) 00383 00384 /*********************************************************************/ 00388 #define CAN_STT_sa(n) ((uint32_t)((n&1FF)<<2)) 00389 00390 /*********************************************************************/ 00394 #define CAN_SFF_GRP_sa(n) ((uint32_t)((n&3FF)<<2)) 00395 00396 /*********************************************************************/ 00400 #define CAN_EFF_sa(n) ((uint32_t)((n&1FF)<<2)) 00401 00402 /*********************************************************************/ 00406 #define CAN_Eff_GRP_sa(n) ((uint32_t)((n&3FF)<<2)) 00407 00408 /*********************************************************************/ 00412 #define CAN_EndofTable(n) ((uint32_t)((n&3FF)<<2)) 00413 00414 /*********************************************************************/ 00418 #define CAN_LUTerrAd(n) ((uint32_t)((n&1FF)<<2)) 00419 00420 /*********************************************************************/ 00424 #define CAN_LUTerr ((uint32_t)(1)) 00425 00426 /*********************************************************************/ 00430 #define CAN_FCANIE ((uint32_t)(1)) 00431 00432 /*********************************************************************/ 00436 #define CAN_FCANIC0_IntPnd(n) ((uint32_t)(1<<n)) 00437 00438 /*********************************************************************/ 00442 #define CAN_FCANIC1_IntPnd(n) ((uint32_t)(1<<(n-32))) 00443 00453 /* Public Types --------------------------------------------------------------- */ 00459 /*********************************************************************** 00460 * CAN device configuration commands (IOCTL commands and arguments) 00461 **********************************************************************/ 00465 typedef enum { 00466 STD_ID_FORMAT = 0, 00467 EXT_ID_FORMAT = 1 00468 } CAN_ID_FORMAT_Type; 00469 00473 typedef enum { 00474 FULLCAN_ENTRY = 0, 00475 EXPLICIT_STANDARD_ENTRY, 00476 GROUP_STANDARD_ENTRY, 00477 EXPLICIT_EXTEND_ENTRY, 00478 GROUP_EXTEND_ENTRY, 00479 } AFLUT_ENTRY_Type; 00480 00484 typedef enum { 00485 DATA_FRAME = 0, 00486 REMOTE_FRAME = 1 00487 } CAN_FRAME_Type; 00488 00492 typedef enum { 00493 CANCTRL_GLOBAL_STS = 0, 00494 CANCTRL_INT_CAP, 00495 CANCTRL_ERR_WRN, 00496 CANCTRL_STS 00497 } CAN_CTRL_STS_Type; 00498 00502 typedef enum { 00503 CANCR_TX_STS = 0, 00504 CANCR_RX_STS, 00505 CANCR_MS 00506 } CAN_CR_STS_Type; 00507 00511 typedef enum { 00512 CANINT_RIE = 0, 00513 CANINT_TIE1, 00514 CANINT_EIE, 00515 CANINT_DOIE, 00516 CANINT_WUIE, 00517 CANINT_EPIE, 00518 CANINT_ALIE, 00519 CANINT_BEIE, 00520 CANINT_IDIE, 00521 CANINT_TIE2, 00522 CANINT_TIE3, 00523 CANINT_FCE 00524 } CAN_INT_EN_Type; 00525 00529 typedef enum { 00530 CAN_Normal = 0, 00531 CAN_AccOff, 00532 CAN_AccBP, 00533 CAN_eFCAN 00534 } CAN_AFMODE_Type; 00535 00539 typedef enum { 00540 CAN_OPERATING_MODE = 0, 00541 CAN_RESET_MODE, 00542 CAN_LISTENONLY_MODE, 00543 CAN_SELFTEST_MODE, 00544 CAN_TXPRIORITY_MODE, 00545 CAN_SLEEP_MODE, 00546 CAN_RXPOLARITY_MODE, 00547 CAN_TEST_MODE 00548 } CAN_MODE_Type; 00549 00553 typedef enum { 00554 CAN_OK = 1, 00555 CAN_OBJECTS_FULL_ERROR, 00556 CAN_FULL_OBJ_NOT_RCV, 00557 CAN_NO_RECEIVE_DATA, 00558 CAN_AF_ENTRY_ERROR, 00559 CAN_CONFLICT_ID_ERROR, 00560 CAN_ENTRY_NOT_EXIT_ERROR 00561 } CAN_ERROR; 00562 00566 typedef struct { 00567 uint8_t RD; 00575 uint8_t TD; 00583 } CAN_PinCFG_Type; 00584 00588 typedef struct { 00589 uint32_t id; 00593 uint8_t dataA[4]; 00594 uint8_t dataB[4]; 00595 uint8_t len; 00599 uint8_t format; 00603 uint8_t type; 00608 } CAN_MSG_Type; 00609 00613 typedef struct { 00614 uint8_t controller; 00618 uint8_t disable; 00622 uint16_t id_11; 00623 } FullCAN_Entry; 00624 00628 typedef struct { 00629 uint8_t controller; 00633 uint8_t disable; 00637 uint16_t id_11; 00638 } SFF_Entry; 00639 00643 typedef struct { 00644 uint8_t controller1; 00648 uint8_t disable1; 00652 uint16_t lowerID; 00653 uint8_t controller2; 00657 uint8_t disable2; 00661 uint16_t upperID; 00664 } SFF_GPR_Entry; 00665 00669 typedef struct { 00670 uint8_t controller; 00674 uint32_t ID_29; 00675 } EFF_Entry; 00676 00677 00681 typedef struct { 00682 uint8_t controller1; 00686 uint8_t controller2; 00690 uint32_t lowerEID; 00691 uint32_t upperEID; 00692 } EFF_GPR_Entry; 00693 00694 00698 typedef struct { 00699 FullCAN_Entry* FullCAN_Sec; 00700 uint8_t FC_NumEntry; 00701 SFF_Entry* SFF_Sec; 00702 uint8_t SFF_NumEntry; 00703 SFF_GPR_Entry* SFF_GPR_Sec; 00704 uint8_t SFF_GPR_NumEntry; 00705 EFF_Entry* EFF_Sec; 00706 uint8_t EFF_NumEntry; 00707 EFF_GPR_Entry* EFF_GPR_Sec; 00708 uint8_t EFF_GPR_NumEntry; 00709 } AF_SectionDef; 00710 00714 typedef void ( fnCANCbs_Type)(); 00715 00716 00722 /* Public Macros -------------------------------------------------------------- */ 00728 #define PARAM_CANx(x) ((((uint32_t*)x)==((uint32_t *)LPC_CAN1)) \ 00729 ||(((uint32_t*)x)==((uint32_t *)LPC_CAN2))) 00730 00731 #define PARAM_CANAFx(x) (((uint32_t*)x)== ((uint32_t*)LPC_CANAF)) 00732 #define PARAM_CANAFRAMx(x) (((uint32_t*)x)== (uint32_t*)LPC_CANAF_RAM) 00733 #define PARAM_CANCRx(x) (((uint32_t*)x)==((uint32_t*)LPC_CANCR)) 00734 00736 #define PARAM_I2S_DATA(data) ((data>=0)&&(data <= 0xFFFFFFFF)) 00737 #define PRAM_I2S_FREQ(freq) ((freq>=16000)&&(freq <= 96000)) 00738 00740 #define PARAM_RD1_PIN(n) ((n==CAN_RD1_P0_0)||(n==CAN_RD1_P0_21)) 00741 #define PARAM_TD1_PIN(n) ((n==CAN_TD1_P0_1)||(n==CAN_TD1_P0_22)) 00742 #define PARAM_RD2_PIN(n) ((n==CAN_RD2_P0_4)||(n==CAN_RD2_P2_7)) 00743 #define PARAM_TD2_PIN(n) ((n==CAN_TD2_P0_5)||(n==CAN_TD2_P2_8)) 00744 00746 #define PARAM_ID_11(n) ((n>>11)==0) /*-- 11 bit --*/ 00747 #define PARAM_ID_29(n) ((n>>29)==0) /*-- 29 bit --*/ 00748 00749 #define PARAM_DLC(n) ((n>>4)==0) /*-- 4 bit --*/ 00750 #define PARAM_ID_FORMAT(n) ((n==STD_ID_FORMAT)||(n==EXT_ID_FORMAT)) 00751 #define PARAM_GRP_ID(x, y) ((x<=y)) 00752 #define PARAM_FRAME_TYPE(n) ((n==DATA_FRAME)||(n==REMOTE_FRAME)) 00753 00755 #define PARAM_CTRL_STS_TYPE(n) ((n==CANCTRL_GLOBAL_STS)||(n==CANCTRL_INT_CAP) \ 00756 ||(n==CANCTRL_ERR_WRN)||(n==CANCTRL_STS)) 00757 #define PARAM_CR_STS_TYPE(n) ((n==CANCR_TX_STS)||(n==CANCR_RX_STS) \ 00758 ||(n==CANCR_MS)) 00759 00760 #define PARAM_AFMODE_TYPE(n) ((n==CAN_Normal)||(n==CAN_AccOff) \ 00761 ||(n==CAN_AccBP)||(n==CAN_eFCAN)) 00762 00763 #define PARAM_MODE_TYPE(n) ((n==CAN_OPERATING_MODE)||(n==CAN_RESET_MODE) \ 00764 ||(n==CAN_LISTENONLY_MODE)||(n==CAN_SELFTEST_MODE) \ 00765 ||(n==CAN_TXPRIORITY_MODE)||(n==CAN_SLEEP_MODE) \ 00766 ||(n==CAN_RXPOLARITY_MODE)||(n==CAN_TEST_MODE)) 00767 00769 #define CAN1_CTRL ((uint8_t)(0)) 00770 #define CAN2_CTRL ((uint8_t)(1)) 00771 #define PARAM_CTRL(n) ((n==CAN1_CTRL)|(n==CAN2_CTRL)) 00772 00773 #define MSG_ENABLE ((uint8_t)(0)) 00774 #define MSG_DISABLE ((uint8_t)(1)) 00775 #define PARAM_MSG_DISABLE(n) ((n==MSG_ENABLE)|(n==MSG_DISABLE)) 00776 00778 #define PARAM_INT_EN_TYPE(n) ((n==CANINT_RIE)||(n==CANINT_TIE1) \ 00779 ||(n==CANINT_EIE)||(n==CANINT_DOIE) \ 00780 ||(n==CANINT_WUIE)||(n==CANINT_EPIE) \ 00781 ||(n==CANINT_ALIE)||(n==CANINT_BEIE) \ 00782 ||(n==CANINT_IDIE)||(n==CANINT_TIE2) \ 00783 ||(n==CANINT_TIE3)||(n==CANINT_FCE)) 00784 00786 #define PARAM_AFLUT_ENTRY_TYPE(n) ((n==FULLCAN_ENTRY)||(n==EXPLICIT_STANDARD_ENTRY)\ 00787 ||(n==GROUP_STANDARD_ENTRY)||(n==EXPLICIT_EXTEND_ENTRY) \ 00788 ||(n==GROUP_EXTEND_ENTRY)) 00789 #define PARAM_POSITION(n) ((n>=0)&&(n<512)) 00790 00792 #define CAN_RD1_P0_0 ((uint8_t)(0)) 00793 #define CAN_RD1_P0_21 ((uint8_t)(1)) 00794 #define CAN_TD1_P0_1 ((uint8_t)(0)) 00795 #define CAN_TD1_P0_22 ((uint8_t)(1)) 00796 00797 #define CAN_RD2_P0_4 ((uint8_t)(0)) 00798 #define CAN_RD2_P2_7 ((uint8_t)(1)) 00799 #define CAN_TD2_P0_5 ((uint8_t)(0)) 00800 #define CAN_TD2_P2_8 ((uint8_t)(1)) 00801 00802 00808 /* Public Functions ----------------------------------------------------------- */ 00813 void CAN_Init(LPC_CAN_TypeDef *CANx, uint32_t baudrate); 00814 void CAN_DeInit(LPC_CAN_TypeDef *CANx); 00815 00816 Status CAN_SendMsg(LPC_CAN_TypeDef *CANx, CAN_MSG_Type *CAN_Msg); 00817 Status CAN_ReceiveMsg(LPC_CAN_TypeDef *CANx, CAN_MSG_Type *CAN_Msg); 00818 CAN_ERROR FCAN_ReadObj(LPC_CANAF_TypeDef* CANAFx, CAN_MSG_Type *CAN_Msg); 00819 00820 uint32_t CAN_GetCTRLStatus(LPC_CAN_TypeDef* CANx, CAN_CTRL_STS_Type arg); 00821 uint32_t CAN_GetCRStatus(LPC_CANCR_TypeDef* CANCRx, CAN_CR_STS_Type arg); 00822 void CAN_ModeConfig(LPC_CAN_TypeDef* CANx, CAN_MODE_Type mode, 00823 FunctionalState NewState); 00824 void CAN_SetBaudRate(LPC_CAN_TypeDef *CANx, uint32_t baudrate); 00825 00826 void CAN_SetAFMode(LPC_CANAF_TypeDef* CANAFx, CAN_AFMODE_Type AFmode); 00827 CAN_ERROR CAN_SetupAFLUT(LPC_CANAF_TypeDef* CANAFx, AF_SectionDef* AFSection); 00828 CAN_ERROR CAN_LoadFullCANEntry(LPC_CAN_TypeDef* CANx, uint16_t ID); 00829 CAN_ERROR CAN_LoadExplicitEntry(LPC_CAN_TypeDef* CANx, uint32_t ID, 00830 CAN_ID_FORMAT_Type format); 00831 CAN_ERROR CAN_LoadGroupEntry(LPC_CAN_TypeDef* CANx, uint32_t lowerID, 00832 uint32_t upperID, CAN_ID_FORMAT_Type format); 00833 CAN_ERROR CAN_RemoveEntry(AFLUT_ENTRY_Type EntryType, uint16_t position); 00834 00835 void CAN_SetupCBS(CAN_INT_EN_Type arg, fnCANCbs_Type* pnCANCbs); 00836 void CAN_IRQCmd(LPC_CAN_TypeDef* CANx, CAN_INT_EN_Type arg, 00837 FunctionalState NewState); 00838 void CAN_IntHandler(LPC_CAN_TypeDef* CANx); 00839 00845 #ifdef __cplusplus 00846 } 00847 #endif 00848 00849 #endif /* LPC17XX_CAN_H_ */ 00850 00855 /* --------------------------------- End Of File ------------------------------ */
Generated on Mon Feb 8 10:01:36 2010 for LPC1700CMSIS Standard Peripheral Firmware Library by
