ch32-rs / ch32-hal

A Rust HAL implementation for the CH32V0, CH32V1, CH32V2, CH32V3, CH32X0, CH32L1 family, with Embassy framework support and compatible with embedded-hal.
Apache License 2.0
76 stars 21 forks source link

Is there an approach to connect ethernet (wchnet)? #11

Open christopherkutzmann opened 7 months ago

christopherkutzmann commented 7 months ago

Hello! This project is awesome and must be driven forward. I have successfully port my interrupt switch logic from EmbeetleIDE (c) to this format and rust. It is much cleaner and it consumes less current. Now i am facing the final task: to send short mqtt messages from the ch32v307 (CH32V307V-R1-1v0). I already have it working in an Embeetle project in c, but now I want to use ethernet with rust and this embassy. I've already read a lot about embassy-net(-driver/-channel etc.), but haven't found the right solution for me. I think I can also just include the wch-ethernet library and use it, but I'm really looking for the right way to do it. Does anyone have an idea or even a solution?

Board: https://github.com/openwch/ch32v307/tree/main/SCHPCB/CH32V307V-R1-1v0 Ethernet example: https://github.com/openwch/ch32v307/tree/main/EVT/EXAM/ETH/MQTT Ethernet Library: https://github.com/openwch/ch32v307/tree/main/EVT/EXAM/ETH/NetLib

Many thanks, Chris

andelf commented 7 months ago

Thanks. Ethernet is not implemented yet. And the EVT seems to have some close source code(the Net lib). I'll check this after the DMA part is implemented.

christopherkutzmann commented 5 months ago

Dear @andelf, I've just looked in again after a few weeks and see that the DMA is making progress. What is the status of the ethernet example? Please inform us! Regards, Chris

jake-g00dwin commented 4 months ago

If needed I can help on this one, I have the same ch32v307 dev board in my parts bin, but most the work I've done has been for the ch32v203 chips.