Topic

FAQ
Login Register
GPIO读取函数与注释不一致
Dec 23, 2022 09:14

/

A

/A

/** * @brief This function read the pin's input/output level. * @param[in] pin - the pin needs to read its level * @return the pin's level(1: high 0: low) */ static inline unsigned int gpio_read(GPIO_PinTypeDef pin) { return BM_IS_SET(reg_gpio_in(pin), pin & 0xff); }


以上函数,尝试读取PD7的时候,高电平返回的不是1,而是0x80,函数说明是否可以更严谨一些


TL_Soyo Dec 23, 2022 10:12
0
/A

你好,

  是这样的问题,目前返回的是对应引脚的位掩码。

2 replies
TL_Soyo Dec 23, 2022 10:12
0
/A

你好,

  是这样的问题,目前返回的是对应引脚的位掩码。