现在的项目需要启动uboot就设置GPIOF1为高电平,怎么在设备树文件设置GPIO为上拉输出呢?
离线
https://github.com/qq516333132/u-boot/blob/master/board/sunxi/board.c
int led_r;
led_r = sunxi_name_to_gpio("PB3");
if (led_r < 0) {
printf("Error invalid led_r pin: PB, err %d\n", led_r);
return led_r;
}
ret = gpio_request(led_r, "led_r");
if (ret) {
printf("Error requesting soft led_r: PB, err %d\n",ret);
return ret;
}
sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP); //上拉
gpio_direction_output(led_r, 1);
参考1: https://github.com/qq516333132/u-boot/blob/master/arch/arm/include/asm/arch-sunxi/gpio.h
参考2: https://github.com/qq516333132/u-boot/blob/master/arch/arm/mach-sunxi/pinmux.c
参考3: https://www.cnblogs.com/edan/p/9188131.html
离线
https://github.com/qq516333132/u-boot/blob/master/board/sunxi/board.c
int led_r; led_r = sunxi_name_to_gpio("PB3"); if (led_r < 0) { printf("Error invalid led_r pin: PB, err %d\n", led_r); return led_r; } ret = gpio_request(led_r, "led_r"); if (ret) { printf("Error requesting soft led_r: PB, err %d\n",ret); return ret; } sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP); //上拉 gpio_direction_output(led_r, 1);
参考1: https://github.com/qq516333132/u-boot/blob/master/arch/arm/include/asm/arch-sunxi/gpio.h
参考2: https://github.com/qq516333132/u-boot/blob/master/arch/arm/mach-sunxi/pinmux.c
参考3: https://www.cnblogs.com/edan/p/9188131.html
谢谢晕哥
离线