Reading IO configuration

Posts: 20
Joined: Thu May 23, 2019 3:05 pm

Reading IO configuration

Postby philippe_44 » Fri Jul 31, 2020 6:19 am

Hi - It might sound a bit a silly question, but is there a way to read/probe IO configuration? The reason is that some part of my large application need to probe HW environment by configuring some IO to I2C and trying to read something. But these IO might already have been configured for another use (e.g. SPI) and in that case I don't want to try I2C as I will un-program the SPI mapping. I can't have create a set of globals that keep track of what has been configured...

Posts: 3758
Joined: Thu Nov 26, 2015 4:08 am

Re: Reading IO configuration

Postby ESP_Sprite » Fri Jul 31, 2020 7:31 am

Technically, you could read from the IO mux registers / GPIO matrix configuration registers for those particular GPIOs and see how they're configured, but there is no 'nice' way to do this with some esp-idf API.

Who is online

Users browsing this forum: JakeCrim1, nvannote and 23 guests