- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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