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.

F28377D的gpio配置问题

Other Parts Discussed in Thread: CONTROLSUITE

在将一个GPIO口配制成输出时,正确步骤是应该先用GPySET, GPyCLEAR这些寄存器给这个GPIO口一个固定的电平,再用GPyDIR寄存器设置为output吧

  • 你可以参考controlSUITE中的例程,如:C:\ti\controlSUITE\device_support\F2837xD\v130\F2837xD_examples_Cpu1\gpio_setup

    例如GPIO8初始化:

    GpioCtrlRegs.GPAPUD.bit.GPIO8 = 0;           // Enable pullup on GPIO8
     GpioDataRegs.GPASET.bit.GPIO8 = 1;        // Load output latch
     GpioCtrlRegs.GPAMUX1.bit.GPIO8 = 0;       // GPIO8 = GPIO8
     GpioCtrlRegs.GPADIR.bit.GPIO8 = 1;          // GPIO8 = output