rp2040

RP2040 Programming without SDK
Log | Files | Refs

main.c (435B)


      1 typedef enum reset_bit {
      2 	RESET_IOBANK0 = 1 << 5,
      3 	RESET_PLL_SYS = 1 << 12,
      4 	RESET_UART0 =   1 << 22,
      5 } reset_bit;
      6 
      7 void unreset(reset_bit);
      8 void init_xosc(void);
      9 void init_pll(void);
     10 void enable_clock_peri(void);
     11 void set_system_clock_to_pll_sys(void);
     12 void mains(void);
     13 
     14 void
     15 main(void)
     16 {
     17 	enable_clock_peri();
     18 	unreset(RESET_IOBANK0|RESET_PLL_SYS|RESET_UART0);
     19 	init_xosc();
     20 	init_pll();
     21 	set_system_clock_to_pll_sys();
     22 	mains();
     23 }