|
飞思卡尔8位单片机头文件内容问题,大神请看看吧
[复制链接]
typedef union {
byte Byte;
struct {
byte PS0 :1; /* Prescale Divisor Select Bit 0 */
byte PS1 :1; /* Prescale Divisor Select Bit 1 */
byte PS2 :1; /* Prescale Divisor Select Bit 2 */
byte CLKSA :1; /* Clock Source Select A */
byte CLKSB :1; /* Clock Source Select B */
byte CPWMS :1; /* Center-Aligned PWM Select */
byte TOIE :1; /* Timer Overflow Interrupt Enable */
byte TOF :1; /* Timer Overflow Flag */
} Bits;
struct {
byte grpPS :3;
byte grpCLKSx :2;
byte :1;
byte :1;
byte :1;
} MergedBits;
} TPM1SCSTR;
extern volatile TPM1SCSTR _TPM1SC @0x00000020;
#define TPM1SC _TPM1SC.Byte
#define TPM1SC_PS0 _TPM1SC.Bits.PS0
#define TPM1SC_PS1 _TPM1SC.Bits.PS1
#define TPM1SC_PS2 _TPM1SC.Bits.PS2
#define TPM1SC_CLKSA _TPM1SC.Bits.CLKSA
#define TPM1SC_CLKSB _TPM1SC.Bits.CLKSB
#define TPM1SC_CPWMS _TPM1SC.Bits.CPWMS
#define TPM1SC_TOIE _TPM1SC.Bits.TOIE
#define TPM1SC_TOF _TPM1SC.Bits.TOF
#define TPM1SC_PS _TPM1SC.MergedBits.grpPS
#define TPM1SC_CLKSx _TPM1SC.MergedBits.grpCLKSx
#define TPM1SC_PS0_MASK 1
#define TPM1SC_PS1_MASK 2
#define TPM1SC_PS2_MASK 4
#define TPM1SC_CLKSA_MASK 8
#define TPM1SC_CLKSB_MASK 16
#define TPM1SC_CPWMS_MASK 32
#define TPM1SC_TOIE_MASK 64
#define TPM1SC_TOF_MASK 128
#define TPM1SC_PS_MASK 7
#define TPM1SC_PS_BITNUM 0
#define TPM1SC_CLKSx_MASK 24
#define TPM1SC_CLKSx_BITNUM 3
小弟不明白的是下面,_MASK和_BITNUM是什么意思还有后面的数值。
|
|