-
Notifications
You must be signed in to change notification settings - Fork 7.6k
drivers: i2c: wch: Add support i2c target #92942
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
base: main
Are you sure you want to change the base?
Conversation
Hello @bozheng1988, and thank you very much for your first pull request to the Zephyr project! |
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.
Pull Request Overview
This PR adds I2C target (slave) mode support to the WCH I2C driver, enabling devices to act as I2C slaves in addition to the existing master functionality. The implementation includes interrupt handling for slave events and proper state management to handle both master and slave operations.
- Adds I2C target mode configuration and state management
- Implements slave event and error interrupt handling
- Provides target registration and unregistration functions
Comments suppressed due to low confidence (1)
drivers/i2c/i2c_wch.c:589
- The log message uses 'slave' terminology while the rest of the code uses 'target' terminology. Should be 'i2c: target unregistered' for consistency.
LOG_DBG("i2c: slave unregistered");
|
Add support i2c target for wch, tested on WCH-CH32V203EVT board