Skip to content
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

i3c: add i3c shell #70773

Merged
merged 1 commit into from Apr 20, 2024
Merged

i3c: add i3c shell #70773

merged 1 commit into from Apr 20, 2024

Conversation

XenuIsWatching
Copy link
Member

@XenuIsWatching XenuIsWatching commented Mar 27, 2024

Add an I3C shell. This includes support of all I3C CCC commands that currently have helper functions implemented. This also includes all the read/write shell commands for SDR only that the i2c shell supported. An Info command is also provided which will print out all i3c and i2c info of an i3c bus.

dcpleung
dcpleung previously approved these changes Mar 27, 2024
@XenuIsWatching
Copy link
Member Author

XenuIsWatching commented Mar 27, 2024

I've added a better subcmd which will autocomplete with only the possible I3C devices, as well as only I3C targets are either attached or within it's list.

I've also added the i3c/i2c attach/reattach/detach shell commands

Unfortunately for the I2C device list, there isn't an easy way to look up a string of the only addresses with in it's list.

@XenuIsWatching XenuIsWatching force-pushed the i3c-shell branch 3 times, most recently from 9312548 to ad42690 Compare April 1, 2024 17:09
@dcpleung dcpleung linked an issue Apr 1, 2024 that may be closed by this pull request
dcpleung
dcpleung previously approved these changes Apr 1, 2024
Add an I3C shell. This includes support of all I3C CCC commands that
currently have helper functions implemented. This also includes all
the read/write shell commands that the i2c shell supported. An Info
command is also provided which will print out all i3c and i2c info
of an i3c bus. Only SDR read/writes are currently implemented.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
Copy link
Contributor

@dkalowsk dkalowsk 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, thanks for the PR!


if (argc > 4) {
num_bytes = strtol(argv[4], NULL, 16);
if (num_bytes > MAX_I3C_BYTES) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I suggest to let user know he/she was clamped.

@nashif nashif merged commit 732c2e1 into zephyrproject-rtos:main Apr 20, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create I3C Shell
6 participants