-
/** GPIO pin is active (has logical value '1') in low state. / Above definitions are in include/dt-bindings/gpio/gpio.h, why they both have logical value '1'? it's for input or output? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Not an expert, but this is how I tell them apart. In the app code, there are two types, for the same device For an output: |
Beta Was this translation helpful? Give feedback.
-
"Logical value '1'" means that the GPIO is in active state as in comment string. From https://docs.zephyrproject.org/latest/reference/peripherals/gpio.html
Let's say that a GPIO pin is connected to a chip's reset signal. For some chips, the signal must be low to make the chip in reset state. For other chips, the signal must be high. This depends on chips you are using. But from the software point of view, we want to just say "Reset the chip" or "Activate the reset pin". So, we, as in software, just want to consider the logical state instead of the hardware dependent physical signal level. Both And this is nothing to do with GPIO input / output. |
Beta Was this translation helpful? Give feedback.
"Logical value '1'" means that the GPIO is in active state as in comment string.
From https://docs.zephyrproject.org/latest/reference/peripherals/gpio.html
Let's say that a GPIO pin is connected to a chip's reset signal. For some chips, the signal must be low to make the chip in reset state. For other chips, the signal must be high. This depends on chips you are using.
But from the software point of view, we want to just say "Reset the chip" or "Activate the reset pin". So, we, as in software, ju…