how to describe a peripheral with power enable pin
I'm starting with ZephyrProject and I'm playing with the development kit slstk3401a.
After implementing a very basic blinky app, I decided to use the si7021 sensor present at the board. I wrote an .overlay file with the definition of an I2C bus that is connected to the sensor but I'd like also to define the GPIO that enables/disables the sensor operation. Bellow I share the circuit connection:
And here is my overlay:
Well, I don't know how to define the SENSOR_ENABLE pin at device three. I tried everything:
With these nodes, my firmware compiles, but when I call the function device_get_binding , I get a NULL return.
I solved this by the following code:
const struct device* gpiod = device_get_binding( DT_LABEL( DT_NODELABEL( gpiod ) ) );
I don't know, but I think that it isn't the beautiful way to do this.
Does anyone have advice on how to do this?
Rafael Dias Menezes