自学MSCAN过程中对CANIDAR和CANIDMR这两个寄存器的设置理解不透
- UID
- 802935
|
自学MSCAN过程中对CANIDAR和CANIDMR这两个寄存器的设置理解不透
在头文件中中有:
/* Acceptance Code Definitions */
#define ACC_CODE_ID100 0xD8E0
#define ACC_CODE_ID100_HIGH ((ACC_CODE_ID100&0xFF00)>>8)
#define ACC_CODE_ID100_LOW (ACC_CODE_ID100&0x00FF)
/* Mask Code Definitions */
#define MASK_CODE_ST_ID 0x0007
#define MASK_CODE_ST_ID_HIGH ((MASK_CODE_ST_ID&0xFF00)>>8)
#define MASK_CODE_ST_ID_LOW (MASK_CODE_ST_ID&0xFF)
主程序中有:
CAN0IDAC_IDAM = 0x01;
/* Four 16-bit acceptance filters /
CAN0IDAR0 = ACC_CODE_ID100_HIGH; /* 16 bit Filter 0 */
CAN0IDMR0 = MASK_CODE_ST_ID_HIGH;
CAN0IDAR1 = ACC_CODE_ID100_LOW;
CAN0IDMR1 = MASK_CODE_ST_ID_LOW;
CAN0IDAR2 = 0x00; /* 16 bit Filter 1 */
CAN0IDMR2 = MASK_CODE_ST_ID_HIGH;
CAN0IDAR3 = 0x00;
CAN0IDMR3 = MASK_CODE_ST_ID_LOW;
CAN0IDAR4 = 0x00; /* 16 bit Filter 2 */
CAN0IDMR4 = MASK_CODE_ST_ID_HIGH;
CAN0IDAR5 = 0x00;
CAN0IDMR5 = MASK_CODE_ST_ID_LOW;
CAN0IDAR6 = 0x00; /* 16 bit Filter 3 */
CAN0IDMR6 = MASK_CODE_ST_ID_HIGH;
CAN0IDAR7 = 0x00;
CAN0IDMR7 = MASK_CODE_ST_ID_LOW;
看了好几天,对下面的这四行一直理解不透,想请大家帮帮我,谢谢!
CAN0IDAR0 = ACC_CODE_ID100_HIGH; /* 16 bit Filter 0 */
CAN0IDMR0 = MASK_CODE_ST_ID_HIGH;
CAN0IDAR1 = ACC_CODE_ID100_LOW;
CAN0IDMR1 = MASK_CODE_ST_ID_LOW; |
|
|
|
|
|
- UID
- 818588
|
验证码和对应的滤波器的设置,因为是16位的,所以拆分成两个8位的来分别处理。 |
|
|
|
|
|