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.

[参考译文] TM4C1294KCPDT:Tiva C 系列

Guru**** 2027820 points
Other Parts Discussed in Thread: EK-TM4C1294XL
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1302133/tm4c1294kcpdt-tiva-c-series

器件型号:TM4C1294KCPDT
主题中讨论的其他器件:EK-TM4C1294XL

您好!

   我想使用端口 D 和 E 的常规 GPIO 功能、通常会将该端口引脚分配给特殊功能。  

如何解锁该引脚并将其用作正常的输入引脚?

我需要的示例代码

此致、

尤瓦拉伊  

  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

     请参阅此常见问题解答、以解锁 GPIO 的特殊引脚。  

    https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1020815/faq-how-to-get-locked-gpio-pins-on-tm4c129-devices-to-work

    您还可以参考 C:\ti\TivaWare_C_Series-2.2.0.295\examples\boards\ek-tm4c1294xl\GPIO_JTAG 中的示例。 下面的代码片段可以将 PC[3:0]更改为 GPIO 输入。  

    //
    //将 PC0-3更改为 GPIO 输入。
    //
    HWREG (GPIO_PORTC_BASE + GPIO_O_LOCK)= GPIO_LOCK_KEY;
    HWREG (GPIO_PORTC_BASE + GPIO_O_CR)= 0x01;
    HWREG (GPIO_PORTC_BASE + GPIO_O_AFSEL)&= 0xFE;
    HWREG (GPIO_PORTC_BASE + GPIO_O_LOCK)= GPIO_LOCK_KEY;
    HWREG (GPIO_PORTC_BASE + GPIO_O_CR)= 0x02;
    HWREG (GPIO_PORTC_BASE + GPIO_O_AFSEL)&= 0xFD;
    HWREG (GPIO_PORTC_BASE + GPIO_O_LOCK)= GPIO_LOCK_KEY;
    HWREG (GPIO_PORTC_BASE + GPIO_O_CR)= 0x04;
    HWREG (GPIO_PORTC_BASE + GPIO_O_AFSEL)&= 0xfb;
    HWREG (GPIO_PORTC_BASE + GPIO_O_LOCK)= GPIO_LOCK_KEY;
    HWREG (GPIO_PORTC_BASE + GPIO_O_CR)= 0x08;
    HWREG (GPIO_PORTC_BASE + GPIO_O_AFSEL)&= 0xf7;
    HWREG (GPIO_PORTC_BASE + GPIO_O_LOCK)= GPIO_LOCK_KEY;
    HWREG (GPIO_PORTC_BASE + GPIO_O_CR)= 0x00;
    HWREG (GPIO_PORTC_BASE + GPIO_O_LOCK)= 0;
    MAP_GPIOPinTypeGPIOInput (GPIO_PORTC_BASE、(GPIO_PIN_0 | GPIO_PIN_1 |
    GPIO_PIN_2 |
    GPIO_PIN_3));

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    感谢您的参与