This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
工具与软件:
尊敬的 TI:
我曾尝试读取 配置为输入的 GPIO PA25引脚、但我可以看到、当我提供3.3V 时、我将获得寄存器十进制值、而不是 高电平或低电平。
我的问题是、为什么要把引脚值设置为高电平或低电平、而不是高电平或低电平。
/** * @brief Set a group of GPIO pins * * @param[in] gpio Pointer to the register overlay for the peripheral * @param[in] pins Pins to set high. Bitwise OR of @ref DL_GPIO_PIN. */ __STATIC_INLINE void DL_GPIO_setPins(GPIO_Regs* gpio, uint32_t pins) { gpio->DOUTSET31_0 = pins; } __STATIC_INLINE uint32_t DL_GPIO_readPins(GPIO_Regs* gpio, uint32_t pins) { return (gpio->DIN31_0 & pins); }
此致
谢谢!
祝你一切顺利
您好、Karan、
因为此函数将读取 DIN31_0寄存器。 每个位代表一个 GPIO、您将 PA25设置为高电压、您将读出0x200 0000 (设置位 DIO25)、其 十进制值为 33,554,432。
此致、
Janz Bai