Okay so I have i.imx8m mini, and the gpiod commands seem to work, however, the command:
sudo gpioget --active-low /dev/gpiochip2 6
Doesn't change the voltage on the pin.
When I run:
sudo gpioset /dev/gpiochip2 6=0
It does change the pin voltage to low, however, if I try to read the value:
sudo gpioget 2 6
It returns "1" and sets the pin voltage to high
sudo gpioinfo gpiochip2
Shows all pins as "active-high"
Is it possible to change any of the pins to "active-low"? Or are they hardwired that way in hardware? E.g. have pull up resistors to 3.3V.
Hi Ed
for gpio control may be useful below :
Best regards
igor
let's say I want to change state of GPIO3_IO0, which is described in device tree within node iomuxc
pinctrl_gpio3: gpio3grp {
fsl,pins = <
MX8MM_IOMUXC_NAND_ALE_GPIO3_IO0 0x41
// ...
>;
};
Now I'm a bit confused, does the value 0x41 set in "General Purpose Register 3 (IOMUXC_GPR_GPR3)"
or simply IOMUXC pad features (8.2.3.1 GPIO pad features / Pad Control Register)? So parameter value 0x41 (01000001) would change:
PE (Pull Resistors Enable Field)
HYS (Hysteresis Enable Field)
PUE (Control IO ports PS)
ODE (Control the IO ports ODE)
FSEL (Slew Rate Field)
DSE (Drive Strength Field)
?
A value of 0x41, which is in binary 0 1 0 00 001, means PE => Disabled, HYS => CMOS input, PUE => Enabled, ODE => Disabled, FSEL => SLOW, DSE => X1
Correct?
How do I set state of signal GPIO3_IO0 to be in active-low by default? Set "PUE" bit in PAD control register to 0? By default, all my detected gpios:
sudo gpioinfo gpiochip2
show up as "active-high"
In these NXP slides, it's only shown how to do it in userspace using a deprecated method.
How do I do change GPIO's state in userspace using libgpiod library?
you can run "gpioset -h"
remind read "Note" sections or read this