Skip to content

Ch32v30x i2c test - #793

Open
unicab369 wants to merge 9 commits into
cnlohr:masterfrom
unicab369:Ch32v30x_i2c_test
Open

Ch32v30x i2c test#793
unicab369 wants to merge 9 commits into
cnlohr:masterfrom
unicab369:Ch32v30x_i2c_test

Conversation

@unicab369

Copy link
Copy Markdown
Contributor

No description provided.

@cnlohr

cnlohr commented Dec 1, 2025

Copy link
Copy Markdown
Owner

Please reference the moved place for the i2c_lib.h, in that one example can reference another.

This example demonstrates I2C communication with an I2C slave device.
You can use this with (one or the other):
- BH1750 light sensor (actual hardware)
- Another CH32X035 running i2c_slave_test firmware

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Is this correct? (This runs on a ch32v30x?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I only have the slave example working for Ch32x035, so technically, this code should be able to communicate with a Ch32x035 slave. I haven't test it with v30x.

- BH1750 light sensor (actual hardware)
- Another CH32X035 running i2c_slave_test firmware

if you are connecting a CH32X03X to a BH1750, the default slave address for the sensor is 0x23

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Would really like a schematic.

return raw * 12 / 10; // Convert to lux
}

void onHandle_ping(u8 i2cAddress) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

PLEASE stop using tight type specifiers. like u8 when it can just be an int.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

XD

@cnlohr

cnlohr commented Dec 3, 2025

Copy link
Copy Markdown
Owner

My comments are in. Also if you can fix the compile.

@cnlohr

cnlohr commented Dec 29, 2025

Copy link
Copy Markdown
Owner

@unicab369 one of your other PRs conflicts with this one, can you fix the merge issue?

@unicab369

Copy link
Copy Markdown
Contributor Author

@cnlohr ok, I will

@cnlohr

cnlohr commented Dec 31, 2025

Copy link
Copy Markdown
Owner

To be clear the issue is with uart_send_receive, you can do this by running git merge master in your branch.

@unicab369

Copy link
Copy Markdown
Contributor Author

oh I see.

@cnlohr

cnlohr commented Jan 6, 2026

Copy link
Copy Markdown
Owner

Mind fixing the conflict? If you can rebase off of master

@cnlohr

cnlohr commented Jan 11, 2026

Copy link
Copy Markdown
Owner

Rebase is still pending

@cnlohr

cnlohr commented Jan 20, 2026

Copy link
Copy Markdown
Owner

@unicab369 please rebase this. I'd love it.

@unicab369

Copy link
Copy Markdown
Contributor Author

@cnlohr I don't see this conflict on my local branch. I dont understand what's wrong.

@cnlohr

cnlohr commented Jan 26, 2026

Copy link
Copy Markdown
Owner

@unicab369 can you...

  1. Use github to make your fork's master branch up to date with my master branch.
  2. git fetch origin master
  3. git checkout Ch32v30x_i2c_test
  4. git rebase origin/master
  5. Handle the collision.

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