Skip to content
Snippets Groups Projects
Select Git revision
  • fc7c5e453920ad8ce163f618cd8d65abc78c9901
  • master default protected
  • v3.1-stable
  • v2.4-stable
  • v3.0-stable
  • esp32
  • v2.3-stable
  • v2.2-stable
  • v2.1-stable
  • v1.7-stable
  • v2.0-stable
  • v1.6-stable
  • v1.5-stable
  • coverity_scan
  • rescue-iowrt-adb15dacc26a
  • v3.1.0
  • v3.0.1
  • v3.0.0
  • v2.4.2
  • v2.4.1
  • v2.4.0
  • v2.3.0
  • v2.2.2
  • v2.2.1
  • v2.2.0
  • v2.1.1
  • v2.1.0
  • v2.0.3
  • v1.7.9
  • v2.1-pre3
  • v2.0.2
  • v2.0.1
  • v1.7.8
  • v2.0.0
34 results

libwebsockets-api-doc.html

Blame
  • README.gpio 1.10 KiB
    
    GPIO hog (CONFIG_GPIO_HOG)
    --------
    
    All the GPIO hog are initialized in gpio_hog_probe_all() function called in
    board_r.c just before board_late_init() but you can also acces directly to
    the gpio with gpio_hog_lookup_name().
    
    
    Example, for the device tree:
    
            tca6416@20 {
                    compatible = "ti,tca6416";
                    reg = <0x20>;
                    #gpio-cells = <2>;
                    gpio-controller;
    
                    env_reset {
                            gpio-hog;
                            input;
                            gpios = <6 GPIO_ACTIVE_LOW>;
                    };
                    boot_rescue {
                            gpio-hog;
                            input;
                            line-name = "foo-bar-gpio";
                            gpios = <7 GPIO_ACTIVE_LOW>;
                    };
            };
    
    You can than access the gpio in your board code with:
    
    	struct gpio_desc *desc;
    	int ret;
    
    	ret = gpio_hog_lookup_name("boot_rescue", &desc);
    	if (ret)
    		return;
    	if (dm_gpio_get_value(desc) == 1)
    		printf("\nBooting into Rescue System\n");
    	else if (dm_gpio_get_value(desc) == 0)
    		printf("\nBoot normal\n");