software/src/ASF/common2/boards/user_board/init.c
/**
 * After this function, stdio library should work
 */
After this function, stdio library should work
After this function stdio library should work
void configure_stdio_serial(void)
{
  configure_gclk_source(GCLK_CHANNEL_SERCOM0_CORE, GCLK_GENERATOR_0);
  struct usart_config config_usart;
  usart_get_config_defaults(&config_usart);
  config_usart.baudrate = 38400;
  config_usart.mux_setting = USART_RX_1_TX_0_XCK_1;
  config_usart.pinmux_pad0 = PINMUX_PA08C_SERCOM0_PAD0; 
  config_usart.pinmux_pad1 = PINMUX_PA09C_SERCOM0_PAD1; 
  config_usart.pinmux_pad2 = PINMUX_UNUSED;
  config_usart.pinmux_pad3 = PINMUX_UNUSED;
  stdio_serial_init(&usart_instance, SERCOM0, &config_usart);
  usart_enable(&usart_instance);
}
void configure_stdio_serial ( void ) { configure_gclk_source ( GCLK_CHANNEL_SERCOM0_CORE , GCLK_GENERATOR_0 ) ; struct usart_config config_usart ; usart_get_config_defaults ( & config_usart ) ; config_usart . baudrate = 38400 ; config_usart . mux_setting = USART_RX_1_TX_0_XCK_1 ; config_usart . pinmux_pad0 = PINMUX_PA08C_SERCOM0_PAD0 ; config_usart . pinmux_pad1 = PINMUX_PA09C_SERCOM0_PAD1 ; config_usart . pinmux_pad2 = PINMUX_UNUSED ; config_usart . pinmux_pad3 = PINMUX_UNUSED ; stdio_serial_init ( & usart_instance , SERCOM0 , & config_usart ) ; usart_enable ( & usart_instance ) ; }
After this function, stdio library should work
After this function stdio library should work
/* SERCOM0 clock source */ /* SERCOM0 module configuration */ // TX // RX/XCK // TODO: Use correct pins