Skip to content

Conversation

@LinjingZhang
Copy link

@LinjingZhang LinjingZhang commented Dec 5, 2025

Summary

Implement basic i2c master fuction.
init()
transfer()
stop()

clean up MicroPython bindings.

Testing

write (no slave connect, so error, but you can check the logic analyzer signal):
image
image

scan (Connected to the PSOC6 I2C slave, scanning is normal, but the returned address is a bit weird. However, according to the logic analyzer results, the PSOC Edge Master's behavior is correct.):
image

image image image

Trade-offs and Alternatives

Pure PDL implementation, no HAL used.
But need better structure to store some device specific macro such as PCLK_SCB5_CLOCK_SCB_EN, scb_5_interrupt_IRQn...

@LinjingZhang LinjingZhang force-pushed the DESMAKERS-4800-i2c-master-controller-implementation branch from efb3263 to 2827b05 Compare December 5, 2025 16:26
@LinjingZhang LinjingZhang force-pushed the DESMAKERS-4800-i2c-master-controller-implementation branch from 2827b05 to e83135f Compare December 5, 2025 16:32
Copy link
Member

@jaenrig-ifx jaenrig-ifx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!
Just a few things we can discuss tomorrow :)
Of course it is hard to validate if it fully works without a slave. But good showing up the signals and errors 👍
But we will come to that point.

Copy link

@ramya-subramanyam ramya-subramanyam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

#define MAX_I2C 1
#endif

// Declare the I2C type for external use
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This declaration is already in extmod/modmachine.h declared. So if you include that file in you .c, this header for the time being is not required and can be deleted.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

valid point. I removed

Copy link
Member

@jaenrig-ifx jaenrig-ifx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 nice!

@LinjingZhang LinjingZhang merged commit 96f8abc into MICROPY-57-enable-i2c-module-for-psoc-edge Dec 10, 2025
19 checks passed
@LinjingZhang LinjingZhang deleted the DESMAKERS-4800-i2c-master-controller-implementation branch December 10, 2025 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants