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

I2cshell #2348

Merged
merged 16 commits into from
Nov 8, 2024
Merged

I2cshell #2348

merged 16 commits into from
Nov 8, 2024

Conversation

htotoo
Copy link
Member

@htotoo htotoo commented Nov 7, 2024

This provides a shell over i2c.

The PPMOD driver now polls each second it the module has anything to send to pp, and i'll download all if it has.
The sensors polling is maintained by an internal "timer", each 10th second.

Fixed the ExtModule app where the module's app counter wasn't displayed correctly.

The shell is not created, until the first compatible module (that provides FEAT_SHELL) is connected.
Uses the same shell commands as the USB part.
I2C shell buffer is 64byte instead of 128.

Each time it needs to send the whole 64 byte + 1 leading byte, that indicates hasmore in the upper bit, and the length IN THAT PACKET in the remaining 7 bits. (is the packet is not full, we indicate this with the size).

The stream from PP to esp is simpler, since it needs to send the data with the stream. The stream buffer is 64 byte, and oNofityI2cFromShell will get max 64 byte data. The command will get max 64 bytes. If it get less, the ESP part will get less to. Since there is a vector, it's size wont be sent. (can get from vector size).

ESP part is coming soon. (the esp32pp project has an ugly variant online to test out, but no release with this yet)

@htotoo htotoo requested a review from bernd-herzog November 7, 2024 12:50
@gullradriel
Copy link
Member

Ar we waiting for ESP counterpart to be ready, or should we merge already ?

Copy link
Contributor

@bernd-herzog bernd-herzog left a comment

Choose a reason for hiding this comment

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

This is a nice addition for the external interface. Great work!

firmware/application/i2c_device_to_host.h Outdated Show resolved Hide resolved
firmware/common/i2cdevmanager.cpp Outdated Show resolved Hide resolved
firmware/application/usb_serial_shell.cpp Outdated Show resolved Hide resolved
@bernd-herzog
Copy link
Contributor

🚀

@htotoo htotoo merged commit 5020e5b into portapack-mayhem:next Nov 8, 2024
3 checks passed
@htotoo htotoo deleted the i2cshell branch November 8, 2024 10:46
htotoo added a commit to htotoo/portapack-mayhem that referenced this pull request Nov 11, 2024
I2C shell implementation.
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.

3 participants