查看TI给的库函数里,外部中断控制寄存器的头文件里,定义如下所示:
struct XINTCR_BITS {
Uint16 ENABLE:1; // 0 enable/disable
Uint16 rsvd1:1; // 1 reserved
Uint16 POLARITY:1; // 2 pos/neg triggered
Uint16 rsvd2:12; // 15:3 reserved
};
union XINTCR_REG {
Uint16 all;
struct XINTCR_BITS bit;
};
struct XNMICR_BITS {
Uint16 ENABLE:1; // 0 enable/disable
Uint16 SELECT:1; // 1 Timer 1 or XNMI connected to INT13
Uint16 POLARITY:1; // 2 pos/neg triggered
Uint16 rsvd2:12; // 15:3 reserved
};
Uint16 POLARITY:1; // 2 pos/neg triggered代表触发方式,但是仅仅一位表示,但是所有寄存器位数加起来才15位,少了1位,还有1位到哪里去了;是不是应该POLARITY:2占用两位,支持双边沿触发?
Johnson Chen1:
楼主你好!
头文件中应该是笔误,应该是 Uint16 rsvd2:13; // 15:3 reserved
F2812应该是只支持上升沿或者下降沿,不支持双边缘触发!
查看TI给的库函数里,外部中断控制寄存器的头文件里,定义如下所示:
struct XINTCR_BITS {
Uint16 ENABLE:1; // 0 enable/disable
Uint16 rsvd1:1; // 1 reserved
Uint16 POLARITY:1; // 2 pos/neg triggered
Uint16 rsvd2:12; // 15:3 reserved
};
union XINTCR_REG {
Uint16 all;
struct XINTCR_BITS bit;
};
struct XNMICR_BITS {
Uint16 ENABLE:1; // 0 enable/disable
Uint16 SELECT:1; // 1 Timer 1 or XNMI connected to INT13
Uint16 POLARITY:1; // 2 pos/neg triggered
Uint16 rsvd2:12; // 15:3 reserved
};
Uint16 POLARITY:1; // 2 pos/neg triggered代表触发方式,但是仅仅一位表示,但是所有寄存器位数加起来才15位,少了1位,还有1位到哪里去了;是不是应该POLARITY:2占用两位,支持双边沿触发?
Young Hu:
可以使用事件管理器的Capture来捕获双边沿