How to Use the imx6q GPIO function, imx6qgpio

Source: Internet
Author: User

How to Use the imx6q GPIO function, imx6qgpio

Suppose we want to use the 11th-foot EIM_D18 of the expansion port.
Find EIM_18 in arch/arm/plat-mxc/include/mach/iomux-mx6q.h first,
You can find MX6Q_PAD_EIM_D18 _ xxx. Because it is used as gpio, mx6q_pad_eim_d181_gpio_3_18 is used,
Add it to the board-mx6q_sabresd.h.
Static iomux_v3_cfg_t mx6q_sabresd_pads [] = {
....
Mx6q_pad_eim_d1820.gpio_3_18
....
}
Then add
# Define SABRESD_GPIO_CTRL IMX_GPIO_NR (3, 18)
Static struct gpio_led imx6q_gpio_leds [] =
{
GPIO_LED (SABRESD_CHARGE_NOW, "chg_now_led", 0, 1, "charger-charging "),
GPIO_LED (SABRESD_GPIO_CTRL, "gpio_xxx", 0, 1, "xxx "),
};
Re-compile the kernel, burn and write, only write 0 or 1/
Echo 0/1> sys/class/leds/gpio_xxx/brightness
This node can control the level.

If you cannot control the configuration, you can find PAD_EIM_D18 in mx6q_sabresd_pads. Check whether another feature is reinitialized by another script after mx6q_pad_eim_d181_gpio_3_18.

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.