在T113中按了Power 键之后给 PD15高电平(电源Enable脚)
vim /brandy/boot-2018/board/sunxi/board.c
int board_init(void){
...
pr_msg("kk-boot-test:board_init \n"); // 并没有打印
sunxi_gpio_set_cfgpin(111, SUNXI_GPIO_OUTPUT); // 111设置为输出
gpio_direction_output(111, 1); // 输出高电平
...
}
./build.sh brandy
./build.sh pack
=========================
PD15 (output) - Power Enable: 3*32+15 = 111
PE13 (input) - Power Switch: 4*32+13 = 141
PD15 (output) - Power Enable: 3*32+15 = 111
#PE13 - Power Switch
echo 141 > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio141/direction
cat /sys/class/gpio/gpio141/value
#PD15 - Power Enable
echo 111 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio111/direction
echo 1 > /sys/class/gpio/gpio111/value
echo 0 > /sys/class/gpio/gpio111/value
阅读(201) | 评论(0) | 转发(0) |