To be honest I'd like to have statistics for UART, I2C, SPI and RMT
As far as I understand, you want to intercept specific interrupts from the peripheral.
...
if you want to log the handlers of the idf drivers (uart, rmt...), use the callback provided by the idf and insert the loggers there.
1. Number of interrupts generated
2. Number of bytes (or symbols) transmitted
3. Number of bytes (or symbols) received
4. Number of errors (depending on a periferial: fifo overflow, hardware error)
5. Dropped RX bytes/symbols etc (data was received but was not delivered to the upper layer)
I'd like to make this statistics transparent for the user code. Of course I can patch the IDF, to add all of these counters but I'd like not to make any modification to the esp-idf.
What is the proper way to implement counters for uart/i2c/spi and rmt?
Thank you!