#include #include #include "ch573/gpio.h" #include "ch573/pwr.h" #include "ch573/uart.h" #define GPIO_PORT_A ch573_gpio__gpio_port_a #define GPIO_PORT CH573_GPIO__GPIO_PORT_T_INTF #define UART1 ch573_uart__uart1 #define UART CH573_UART__UART_T_INTF #define PWR1 ch573_pwr__pwr_mgmt #define PWR CH573_PWR__PWR_MGMT_T_INTF uint32_t collatz(uint32_t n) { uint32_t c = 0; while (n > 1) { if (n % 2 == 0) { n /= 2; } else { n = n * 3 + 1; } c++; } return c; } /* * Main routine. This is called on_reset once everything else has been set up. */ int main(void) { GPIO_PORT.dir.set(GPIO_PORT_A, DIR_OUT, 8); GPIO_PORT.pd_drv.set(GPIO_PORT_A, 0, 8); printf("Hello, %s!\n", "World"); for (;;); return 0; }