请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:CC2642R-Q1 主题中讨论的其他器件:SysConfig
工具与软件:
早上好、
我创建了一个函数来打印 GPIO 的状态。void portsettings_printInfoExtended(uint32_t pin) { // Note that the bits of pinConfig may overlap. // The order of checking is therefore extremely important!! GPIO_PinConfig pinConfig; GPIO_getConfig(pin, &pinConfig); uint32_t pinValue = GPIO_read(pin); //Pin Configuratie //GPIO_CFG_OUT_OPEN_SOURCE_INTERNAL 0x26000000 // never used? //GPIO_CFG_OUTPUT_OPEN_DRAIN_INTERNAL 0x24000000 //GPIO_CFG_INPUT_INTERNAL 0x20000002 //GPIO_CFG_OUTPUT_INTERNAL 0x20000000 //GPIO_CFG_NO_DIR_INTERNAL 0x00000002 const char *pinType; if ((pinConfig & GPIO_CFG_OUT_OPEN_SOURCE_INTERNAL) == GPIO_CFG_OUT_OPEN_SOURCE_INTERNAL) { pinType = pinValue ? "| Output | Open-source | HIGH " : "| Output | Open-source | LOW "; } else if ((pinConfig & GPIO_CFG_OUTPUT_OPEN_DRAIN_INTERNAL) == GPIO_CFG_OUTPUT_OPEN_DRAIN_INTERNAL) { pinType = pinValue ? "| Output | Open-drain | HIGH " : "| Output | Open-drain | LOW "; } else if ((pinConfig & GPIO_CFG_INPUT_INTERNAL) == GPIO_CFG_INPUT_INTERNAL) { pinType = "| Input | - | - "; } else if ((pinConfig & GPIO_CFG_OUTPUT_INTERNAL) == GPIO_CFG_OUTPUT_INTERNAL) { pinType = pinValue ? "| Output | Standard | HIGH " : "| Output | Standard | LOW "; } else if ((pinConfig & GPIO_CFG_NO_DIR_INTERNAL) == GPIO_CFG_NO_DIR_INTERNAL) { pinType = "| No-dir | - | - "; } else pinType = "| - | - | - "; //Pull-up/Pull-down configuratie //GPIO_CFG_PULL_NONE_INTERNAL 0x00006000 //GPIO_CFG_PULL_UP_INTERNAL 0x00004000 //GPIO_CFG_PULL_DOWN_INTERNAL 0x00002000 const char *pullType; // Input or open drain if (((pinConfig & GPIO_CFG_OUTPUT_OPEN_DRAIN_INTERNAL) == GPIO_CFG_OUTPUT_OPEN_DRAIN_INTERNAL) || ((pinConfig & GPIO_CFG_INPUT_INTERNAL) == GPIO_CFG_INPUT_INTERNAL)) { if ((pinConfig & GPIO_CFG_PULL_NONE_INTERNAL) == GPIO_CFG_PULL_NONE_INTERNAL) { pullType = "| Float "; // Floating } else if ((pinConfig & GPIO_CFG_PULL_UP_INTERNAL) == GPIO_CFG_PULL_UP_INTERNAL) { pullType = "| Pull-U "; // Pull-up } else if ((pinConfig & GPIO_CFG_PULL_DOWN_INTERNAL) == GPIO_CFG_PULL_DOWN_INTERNAL) { pullType = "| Pull-D "; // Pull-down } else { pullType = "| BUG!!! "; // Unknown Open drain had no pull?? } } else pullType = "| - "; // Output has no pull // Interrupt configuratie // GPIO_CFG_INT_ENABLE_INTERNAL 0x00040000 // GPIO_CFG_INT_DISABLE_INTERNAL 0x00000000 // GPIO_CFG_INT_BOTH_EDGES_INTERNAL 0x00030000 // GPIO_CFG_INT_RISING_INTERNAL 0x00020000 // GPIO_CFG_INT_FALLING_INTERNAL 0x00010000 // GPIO_CFG_INT_NONE_INTERNAL 0x00000000 const char *interruptType; if ((pinConfig & GPIO_CFG_INT_ENABLE_INTERNAL) == GPIO_CFG_INT_ENABLE_INTERNAL) { if ((pinConfig & GPIO_CFG_INT_BOTH_EDGES_INTERNAL) == GPIO_CFG_INT_BOTH_EDGES_INTERNAL) interruptType = "| Int ON | B edges "; else if ((pinConfig & GPIO_CFG_INT_RISING_INTERNAL) == GPIO_CFG_INT_RISING_INTERNAL) interruptType = "| Int ON | R edge "; else if ((pinConfig & GPIO_CFG_INT_FALLING_INTERNAL) == GPIO_CFG_INT_FALLING_INTERNAL) interruptType = "| Int ON | F edge "; else interruptType = "| Int ON | None "; } else interruptType = "| Int OFF | - "; Debug_printf("|%18s%-33s%-9s%-19s|\n", portSettings_getName(pin), pinType, pullType, interruptType); }
现在、我在 SysConfig 中发现一个错误。
如果我将 GPIO 设置为开漏、则不会设置 PULL_NONE、PULL_UP 或 PULL_DOWN。
我使用的是 SDK 版本7_40_00_77和 SysConfig_1.18.1。
有更多的人有这个问题吗?
GPIO_CFG_OUTPUT_INTERNAL | GPIO_CFG_OUT_STR_MED | GPIO_CFG_OUTPUT_OPEN_DRAING_INTERNAL | GPIO_CFG_OUT_HIGH 、 /* GPIO_MODEM_ON_OFF_RESET *
缺少
GPIO_CFG_PULL_NONE_INTERNAL
GPIO_CFG_OUTPUT_INTERNAL | GPIO_CFG_OUT_STR_MED | GPIO_CFG_OUTPUT_OPEN_DRAING_INTERNAL | GPIO_CFG_OUT_HIGH 、 /* GPIO_MODEM_ON_OFF_RESET *
缺少
GPIO_CFG_PULL_UP_INTERNAL
我可以在哪里报告此情况? 我已经通过在 board_init 中创建超规则函数来设置开漏引脚的拉动类型来解决这个问题