I am trying to connect STM32 (slave) and raspberry pi (master) via I2C. I need Codesys running on raspberry pi to be able to read data from I2C using an interrupt.
Is it possible? Is there any example? I would appreciate any help.
I currently use the I2C_master.read library to read data in Codesys.
You're talking about pulling one of the GPIO pins high/low to trigger an interrupt and read something over the i2c bus? I don't believe that interrupts triggered from the GPIO are supported.
Do you perform a cyclic I2C already and it is not enough?
Or do you only want to read I2C only when there is a change (interrupt) in the slave?
If its the latter then you can use a GPIO as input to trigger a I2C read as Morberis said.
Sorry yes that could work.
I was assuming it was a hardware interrupt that was wanted though if that's not required it could definately trigger a read through a variety of methods.
My reference for hardware interrupts not being supported is this post here.
Log in to post a comment.