Stm32中宏定义是什么意思呢#ifndef DEBUG#ifdef _TIM2#define TIM2 ((TIM_TypeDef *) TIM2_BASE)#endif /*_TIM2 */typedef struct{vu16 CR1;u16 RESERVED0;vu16 CR2;u16 RESERVED1;vu16 SMCR;u16 RESERVED2;vu16 DIER;u16 RESERVED3;vu16 SR;u16 RESERVED4;vu
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/18 17:17:06
Stm32中宏定义是什么意思呢#ifndef DEBUG#ifdef _TIM2#define TIM2 ((TIM_TypeDef *) TIM2_BASE)#endif /*_TIM2 */typedef struct{vu16 CR1;u16 RESERVED0;vu16 CR2;u16 RESERVED1;vu16 SMCR;u16 RESERVED2;vu16 DIER;u16 RESERVED3;vu16 SR;u16 RESERVED4;vu
Stm32中宏定义是什么意思呢
#ifndef DEBUG
#ifdef _TIM2
#define TIM2 ((TIM_TypeDef *) TIM2_BASE)
#endif /*_TIM2 */
typedef struct
{
vu16 CR1;
u16 RESERVED0;
vu16 CR2;
u16 RESERVED1;
vu16 SMCR;
u16 RESERVED2;
vu16 DIER;
u16 RESERVED3;
vu16 SR;
u16 RESERVED4;
vu16 EGR;
u16 RESERVED5;
vu16 CCMR1;
u16 RESERVED6;
vu16 CCMR2;
u16 RESERVED7;
vu16 CCER;
u16 RESERVED8;
vu16 CNT;
u16 RESERVED9;
vu16 PSC;
u16 RESERVED10;
vu16 ARR;
u16 RESERVED11;
vu16 RCR;
u16 RESERVED12;
vu16 CCR1;
u16 RESERVED13;
vu16 CCR2;
u16 RESERVED14;
vu16 CCR3;
u16 RESERVED15;
vu16 CCR4;
u16 RESERVED16;
vu16 BDTR;
u16 RESERVED17;
vu16 DCR;
u16 RESERVED18;
vu16 DMAR;
u16 RESERVED19;
} TIM_TypeDef;
Stm32中宏定义是什么意思呢#ifndef DEBUG#ifdef _TIM2#define TIM2 ((TIM_TypeDef *) TIM2_BASE)#endif /*_TIM2 */typedef struct{vu16 CR1;u16 RESERVED0;vu16 CR2;u16 RESERVED1;vu16 SMCR;u16 RESERVED2;vu16 DIER;u16 RESERVED3;vu16 SR;u16 RESERVED4;vu
TIM2_BASE 是地址
TIM_TypeDef 是结构体
((TIM_TypeDef *) TIM2_BASE) 把一个地址强制转换为结构体类型.