Skip to content

adding bao-console functions (i2cdetect and cute) #656

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

Merged
merged 15 commits into from
Jun 9, 2025
Merged

Conversation

samchin
Copy link
Contributor

@samchin samchin commented Jun 9, 2025

Summary

This adds two functions to bao-console.

cute prints cute ascii art.
i2cdetect scans the bus or a specific address and returns whether or not a chip is present. Inspired by the linux i2cdetect.

Test Plan

All of these should be tested in bao-console.

i2cdetect

Run i2cdetect scan and expect to see the following:

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- 34 -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- 47 -- -- -- -- -- -- -- --
50: -- -- -- -- -- 55 -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

also run i2cdetect probe 34 and expect to see:

Device found at address 34

As extra credit, you can plug in the BMP180 and plug and unplug it and see it work.

cute

Follow the help text and enjoy some cute ascii art.

@samchin samchin requested a review from bunnie June 9, 2025 08:45
@samchin samchin self-assigned this Jun 9, 2025
@samchin samchin force-pushed the sam.hello-world branch from 0011346 to a25f20d Compare June 9, 2025 10:17
@samchin
Copy link
Contributor Author

samchin commented Jun 9, 2025

Okay. This is now rebased to include console flags. I just built with both the battery-readout" feature and was able to still use i2cdetect

bunnie added 3 commits June 9, 2025 18:47
I think we can leave in the bao-video package without breaking the size of the swap.img file...
@bunnie
Copy link
Member

bunnie commented Jun 9, 2025

This PR actually includes the reduced swap.img file size so we don't need to make a separate one.

@bunnie bunnie merged commit 0e1cebf into main Jun 9, 2025
2 checks passed
@bunnie bunnie deleted the sam.hello-world branch June 9, 2025 10:52
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.

2 participants