I2C Slave ISR / how to work with default isr

KiwiFPV
Posts: 2
Joined: Mon Feb 06, 2023 12:37 pm

I2C Slave ISR / how to work with default isr

Postby KiwiFPV » Mon Feb 06, 2023 12:42 pm

Hello,
i am new to ESP32, i am working on a i2c slave implementation right now.
i want to use a isr which will be called when there are new data in the recieve buffer.
in the documentation they wrote, that per default a isr handler is installed. but how do i work with them?

I know from STM32 that you can redefine that handler for your custom isr handler. but i am not able to find a answer to that for esp32.

thank you

ESP_Sprite
Posts: 8921
Joined: Thu Nov 26, 2015 4:08 am

Re: I2C Slave ISR / how to work with default isr

Postby ESP_Sprite » Tue Feb 07, 2023 12:52 am

That's generally not how ESP-IDF drivers work. Drivers like that tend to handle the interrupt internally, and provide a blocking API to the user. For instance, i2c_slave_read_buffer will not return until the master has sent any data (or the timeout has been reached). The way to do other things while you're waiting is to spin up multiple FreeRTOS tasks, each doing their own thing.

KiwiFPV
Posts: 2
Joined: Mon Feb 06, 2023 12:37 pm

Re: I2C Slave ISR / how to work with default isr

Postby KiwiFPV » Thu Feb 09, 2023 6:01 pm

Thank you, thats strange. i need to build a i2c slave device. for that i need to know was is a read or write, to which adress, etc. etc.
On STM32 i just use isrs to do this. But how to do it on esp-idf? i was not able to find any solution on the web,

Who is online

Users browsing this forum: No registered users and 116 guests