Skip to content

Commit c234dad

Browse files
authored
Merge pull request #602 from biemster/ch5xx-sfrs
CH5xx SFR completion
2 parents 228e9b9 + 866d7ab commit c234dad

File tree

8 files changed

+2884
-29
lines changed

8 files changed

+2884
-29
lines changed

ch32fun/ch57xhw.h

Lines changed: 1132 additions & 11 deletions
Large diffs are not rendered by default.

ch32fun/ch58xhw.h

Lines changed: 985 additions & 3 deletions
Large diffs are not rendered by default.

ch32fun/ch59xhw.h

Lines changed: 757 additions & 7 deletions
Large diffs are not rendered by default.

examples_ch5xx/RTC_irq/RTC_irq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ int main(void)
2626
RTCInit(); // initialize RTC count to 0
2727
NVIC_EnableIRQ(RTC_IRQn); // enable RTC IRQ to hit the RTC_IRQHandler
2828

29-
funGpioInitAll(); // Enable GPIOs
29+
funGpioInitAll(); // no-op on ch5xx
3030

3131
funPinMode(LED, GPIO_CFGLR_OUT_2Mhz_PP);
3232

examples_ch5xx/blink/blink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ int main()
1111
{
1212
SystemInit();
1313

14-
funGpioInitAll(); // Enable GPIOs
14+
funGpioInitAll(); // no-op on ch5xx
1515

1616
funPinMode( PIN_1, GPIO_CFGLR_OUT_10Mhz_PP ); // Set PIN_1 to output
1717
funPinMode( PIN_K, GPIO_CFGLR_OUT_10Mhz_PP ); // Set PIN_K to output

examples_ch5xx/debugprintfdemo/debugprintfdemo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ int main()
1717
{
1818
SystemInit();
1919

20-
funGpioInitAll(); // Enable GPIOs
20+
funGpioInitAll(); // no-op on ch5xx
2121

2222
funPinMode( PA8, GPIO_CFGLR_OUT_10Mhz_PP );
2323

examples_ch5xx/systick_irq/systick_irq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ int main(void)
5757
SystemInit();
5858
systick_init();
5959

60-
funGpioInitAll(); // Enable GPIOs
60+
funGpioInitAll(); // no-op on ch5xx
6161

6262
funPinMode(LED, GPIO_CFGLR_OUT_2Mhz_PP);
6363

examples_ch5xx/uartdemo/uartdemo.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
#include "ch32fun.h"
22
#include <stdio.h>
33

4+
#define PIN_BUTTON PB22
5+
46
int main()
57
{
68
SystemInit();
79

8-
funGpioInitAll(); // Enable GPIOs
10+
funGpioInitAll(); // no-op on ch5xx
911

10-
funPinMode( PB22, GPIO_CFGLR_IN_PU );
12+
funPinMode( PIN_BUTTON, GPIO_CFGLR_IN_PU );
1113

1214
SetupUART(FUNCONF_UART_PRINTF_BAUD); // UART1 on rx,tx:PA8,PA9 at 115200 baud (PA2,PA3 on ch570/2)
13-
printf("TX in on PA3 or PA9, RX is on PA2 or PA8 but not implemented in this demo.\r\n");
15+
printf("|.~'~.- ch5xx TX demo -.~'~.|\r\n"); // test long string
1416

1517
u8 i = 0;
1618
char msg[] = "ch32fun is awesome!\r\n";
1719
while(1)
1820
{
19-
if(!funDigitalRead( PB22 )) { // remove "if(!funDigitalRead( PB22 ))" if you don't have a button on PB22
21+
if(!funDigitalRead( PIN_BUTTON )) { // remove "if(!funDigitalRead( PIN_BUTTON ))" if you don't have a button
2022
putchar(msg[i++]);
2123
}
2224
i %= sizeof(msg);

0 commit comments

Comments
 (0)