Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

CH59x UART1 printf and uartdemo example #563

Merged
merged 2 commits into from
Mar 14, 2025

Conversation

biemster
Copy link
Contributor

This example does printf on UART1 (rx,tx:PA8,PA9).

I #defined SetupUART like was done for ch32..., but I suspect that _write and putchar should be overloaded because of WEAK. I can change that easily if necessary.

Tested and working awesomely:

~/temp/CH570/ch32fun [ch59x-uartdemo L|✔] 
19:03 $ screen /dev/ttyUSB0 115200
ch32fun is awesome!
ch32fun is awesome!
ch32fun is aPA9 tx
PA9 tx
PA9 tx
PA9 tx
ch32fun is awesome!
ch32fun is awesome!
ch32fun
                                                                                                                                                                                                                  
[screen is terminating]
✔ ~/temp/CH570/ch32fun [ch59x-uartdemo L|✔] 
19:04 $ 

Also there are a bit more #defines in ch59xhw.h than necessary, but UART1 was mentioned in the interrupt from sleep stuff that I will be working on next so I included the whole sleep mode related #defines.

@cnlohr
Copy link
Owner

cnlohr commented Mar 14, 2025

Looks good.

@cnlohr cnlohr merged commit f1b8b67 into cnlohr:master Mar 14, 2025
87 checks passed
@biemster biemster deleted the ch59x-uartdemo branch March 15, 2025 12:11
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants