-
Notifications
You must be signed in to change notification settings - Fork 0
Desmakers 4800 i2c master controller implementation #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Desmakers 4800 i2c master controller implementation #19
Conversation
efb3263 to
2827b05
Compare
Signed-off-by: zhanglinjing <[email protected]>
Signed-off-by: zhanglinjing <[email protected]>
2827b05 to
e83135f
Compare
jaenrig-ifx
left a comment
There was a problem hiding this 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.
Signed-off-by: zhanglinjing <[email protected]>
Signed-off-by: zhanglinjing <[email protected]>
Signed-off-by: zhanglinjing <[email protected]>
ramya-subramanyam
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
ports/psoc-edge/machine_i2c.h
Outdated
| #define MAX_I2C 1 | ||
| #endif | ||
|
|
||
| // Declare the I2C type for external use |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
valid point. I removed
jaenrig-ifx
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 nice!
Signed-off-by: zhanglinjing <[email protected]>
Signed-off-by: zhanglinjing <[email protected]>
96f8abc
into
MICROPY-57-enable-i2c-module-for-psoc-edge
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):


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.):

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...