I am trying to explore wire.h library for Arduino to understand a deep understanding. But the issue is that it is generic for all the boards including Arduino and ESP boards and secondly finding a file where a macro is defined in Arduino files is also a very hectic work. Secondly, because the wire.h library is generic and uses underlying HAL(Hardware Abstraction Layer) library to work for a specific board either Arduino or ESP32 or anhy other board, so I need to understand the HAL libraries also which is a very hectic task.And in HAL it uses TWI(Two wire interface library) for AVR controllers which also includes in it, a dozen of header files and for ESP32,it uses ESP32-hal-i2c-(master/slave).h So I wanted to ask:1)Is there some better way to do it? Because it seems a very challenging task to completely understand the library for Arduino,ESP32 and STM32 completely which was the original task?2)Secondly, if someone please guide about the structure of library built in Arduino so that it would become easier to explore any library that I want?
My original goal was to understand the I2C,SPI and UART libraries to gain better understanding of protocol implementation by expert programmers for these three controllers.