RDK Ultra GPIO 不支持设置上拉或下拉电阻

旭日X3支持wiringpi的模块, 但是RDK Ultra没有找到, 下面代码移植就出问题了-
wiringpi.pullUpDnControl(GDO2, wiringpi.GPIO.PUD_UP)

wiringpi.wiringPiISR(GDO2, wiringpi.GPIO.INT_EDGE_FALLING, self.callback)-

RDK Ultra使用Hobot.GPIO中没有相关的设置上拉或下拉电阻的函数?

请问上面代码在RDK Ultra中有没什么办法移植? 谢谢

你好,需要参考手册来设置引脚的初始状态,如果手册没有描述,则为不支持。-

https://developer.d-robotics.cc/rdk\_doc/Basic\_Application/03\_40pin\_user\_guide/gpio

建议尽快寻找替代方案,目前RDK Ultra的系统软件基本不会有更新了。

你好,移植WiringPi需要芯片手册,这块社区没有资源去支持。使用hobot.GPIO的话,能否再提供一下具体是在使用哪一个脚?

也参考了旭日X3派的wiringPI安装, 实际情况为不能使用,有异常

详细出错信息:

root@ubuntu:/# gpio readall

Oops: Unable to determine board revision from /proc/cpuinfo

-> Bogus board_id line (too small)

-> You’d best google the error to find out why.

GPIO.setup(GDO2, GPIO.IN, pull_up_down=GPIO.PUD_UP)

setup有带pull_up_down 参数, 但是这个参数好像没有使用

Hobot.GPIO gpio.py代码

def setup(channels, direction, pull_up_down=None, initial=None):

if not pin_mode:

raise RuntimeError(“No channel mode set”)

if direction not in DIRECTION_LIST:

raise ValueError(“Setup channel direction is invalid”)

if direction == OUT and pull_up_down:

raise RuntimeError("Pull-up and pull-down are not "

“supported in output mode”)

if type(channels) == list or type(channels) == tuple:

pin_names = copy.deepcopy(channels)

elif type(channels) == str or type(channels) == int:

pin_names =

pin_names.append(channels)

else:

raise TypeError(“The channel parameter is of the wrong type”)

for pin_name in pin_names:

if pin_info.__contains__(pin_name):

_cleanup_one(pin_name)

try:

pin_info[pin_name] = PinPro(pin_name)

except Exception as exc:

raise ValueError(“This channel was not found in this mode”)

_export_gpio(pin_name, direction)

if direction == OUT and initial:

output(pin_name, initial)

GDO0, GDO2, CS = 15, 13, 24

GPIO.setmode(GPIO.BOARD) # 物理引脚序号,与开发板的丝印序号一一对应

GPIO.setup(GDO0, GPIO.IN)

GPIO.setup(GDO2, GPIO.IN) # todo pull_up_down参数未实现

#使用的是RDK Ultra 13引脚