cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 6 MCU

Anonymous
Not applicable

Hello there,

I have recently switched over to PSoC 6 from PSoC 4 and have been working with the I2C component for a system.

In my old system, I used the high-level I2C functions MasterReadBuf and MasterWriteBuf to read and write to sensors through I2C.

In order for the system of reading and writing to be nonblocking, I used a state machine and SCB_I2C_ISR_ExitCallback to go through the data collection function multiple times until the entire reading process was complete.

How would I go about creating an equivalent process with the I2C component in PSoC 6?

0 Likes
1 Solution
GeonaP_26
Moderator
Moderator

Hello Justin,

You can make use of Cy_SCB_I2C_RegisterEventCallback() to register a callback function that notifies various events such as write and read completion occurred in the Cy_SCB_I2C_Interrupt. Please make use of PDL documentation and code example CE221119 – PSoC 6 MCU I2C Slave. It demonstrates I2C slave using callback method.

Here is the PDL documentation location in my machine : file:///C:/Program%20Files%20(x86)/Cypress/PDL/3.0.1/doc/pdl_api_reference_manual/html/group__group__scb__i2c__interrupt__functions.html

Best Regards,

Geona Mary

View solution in original post

2 Replies
GeonaP_26
Moderator
Moderator

Hello Justin,

You can make use of Cy_SCB_I2C_RegisterEventCallback() to register a callback function that notifies various events such as write and read completion occurred in the Cy_SCB_I2C_Interrupt. Please make use of PDL documentation and code example CE221119 – PSoC 6 MCU I2C Slave. It demonstrates I2C slave using callback method.

Here is the PDL documentation location in my machine : file:///C:/Program%20Files%20(x86)/Cypress/PDL/3.0.1/doc/pdl_api_reference_manual/html/group__group__scb__i2c__interrupt__functions.html

Best Regards,

Geona Mary

View solution in original post

Anonymous
Not applicable

Hey Geona,

Thank you for your response!

I was able to try out the callback method today and it worked like a charm!

Thank you for your help!

Best,

Justin

0 Likes
Top labels