From ce3e3dc39bb727aa21e672ac34e34f63bce18377 Mon Sep 17 00:00:00 2001 From: Gareth McMullin Date: Sun, 19 May 2013 19:08:42 +1200 Subject: [PATCH] Split sam3x/sam3n support. --- Makefile | 2 +- include/libopencm3/dispatch/nvic.h | 4 +- include/libopencm3/sam/3n/irq.yaml | 36 ++++++ include/libopencm3/sam/3n/memorymap.h | 60 ++++++++++ include/libopencm3/{sam3x => sam/3x}/irq.yaml | 0 .../libopencm3/{sam3x => sam/3x}/memorymap.h | 0 include/libopencm3/{sam3x => sam}/eefc.h | 7 +- include/libopencm3/{sam3x => sam}/gpio.h | 2 +- .../libopencm3/sam/memorymap.h | 20 ++-- include/libopencm3/{sam3x => sam}/pio.h | 6 +- include/libopencm3/{sam3x => sam}/pmc.h | 2 +- include/libopencm3/{sam3x => sam}/pwm.h | 22 ++-- include/libopencm3/{sam3x => sam}/tc.h | 2 +- include/libopencm3/{sam3x => sam}/uart.h | 2 +- include/libopencm3/{sam3x => sam}/usart.h | 2 +- include/libopencm3/{sam3x => sam}/wdt.h | 2 +- lib/dispatch/vector_nvic.c | 4 +- lib/sam/3n/Makefile | 36 ++++++ .../3n/libopencm3_sam3n.ld} | 0 lib/{sam3x => sam/3x}/Makefile | 6 +- lib/sam/3x/libopencm3_sam3x.ld | 106 ++++++++++++++++++ lib/{sam3x => sam/common}/gpio.c | 2 +- lib/{sam3x => sam/common}/pmc.c | 4 +- lib/{sam3x => sam/common}/usart.c | 4 +- 24 files changed, 295 insertions(+), 36 deletions(-) create mode 100644 include/libopencm3/sam/3n/irq.yaml create mode 100644 include/libopencm3/sam/3n/memorymap.h rename include/libopencm3/{sam3x => sam/3x}/irq.yaml (100%) rename include/libopencm3/{sam3x => sam/3x}/memorymap.h (100%) rename include/libopencm3/{sam3x => sam}/eefc.h (93%) rename include/libopencm3/{sam3x => sam}/gpio.h (97%) rename lib/sam3x/pio.c => include/libopencm3/sam/memorymap.h (71%) rename include/libopencm3/{sam3x => sam}/pio.h (97%) rename include/libopencm3/{sam3x => sam}/pmc.h (99%) rename include/libopencm3/{sam3x => sam}/pwm.h (83%) rename include/libopencm3/{sam3x => sam}/tc.h (98%) rename include/libopencm3/{sam3x => sam}/uart.h (98%) rename include/libopencm3/{sam3x => sam}/usart.h (99%) rename include/libopencm3/{sam3x => sam}/wdt.h (97%) create mode 100644 lib/sam/3n/Makefile rename lib/{sam3x/libopencm3_sam3x.ld => sam/3n/libopencm3_sam3n.ld} (100%) rename lib/{sam3x => sam/3x}/Makefile (88%) create mode 100644 lib/sam/3x/libopencm3_sam3x.ld rename lib/{sam3x => sam/common}/gpio.c (97%) rename lib/{sam3x => sam/common}/pmc.c (96%) rename lib/{sam3x => sam/common}/usart.c (97%) diff --git a/Makefile b/Makefile index 5ee65f02..18950f8a 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ SHAREDIR = $(DESTDIR)/$(PREFIX)/share/libopencm3/scripts INSTALL = install SRCLIBDIR = $(shell pwd)/lib -TARGETS = stm32/f1 stm32/f2 stm32/f4 stm32/l1 lpc13xx lpc17xx lpc43xx lm3s lm4f efm32/efm32tg efm32/efm32g efm32/efm32lg efm32/efm32gg sam3x +TARGETS = stm32/f1 stm32/f2 stm32/f4 stm32/l1 lpc13xx lpc17xx lpc43xx lm3s lm4f efm32/efm32tg efm32/efm32g efm32/efm32lg efm32/efm32gg sam/3x sam/3n # Be silent per default, but 'make V=1' will show all compiler calls. ifneq ($(V),1) diff --git a/include/libopencm3/dispatch/nvic.h b/include/libopencm3/dispatch/nvic.h index fe0bd05a..6764aaf2 100644 --- a/include/libopencm3/dispatch/nvic.h +++ b/include/libopencm3/dispatch/nvic.h @@ -24,7 +24,9 @@ # include #elif defined(SAM3X) -# include +# include +#elif defined(SAM3N) +# include #elif defined(LM3S) || defined(LM4F) /* Yes, we use the same interrupt table for both LM3S and LM4F */ diff --git a/include/libopencm3/sam/3n/irq.yaml b/include/libopencm3/sam/3n/irq.yaml new file mode 100644 index 00000000..f4fefa8d --- /dev/null +++ b/include/libopencm3/sam/3n/irq.yaml @@ -0,0 +1,36 @@ +includeguard: LIBOPENCM3_SAM3N_NVIC_H +partname_humanreadable: Atmel SAM3N series +partname_doxygen: SAM3N +irqs: + - supc + - rstc + - rtc + - rtt + - wdg + - pmc + - eefc0 + - reserved0 + - uart0 + - uart1 + - reserved1 + - pioa + - piob + - pioc + - usart0 + - usart1 + - reserved2 + - reserved3 + - reserved4 + - twi0 + - twi1 + - spi + - reserved5 + - tc0 + - tc1 + - tc2 + - tc3 + - tc4 + - tc5 + - adc + - dacc + - pwm diff --git a/include/libopencm3/sam/3n/memorymap.h b/include/libopencm3/sam/3n/memorymap.h new file mode 100644 index 00000000..9dde0f4d --- /dev/null +++ b/include/libopencm3/sam/3n/memorymap.h @@ -0,0 +1,60 @@ +/* + * This file is part of the libopencm3 project. + * + * Copyright (C) 2012 Gareth McMullin + * + * This library is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library. If not, see . + */ + +#ifndef SAM3N_MEMORYMAP_H +#define SAM3N_MEMORYMAP_H + +#include + +/* --- SAM3N peripheral space -------------------------------------------- */ + +#define SPI_BASE (0x40008000) +#define TC0_BASE (0x40010000) +#define TC1_BASE (0x40010040) +#define TC2_BASE (0x40010080) +#define TC3_BASE (0x40014000) +#define TC4_BASE (0x40014040) +#define TC5_BASE (0x40014080) +#define TWI0_BASE (0x40018000) +#define TWI1_BASE (0x4001C000) +#define PWM_BASE (0x40020000) +#define USART0_BASE (0x40024000) +#define USART1_BASE (0x40028000) +#define ADC_BASE (0x40038000) +#define DACC_BASE (0x4003C000) + +/* --- SAM3N system controller space ------------------------------------- */ +#define SMC_BASE (0x400E0000) +#define MATRIX_BASE (0x400E0200) +#define PMC_BASE (0x400E0400) +#define UART0_BASE (0x400E0600) +#define CHIPID_BASE (0x400E0740) +#define UART1_BASE (0x400E0800) +#define EEFC_BASE (0x400E0A00) +#define PIOA_BASE (0x400E0E00) +#define PIOB_BASE (0x400E1000) +#define PIOC_BASE (0x400E1200) +#define RSTC_BASE (0x400E1400) +#define SUPC_BASE (0x400E1410) +#define RTT_BASE (0x400E1430) +#define WDT_BASE (0x400E1450) +#define RTC_BASE (0x400E1460) +#define GPBR_BASE (0x400E1490) + +#endif diff --git a/include/libopencm3/sam3x/irq.yaml b/include/libopencm3/sam/3x/irq.yaml similarity index 100% rename from include/libopencm3/sam3x/irq.yaml rename to include/libopencm3/sam/3x/irq.yaml diff --git a/include/libopencm3/sam3x/memorymap.h b/include/libopencm3/sam/3x/memorymap.h similarity index 100% rename from include/libopencm3/sam3x/memorymap.h rename to include/libopencm3/sam/3x/memorymap.h diff --git a/include/libopencm3/sam3x/eefc.h b/include/libopencm3/sam/eefc.h similarity index 93% rename from include/libopencm3/sam3x/eefc.h rename to include/libopencm3/sam/eefc.h index 6fe70538..d0ba095d 100644 --- a/include/libopencm3/sam3x/eefc.h +++ b/include/libopencm3/sam/eefc.h @@ -21,9 +21,10 @@ #define SAM3X_EEFC_H #include -#include +#include /* --- Convenience macros ------------------------------------------------ */ +#define EEFC EEFC_BASE #define EEFC0 EEFC0_BASE #define EEFC1 EEFC1_BASE @@ -70,8 +71,12 @@ static inline void eefc_set_latency(u8 wait) { +#if defined(SAM3X) EEFC_FMR(EEFC0) = (EEFC_FMR(EEFC0) & ~EEFC_FMR_FWS_MASK) | (wait << 8); EEFC_FMR(EEFC1) = (EEFC_FMR(EEFC1) & ~EEFC_FMR_FWS_MASK) | (wait << 8); +#elif defined(SAM3N) + EEFC_FMR(EEFC) = (EEFC_FMR(EEFC) & ~EEFC_FMR_FWS_MASK) | (wait << 8); +#endif } #endif diff --git a/include/libopencm3/sam3x/gpio.h b/include/libopencm3/sam/gpio.h similarity index 97% rename from include/libopencm3/sam3x/gpio.h rename to include/libopencm3/sam/gpio.h index 53152d30..84e937c1 100644 --- a/include/libopencm3/sam3x/gpio.h +++ b/include/libopencm3/sam/gpio.h @@ -20,7 +20,7 @@ #ifndef SAM3X_GPIO_H #define SAM3X_GPIO_H -#include +#include /* flags may be or'd together, but only contain one of * GPOUTPUT, PERIPHA and PERIPHB */ diff --git a/lib/sam3x/pio.c b/include/libopencm3/sam/memorymap.h similarity index 71% rename from lib/sam3x/pio.c rename to include/libopencm3/sam/memorymap.h index 065bb8c0..b6f3ba43 100644 --- a/lib/sam3x/pio.c +++ b/include/libopencm3/sam/memorymap.h @@ -1,7 +1,7 @@ /* * This file is part of the libopencm3 project. * - * Copyright (C) 2012 Gareth McMullin + * Copyright (C) 2013 Gareth McMullin * * This library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -17,12 +17,16 @@ * along with this library. If not, see . */ -#include +#ifndef SAM_MEMORYMAP_H +#define SAM_MEMORYMAP_H -void pio_toggle(u32 gpioport, u32 gpios) -{ - u32 odsr = PIO_ODSR(gpioport); - PIO_CODR(gpioport) = odsr & gpios; - PIO_SODR(gpioport) = ~odsr & gpios; -} +#if defined(SAM3X) +# include +#elif defined(SAM3N) +# include +#else +# error "Processor family not defined." +#endif + +#endif diff --git a/include/libopencm3/sam3x/pio.h b/include/libopencm3/sam/pio.h similarity index 97% rename from include/libopencm3/sam3x/pio.h rename to include/libopencm3/sam/pio.h index d3a76bcd..3288718c 100644 --- a/include/libopencm3/sam3x/pio.h +++ b/include/libopencm3/sam/pio.h @@ -17,11 +17,11 @@ * along with this library. If not, see . */ -#ifndef SAM3X_PIO_H -#define SAM3X_PIO_H +#ifndef SAM_PIO_H +#define SAM_PIO_H #include -#include +#include /* --- Convenience macros ------------------------------------------------ */ diff --git a/include/libopencm3/sam3x/pmc.h b/include/libopencm3/sam/pmc.h similarity index 99% rename from include/libopencm3/sam3x/pmc.h rename to include/libopencm3/sam/pmc.h index cff7ed0a..5587a238 100644 --- a/include/libopencm3/sam3x/pmc.h +++ b/include/libopencm3/sam/pmc.h @@ -21,7 +21,7 @@ #define SAM3X_PMC_H #include -#include +#include /* --- Power Management Controller (PMC) registers ----------------------- */ diff --git a/include/libopencm3/sam3x/pwm.h b/include/libopencm3/sam/pwm.h similarity index 83% rename from include/libopencm3/sam3x/pwm.h rename to include/libopencm3/sam/pwm.h index 445ff2bd..7cf13bc1 100644 --- a/include/libopencm3/sam3x/pwm.h +++ b/include/libopencm3/sam/pwm.h @@ -21,7 +21,7 @@ #define SAM3X_PWM_H #include -#include +#include /* --- Pulse Width Modulation (PWM) registers ----------------------- */ @@ -71,12 +71,20 @@ /* 0x01B0:0x01FC - Reserved */ #define PWM_CMR(x) MMIO32(PWM_BASE + 0x0200 + 0x20*(x)) #define PWM_CDTY(x) MMIO32(PWM_BASE + 0x0204 + 0x20*(x)) -#define PWM_CDTYUPD(x) MMIO32(PWM_BASE + 0x0208 + 0x20*(x)) -#define PWM_CPRD(x) MMIO32(PWM_BASE + 0x020C + 0x20*(x)) -#define PWM_CPRDUPD(x) MMIO32(PWM_BASE + 0x0210 + 0x20*(x)) -#define PWM_CCNT(x) MMIO32(PWM_BASE + 0x0214 + 0x20*(x)) -#define PWM_DT(x) MMIO32(PWM_BASE + 0x0218 + 0x20*(x)) -#define PWM_DTUPD(x) MMIO32(PWM_BASE + 0x021C + 0x20*(x)) +#if defined(SAM3X) +# define PWM_CDTYUPD(x) MMIO32(PWM_BASE + 0x0208 + 0x20*(x)) +# define PWM_CPRD(x) MMIO32(PWM_BASE + 0x020C + 0x20*(x)) +# define PWM_CPRDUPD(x) MMIO32(PWM_BASE + 0x0210 + 0x20*(x)) +# define PWM_CCNT(x) MMIO32(PWM_BASE + 0x0214 + 0x20*(x)) +# define PWM_DT(x) MMIO32(PWM_BASE + 0x0218 + 0x20*(x)) +# define PWM_DTUPD(x) MMIO32(PWM_BASE + 0x021C + 0x20*(x)) +#elif defined(SAM3N) +# define PWM_CPRD(x) MMIO32(PWM_BASE + 0x0208 + 0x20*(x)) +# define PWM_CCNT(x) MMIO32(PWM_BASE + 0x020C + 0x20*(x)) +# define PWM_CUPD(x) MMIO32(PWM_BASE + 0x0210 + 0x20*(x)) +#else +# error "Processor family not defined." +#endif static inline void pwm_set_period(int ch, u32 period) { diff --git a/include/libopencm3/sam3x/tc.h b/include/libopencm3/sam/tc.h similarity index 98% rename from include/libopencm3/sam3x/tc.h rename to include/libopencm3/sam/tc.h index 192d8f4c..864cc4ad 100644 --- a/include/libopencm3/sam3x/tc.h +++ b/include/libopencm3/sam/tc.h @@ -21,7 +21,7 @@ #define SAM3X_TC_H #include -#include +#include /* --- Timer Counter (TC) registers -------------------------------------- */ diff --git a/include/libopencm3/sam3x/uart.h b/include/libopencm3/sam/uart.h similarity index 98% rename from include/libopencm3/sam3x/uart.h rename to include/libopencm3/sam/uart.h index 2c8d3a21..becfcb55 100644 --- a/include/libopencm3/sam3x/uart.h +++ b/include/libopencm3/sam/uart.h @@ -21,7 +21,7 @@ #define SAM3X_UART_H #include -#include +#include /* --- Universal Asynchronous Receiver Transmitter (UART) registers ------- */ #define UART_CR MMIO32(UART_BASE + 0x0000) diff --git a/include/libopencm3/sam3x/usart.h b/include/libopencm3/sam/usart.h similarity index 99% rename from include/libopencm3/sam3x/usart.h rename to include/libopencm3/sam/usart.h index ac7db1d5..37df9b91 100644 --- a/include/libopencm3/sam3x/usart.h +++ b/include/libopencm3/sam/usart.h @@ -21,7 +21,7 @@ #define SAM3X_USART_H #include -#include +#include #define USART0 USART0_BASE #define USART1 USART1_BASE diff --git a/include/libopencm3/sam3x/wdt.h b/include/libopencm3/sam/wdt.h similarity index 97% rename from include/libopencm3/sam3x/wdt.h rename to include/libopencm3/sam/wdt.h index c4ab2313..566ac958 100644 --- a/include/libopencm3/sam3x/wdt.h +++ b/include/libopencm3/sam/wdt.h @@ -21,7 +21,7 @@ #define SAM3X_WDT_H #include -#include +#include /* --- WDT registers ----------------------------------------------------- */ diff --git a/lib/dispatch/vector_nvic.c b/lib/dispatch/vector_nvic.c index 782aa0e4..7505ce63 100644 --- a/lib/dispatch/vector_nvic.c +++ b/lib/dispatch/vector_nvic.c @@ -24,7 +24,9 @@ # include "../lpc43xx/vector_nvic.c" #elif defined(SAM3X) -# include "../sam3x/vector_nvic.c" +# include "../sam/3x/vector_nvic.c" +#elif defined(SAM3N) +# include "../sam/3n/vector_nvic.c" #elif defined(LM3S) || defined(LM4F) /* Yes, we use the same interrupt table for both LM3S and LM4F */ diff --git a/lib/sam/3n/Makefile b/lib/sam/3n/Makefile new file mode 100644 index 00000000..fa977226 --- /dev/null +++ b/lib/sam/3n/Makefile @@ -0,0 +1,36 @@ +## +## This file is part of the libopencm3 project. +## +## Copyright (C) 2009 Uwe Hermann +## +## This library is free software: you can redistribute it and/or modify +## it under the terms of the GNU Lesser General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This library is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public License +## along with this library. If not, see . +## + +LIBNAME = libopencm3_sam3n + +PREFIX ?= arm-none-eabi +#PREFIX ?= arm-elf +CC = $(PREFIX)-gcc +AR = $(PREFIX)-ar +CFLAGS = -Os -g -Wall -Wextra -I../../../include -fno-common \ + -mcpu=cortex-m3 -mthumb -Wstrict-prototypes \ + -ffunction-sections -fdata-sections -MD -DSAM3N +# ARFLAGS = rcsv +ARFLAGS = rcs +OBJS = gpio.o pmc.o usart.o + +VPATH += ../../cm3:../common + +include ../../Makefile.include + diff --git a/lib/sam3x/libopencm3_sam3x.ld b/lib/sam/3n/libopencm3_sam3n.ld similarity index 100% rename from lib/sam3x/libopencm3_sam3x.ld rename to lib/sam/3n/libopencm3_sam3n.ld diff --git a/lib/sam3x/Makefile b/lib/sam/3x/Makefile similarity index 88% rename from lib/sam3x/Makefile rename to lib/sam/3x/Makefile index 17df7688..90365cb7 100644 --- a/lib/sam3x/Makefile +++ b/lib/sam/3x/Makefile @@ -23,14 +23,14 @@ PREFIX ?= arm-none-eabi #PREFIX ?= arm-elf CC = $(PREFIX)-gcc AR = $(PREFIX)-ar -CFLAGS = -Os -g -Wall -Wextra -I../../include -fno-common \ +CFLAGS = -Os -g -Wall -Wextra -I../../../include -fno-common \ -mcpu=cortex-m3 -mthumb -Wstrict-prototypes \ -ffunction-sections -fdata-sections -MD -DSAM3X # ARFLAGS = rcsv ARFLAGS = rcs OBJS = gpio.o pmc.o usart.o -VPATH += ../usb:../cm3 +VPATH += ../../usb:../../cm3:../common -include ../Makefile.include +include ../../Makefile.include diff --git a/lib/sam/3x/libopencm3_sam3x.ld b/lib/sam/3x/libopencm3_sam3x.ld new file mode 100644 index 00000000..3fc2ccb6 --- /dev/null +++ b/lib/sam/3x/libopencm3_sam3x.ld @@ -0,0 +1,106 @@ +/* + * This file is part of the libopencm3 project. + * + * Copyright (C) 2009 Uwe Hermann + * + * This library is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library. If not, see . + */ + +/* Generic linker script for STM32 targets using libopencm3. */ + +/* Memory regions must be defined in the ld script which includes this one. */ + +/* Enforce emmition of the vector table. */ +EXTERN (vector_table) + +/* Define the entry point of the output file. */ +ENTRY(reset_handler) + +/* Define sections. */ +SECTIONS +{ + .text : { + *(.vectors) /* Vector table */ + *(.text*) /* Program code */ + . = ALIGN(4); + *(.rodata*) /* Read-only data */ + . = ALIGN(4); + } >rom + + /* C++ Static constructors/destructors, also used for __attribute__ + * ((constructor)) and the likes */ + .preinit_array : { + . = ALIGN(4); + __preinit_array_start = .; + KEEP (*(.preinit_array)) + __preinit_array_end = .; + } >rom + .init_array : { + . = ALIGN(4); + __init_array_start = .; + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array)) + __init_array_end = .; + } >rom + .fini_array : { + . = ALIGN(4); + __fini_array_start = .; + KEEP (*(.fini_array)) + KEEP (*(SORT(.fini_array.*))) + __fini_array_end = .; + } >rom + + /* + * Another section used by C++ stuff, appears when using newlib with + * 64bit (long long) printf support + */ + .ARM.extab : { + *(.ARM.extab*) + } >rom + .ARM.exidx : { + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + } >rom + + . = ALIGN(4); + _etext = .; + + .data : { + _data = .; + *(.data*) /* Read-write initialized data */ + . = ALIGN(4); + _edata = .; + } >ram AT >rom + _data_loadaddr = LOADADDR(.data); + + .bss : { + *(.bss*) /* Read-write zero initialized data */ + *(COMMON) + . = ALIGN(4); + _ebss = .; + } >ram + + /* + * The .eh_frame section appears to be used for C++ exception handling. + * You may need to fix this if you're using C++. + */ + /DISCARD/ : { *(.eh_frame) } + + . = ALIGN(4); + end = .; +} + +PROVIDE(_stack = ORIGIN(ram) + LENGTH(ram)); + diff --git a/lib/sam3x/gpio.c b/lib/sam/common/gpio.c similarity index 97% rename from lib/sam3x/gpio.c rename to lib/sam/common/gpio.c index e52ac139..80d41776 100644 --- a/lib/sam3x/gpio.c +++ b/lib/sam/common/gpio.c @@ -17,7 +17,7 @@ * along with this library. If not, see . */ -#include +#include void gpio_init(u32 port, u32 pins, enum gpio_flags flags) { diff --git a/lib/sam3x/pmc.c b/lib/sam/common/pmc.c similarity index 96% rename from lib/sam3x/pmc.c rename to lib/sam/common/pmc.c index 0086e177..97f1be67 100644 --- a/lib/sam3x/pmc.c +++ b/lib/sam/common/pmc.c @@ -17,8 +17,8 @@ * along with this library. If not, see . */ -#include -#include +#include +#include /** Default peripheral clock frequency after reset. */ u32 pmc_mck_frequency = 4000000; diff --git a/lib/sam3x/usart.c b/lib/sam/common/usart.c similarity index 97% rename from lib/sam3x/usart.c rename to lib/sam/common/usart.c index 4d1114f1..56937fcc 100644 --- a/lib/sam3x/usart.c +++ b/lib/sam/common/usart.c @@ -17,8 +17,8 @@ * along with this library. If not, see . */ -#include -#include +#include +#include void usart_set_baudrate(u32 usart, u32 baud) {