老师们好:我在
STM32F103ZET的官方库函数的时候,有一点不太懂 RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB|RCC_APB2Periph_GPIOC,
ENABLE);
void RCC_APB2PeriphClockCmd(uint32_t RCC_APB2Periph,
FunctionalState NewState)
{
/* Check the parameters */
assert_param(IS_RCC_APB2_PERIPH(RCC_APB2Periph));
assert_param(IS_FUNCTIONAL_STATE(NewState));
if (NewState != DISABLE)
{
RCC->APB2ENR |= RCC_APB2Periph;
}
else
{
RCC->APB2ENR &= ~RCC_APB2Periph;
}
}
edef enum
{DISABLE = 0, ENABLE = !DISABLE}
FunctionalState;
#define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
请问老师
FunctionalState NewState在函数参数中表达什么意思?是不是枚举型可做形参还是?我自已写枚举型可做形参老是不通过。真不知为什么?谢谢!
一周热门 更多>