You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
920 B
C
45 lines
920 B
C
/*
|
|
* Code generated from Atmel Start.
|
|
*
|
|
* This file will be overwritten when reconfiguring your Atmel Start project.
|
|
* Please copy examples or other code you want to keep to a separate file
|
|
* to avoid losing it when reconfiguring.
|
|
*/
|
|
|
|
#include "driver_init.h"
|
|
#include <peripheral_clk_config.h>
|
|
#include <utils.h>
|
|
#include <hal_init.h>
|
|
#include <hpl_gclk_base.h>
|
|
#include <hpl_pm_base.h>
|
|
|
|
struct usart_sync_descriptor USART_0;
|
|
|
|
void USART_0_PORT_init(void)
|
|
{
|
|
|
|
gpio_set_pin_function(PA04, PINMUX_PA04D_SERCOM0_PAD0);
|
|
|
|
gpio_set_pin_function(PA05, PINMUX_PA05D_SERCOM0_PAD1);
|
|
}
|
|
|
|
void USART_0_CLOCK_init(void)
|
|
{
|
|
_pm_enable_bus_clock(PM_BUS_APBC, SERCOM0);
|
|
_gclk_enable_channel(SERCOM0_GCLK_ID_CORE, CONF_GCLK_SERCOM0_CORE_SRC);
|
|
}
|
|
|
|
void USART_0_init(void)
|
|
{
|
|
USART_0_CLOCK_init();
|
|
usart_sync_init(&USART_0, SERCOM0, (void *)NULL);
|
|
USART_0_PORT_init();
|
|
}
|
|
|
|
void system_init(void)
|
|
{
|
|
init_mcu();
|
|
|
|
USART_0_init();
|
|
}
|