How to enable interrupt callback when i2c master write or read is complete?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
WiLe_295706
Level 1
Level 1

IRather than polling I2CMasterStatus(),  I would like to define an ISR callback that is called when I2CMasterWriteBuffer() or I2CMasterReadBuffer() has completed on a PSoC4200M.  This is easy to do when an SCB is configured as a UART, but the solution is not obvious to me when it is configured as an i2c master.

Any pointers?

Bill

0 Likes
1 Solution
Vison_Zhang
Moderator
Moderator
Moderator
First comment on KBA 750 replies posted 250 sign-ins

You can find and folder named "I2CMaster_SCB_IRQ" is generated in workspace explorer when add I2CM component in Top Design, this is the interrupt interface you can use, you also can add customize code in I2CMaster_SCB_IRQ.c in specified location.

API I2CM_GetTxInterruptSource() and I2CM_GetRxInterruptSource() can be used to distinguish the trigger source.

View solution in original post

0 Likes
1 Reply
Vison_Zhang
Moderator
Moderator
Moderator
First comment on KBA 750 replies posted 250 sign-ins

You can find and folder named "I2CMaster_SCB_IRQ" is generated in workspace explorer when add I2CM component in Top Design, this is the interrupt interface you can use, you also can add customize code in I2CMaster_SCB_IRQ.c in specified location.

API I2CM_GetTxInterruptSource() and I2CM_GetRxInterruptSource() can be used to distinguish the trigger source.

0 Likes