Hi,
is there any case when GPIO_FUNCm_IN_INV_SEL, GPIO_FUNCn_OEN_INV_SEL and GPIO_FUNCn_OUT_INV_SEL can be useful?
See TRM V3.8 pages 68 and 69.
GPIO invert settings
Re: GPIO invert settings
Input inverting is used, for example, in SDMMC driver for CD or WP pin, and in camera applications to match polarity of HSYNC/VSYNC signals to the ones expected by ESP32. I've seen one case where output inverting was used to flip the signal produced by LEDC, achieving some sort of phase modulation. Haven't seen uses of OE inverting yet.
-
- Posts: 9764
- Joined: Thu Nov 26, 2015 4:08 am
Re: GPIO invert settings
Output inversion is also used in some parallel I2S output things, if you want to change the polarity of e.g. the WS signal. I think I used OE inverting at some point as a shorthand to make a pin high-impedance with just one write, but I agree that I also struggle to come up with a specific use case for that.
Re: GPIO invert settings
mmmm, it pays to browse: I must look into this. I am toggling gpio for steppers within an ISR, and motor controllers vary in signal polarity for en, step and direction. So I am using this all over the code:
[edit]
Yep, this works (for anyone interested):
Code: Select all
#define GPIO_ON(gpioreg, inverse) \
if (inverse) \
GPIO.out_w1tc = gpioreg; \
else \
GPIO.out_w1ts = gpioreg;
Yep, this works (for anyone interested):
Code: Select all
WRITE_PERI_REG(GPIO_FUNCnn_OUT_SEL_CFG_REG, READ_PERI_REG(GPIO_FUNCnn_OUT_SEL_CFG_REG) | GPIO_FUNCnn_OUT_INV_SEL);
// nn=gpio number
Who is online
Users browsing this forum: Bing [Bot] and 62 guests