Setting P0.30/AIN6 as GPIO enable pin

Hi. I am trying to make one sensor work on my nrf52840 based board. The problem is that eventhough the enable pin is set high in .dts file, it doesn't work. 

	bq35100@55 {
		compatible = "ti,bq35100";
		reg = <0x55>;
		enable-gpios = <&gpio0 30 GPIO_ACTIVE_HIGH>;
		label = "BQ35100";
	};

I figured out with documentation that I need to reconfigure AIN6 to serve as an GPIO. How do I do that? 

Parents Reply
  • did you try the nrf_gpio functions?

    #include <hal/nrf_gpio.h>
    #define MY_LED_GREEN_PIN 29
    
    nrf_gpio_cfg(MY_LED_GREEN_PIN, NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_DISCONNECT, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_S0S1, NRF_GPIO_PIN_NOSENSE);
    
    nrf_gpio_pin_clear(MY_LED_GREEN_PIN); // Switch off Green LED
    nrf_gpio_pin_set(MY_LED_GREEN_PIN); // Switch on Green LED

    #include <hal/nrf_gpio.h>
Children
No Data
Related