Initializing a sensor enable gpio before usage #34174
-
Hi, First of all I am not yet confortable with all device tree concepts but very interested. My problem is to use a sensor, addressed through I2C, but mapped on board to be enable using a GPIO (nRF52 based board).
My board defconfig also mentions sensors and lis2dh requirement, all is built. 2 questions:
I am sure that zephyr has a feature for this kind of problem, but I do not find solution. Thanks in advance for any help :) Robin-Charles |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Depending on the actual "enable" pin design (is it a power regulator? is it a pin present on the sensor for enabling? something else?) there are a couple of options:
|
Beta Was this translation helpful? Give feedback.
Depending on the actual "enable" pin design (is it a power regulator? is it a pin present on the sensor for enabling? something else?) there are a couple of options:
enable-gpios
property to the devicetree binding for the given sensor and modify the driver to support asserting this pin when the device needs to be enabledboard.c
file for asserting the pin at board boot time (see e.g. https://github.com/zephyrproject-rtos/zephyr/blob/master/boards/arm/arty/board.c)