在syscfg文件中GPIO界面配置了dio 12为标准输出,默认低电平,同时在代码上电初始化阶段再次配置相同的配置,结果在首次上电时发现,出现下降沿、上升沿、下降沿三种三种电平变化
实际上我们期望在配置GPIO默认电平为低后,上电过程中不应该出现上升沿这种电平变化,实际上却出现了这种变化
需要Ti确认下,使用GPIO时,首次上电时芯片默认GPIO的电平 以及 使用GPIO_setConfig API时是否导致电平多次变化的问题
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.
您好,
1.理论上首次上电时芯片默认GPIO的电平取决于您配置的电平
2.使用GPIO_setConfig API时不会导致电平发生变化,是配置引脚的功能和工作方式。
以下是关于GPIO的API描述
GPIO_init() sets up the configured GPIO pins.
• GPIO_read() gets the current state of the specified GPIO input pin.
• GPIO_write() sets the state of the specified GPIO pin to on or off.
• GPIO_toggle() toggles the state of the specified GPIO pin.
• GPIO_setCallback() dynamically binds a callback function to the specified GPIO input pin.
• GPIO_setConfig() dynamically configures the specified GPIO input pin.
• GPIO_clearInt() clears the interrupt flag for the specified GPIO pin.
• GPIO_disableInt() disables interrupts on the specified GPIO pin.
• GPIO_enableInt() enables interrupts on the specified GPIO pin
您的DIO12引脚是怎么接的?外面有其他电路吗?
GPIO_setConfig API不会改变电平输出状态,但芯片GPIO默认是高阻态,会不会是在配置生效前引脚被外部电路拉高了?
Best regards,
Shuyang
您好,
不好意思,用开发板是不能复现的,悬空引脚是为了定位问题,验证了这个结果才能进行下一步。
如果确实无法悬空或者单独断开,那可能目前没有更好的办法了。
您好,
1.芯片上电后,如果没有配置GPIO的电平属性的话,GPIO会一直保持高阻态。
2.此时GPIO的电平会与外部电平一致