網路城邦
上一篇 回創作列表 下一篇   字體:
FSL imx6 uboot GPIO note
2016/03/18 11:24:46瀏覽229|回應0|推薦0
//---FSL imx6 uboot GPIO note
./board/freescale/mx6q_sabresd/mx6q_sabresd.c
int board_init(void)
./include/asm-arm/arch-mx6/mx6_pins.h
//---sample of input
    #define GPIO_VOL_DN_KEY IMX_GPIO_NR(1, 5)
    mxc_iomux_v3_setup_pad(MX6X_IOMUX(PAD_GPIO_5__GPIO_1_5));
    gpio_direction_input(GPIO_VOL_DN_KEY);
    if (gpio_get_value(GPIO_VOL_DN_KEY) == 0)
//---sample of output
    #define SABRESD_5V_PWREN        IMX_GPIO_NR(3, 18)  //Tony
    mxc_iomux_v3_setup_pad(MX6X_IOMUX(PAD_EIM_D18__GPIO_3_18));
    gpio_direction_output(SABRESD_5V_PWREN,1);
    gpio_set_value(SABRESD_5V_PWREN, 1);
( 心情隨筆心情日記 )
回應 列印 加入我的文摘
上一篇 回創作列表 下一篇

引用
引用網址:https://classic-blog.udn.com/article/trackback.jsp?uid=greatcat&aid=50487479