diff --git a/include/libopencm3/sam/3n/periph.h b/include/libopencm3/sam/3n/periph.h new file mode 100644 index 00000000..ca14059c --- /dev/null +++ b/include/libopencm3/sam/3n/periph.h @@ -0,0 +1,52 @@ +/* + * This file is part of the libopencm3 project. + * + * Copyright (C) 2015 Felix Held + * + * 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 LIBOPENCM3_PERIPH_H +#define LIBOPENCM3_PERIPH_H + +/* --- Peripheral Identifiers ---------------------------------------------- */ +#define PERIPH_SUPC 0 +#define PERIPH_RSTC 1 +#define PERIPH_RTC 2 +#define PERIPH_RTT 3 +#define PERIPH_WDG 4 +#define PERIPH_PMC 5 +#define PERIPH_EEFC 6 +#define PERIPH_UART0 8 +#define PERIPH_UART1 9 +#define PERIPH_PIOA 11 +#define PERIPH_PIOB 12 +#define PERIPH_PIOC 13 +#define PERIPH_USART0 14 +#define PERIPH_USART1 15 +#define PERIPH_TWI0 19 +#define PERIPH_TWI1 20 +#define PERIPH_SPI 21 +#define PERIPH_TC0 23 +#define PERIPH_TC1 24 +#define PERIPH_TC2 25 +#define PERIPH_TC3 26 +#define PERIPH_TC4 27 +#define PERIPH_TC5 28 +#define PERIPH_ADC 29 +#define PERIPH_DACC 30 +#define PERIPH_PWM 31 + + +#endif diff --git a/include/libopencm3/sam/3s/periph.h b/include/libopencm3/sam/3s/periph.h new file mode 100644 index 00000000..fb0ee5c3 --- /dev/null +++ b/include/libopencm3/sam/3s/periph.h @@ -0,0 +1,59 @@ +/* + * This file is part of the libopencm3 project. + * + * Copyright (C) 2015 Felix Held + * + * 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 LIBOPENCM3_PERIPH_H +#define LIBOPENCM3_PERIPH_H + +/* --- Peripheral Identifiers ---------------------------------------------- */ +#define PERIPH_SUPC 0 +#define PERIPH_RSTC 1 +#define PERIPH_RTC 2 +#define PERIPH_RTT 3 +#define PERIPH_WDG 4 +#define PERIPH_PMC 5 +#define PERIPH_EEFC 6 +#define PERIPH_UART0 8 +#define PERIPH_UART1 9 +#define PERIPH_SMC 10 +#define PERIPH_PIOA 11 +#define PERIPH_PIOB 12 +#define PERIPH_PIOC 13 +#define PERIPH_USART0 14 +#define PERIPH_USART1 15 +#define PERIPH_USART2 16 +#define PERIPH_HSMCI 18 +#define PERIPH_TWI0 19 +#define PERIPH_TWI1 20 +#define PERIPH_SPI 21 +#define PERIPH_SSC 22 +#define PERIPH_TC0 23 +#define PERIPH_TC1 24 +#define PERIPH_TC2 25 +#define PERIPH_TC3 26 +#define PERIPH_TC4 27 +#define PERIPH_TC5 28 +#define PERIPH_ADC 29 +#define PERIPH_DACC 30 +#define PERIPH_PWM 31 +#define PERIPH_CRCCU 32 +#define PERIPH_ACC 33 +#define PERIPH_UDP 34 + + +#endif diff --git a/include/libopencm3/sam/3u/periph.h b/include/libopencm3/sam/3u/periph.h new file mode 100644 index 00000000..507f18b2 --- /dev/null +++ b/include/libopencm3/sam/3u/periph.h @@ -0,0 +1,56 @@ +/* + * This file is part of the libopencm3 project. + * + * Copyright (C) 2015 Felix Held + * + * 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 LIBOPENCM3_PERIPH_H +#define LIBOPENCM3_PERIPH_H + +/* --- Peripheral Identifiers ---------------------------------------------- */ +#define PERIPH_SUPC 0 +#define PERIPH_RSTC 1 +#define PERIPH_RTC 2 +#define PERIPH_RTT 3 +#define PERIPH_WDG 4 +#define PERIPH_PMC 5 +#define PERIPH_EEFC0 6 +#define PERIPH_EEFC1 7 +#define PERIPH_UART 8 +#define PERIPH_SMC 9 +#define PERIPH_PIOA 10 +#define PERIPH_PIOB 11 +#define PERIPH_PIOC 12 +#define PERIPH_USART0 13 +#define PERIPH_USART1 14 +#define PERIPH_USART2 15 +#define PERIPH_USART3 16 +#define PERIPH_HSMCI 17 +#define PERIPH_TWI0 18 +#define PERIPH_TWI1 19 +#define PERIPH_SPI 20 +#define PERIPH_SSC 21 +#define PERIPH_TC0 22 +#define PERIPH_TC1 23 +#define PERIPH_TC2 24 +#define PERIPH_PWM 25 +#define PERIPH_ADC12B 26 +#define PERIPH_ADC 27 +#define PERIPH_DMAC 28 +#define PERIPH_UDPHS 29 + + +#endif diff --git a/include/libopencm3/sam/common/periph_common_3a3x.h b/include/libopencm3/sam/common/periph_common_3a3x.h new file mode 100644 index 00000000..a0dcae23 --- /dev/null +++ b/include/libopencm3/sam/common/periph_common_3a3x.h @@ -0,0 +1,71 @@ +/* + * This file is part of the libopencm3 project. + * + * Copyright (C) 2015 Felix Held + * + * 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 LIBOPENCM3_PERIPH_H +#define LIBOPENCM3_PERIPH_H + +/* --- Peripheral Identifiers ---------------------------------------------- */ +#define PERIPH_SUPC 0 +#define PERIPH_RSTC 1 +#define PERIPH_RTC 2 +#define PERIPH_RTT 3 +#define PERIPH_WDG 4 +#define PERIPH_PMC 5 +#define PERIPH_EEFC0 6 +#define PERIPH_EEFC1 7 +#define PERIPH_UART 8 +#define PERIPH_SMC_SDRAMC 9 +#define PERIPH_SDRAMC 10 +#define PERIPH_PIOA 11 +#define PERIPH_PIOB 12 +#define PERIPH_PIOC 13 +#define PERIPH_PIOD 14 +#define PERIPH_PIOE 15 +#define PERIPH_PIOF 16 +#define PERIPH_USART0 17 +#define PERIPH_USART1 18 +#define PERIPH_USART2 19 +#define PERIPH_USART3 20 +#define PERIPH_HSMCI 21 +#define PERIPH_TWI0 22 +#define PERIPH_TWI1 23 +#define PERIPH_SPI0 24 +#define PERIPH_SPI1 25 +#define PERIPH_SSC 26 +#define PERIPH_TC0 27 +#define PERIPH_TC1 28 +#define PERIPH_TC2 29 +#define PERIPH_TC3 30 +#define PERIPH_TC4 31 +#define PERIPH_TC5 32 +#define PERIPH_TC6 33 +#define PERIPH_TC7 34 +#define PERIPH_TC8 35 +#define PERIPH_PWM 36 +#define PERIPH_ADC 37 +#define PERIPH_DACC 38 +#define PERIPH_DMAC 39 +#define PERIPH_UOTGHS 40 +#define PERIPH_TRNG 41 +#define PERIPH_EMAC 42 +#define PERIPH_CAN0 43 +#define PERIPH_CAN1 44 + + +#endif diff --git a/include/libopencm3/sam/periph.h b/include/libopencm3/sam/periph.h new file mode 100644 index 00000000..e1ae621d --- /dev/null +++ b/include/libopencm3/sam/periph.h @@ -0,0 +1,32 @@ +/* This provides unification of code over SAM subfamilies */ + +/* + * This file is part of the libopencm3 project. + * + * 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 . + */ + +#if defined(SAM3A) +# include +#elif defined(SAM3N) +# include +#elif defined(SAM3S) +# include +#elif defined(SAM3U) +# include +#elif defined(SAM3X) +# include +#else +# error "sam family not defined." +#endif