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.

TM4 GPIO

请问专家GPIO 的配置问题:

推挽输出是:GPIO_PIN_TYPE_STD吧

高阻态输入该如何配置?

  • 外设库里 gpio.h 有定义:   去仔细看一看吧

    //*****************************************************************************
    #define GPIO_PIN_TYPE_STD       0x00000008  // Push-pull
    #define GPIO_PIN_TYPE_STD_WPU   0x0000000A  // Push-pull with weak pull-up
    #define GPIO_PIN_TYPE_STD_WPD   0x0000000C  // Push-pull with weak pull-down
    #define GPIO_PIN_TYPE_OD        0x00000009  // Open-drain
    #define GPIO_PIN_TYPE_OD_WPU    0x0000000B  // Open-drain with weak pull-up
    #define GPIO_PIN_TYPE_OD_WPD    0x0000000D  // Open-drain with weak pull-down
    #define GPIO_PIN_TYPE_ANALOG    0x00000000  // Analog comparator

  • 貌似没有个高阻态的说法。但是所有的引脚复位时都被配置为非驱动(三态)的。它们的数字功能是禁止的。

  • GPIO_PIN_TYPE_STD就是输入高阻,不带上拉和下拉电阻。

    GPIO_PIN_TYPE_STD_WPU是输入+上拉,

    GPIO_PIN_TYPE_STD_WPD是输入+下拉。