aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorchrysn2012-03-02 23:59:52 +0100
committerchrysn2012-03-02 23:59:52 +0100
commit563586c072c38fe1d0706bfc96dae33773f1dda7 (patch)
tree95ed81a5862e8ba5bfcdf1e908bb91cbb7f51b23 /lib
parente388056fda84a5c85430f5a31a4cfe3af3f2e35f (diff)
parent43561de3297b88d68753cb4625d6dc48bfb43d71 (diff)
Merge branch 'master' into efm32
Diffstat (limited to 'lib')
-rw-r--r--lib/lm3s/gpio.c12
-rw-r--r--lib/lm3s/libopencm3_lm3s.ld12
-rw-r--r--lib/lm3s/vector.c12
-rw-r--r--lib/lpc13xx/gpio.c12
-rw-r--r--lib/lpc13xx/libopencm3_lpc13xx.ld12
-rw-r--r--lib/stm32/f1/adc.c12
-rw-r--r--lib/stm32/f1/can.c12
-rw-r--r--lib/stm32/f1/dma.c474
-rw-r--r--lib/stm32/f1/ethernet.c12
-rw-r--r--lib/stm32/f1/exti.c12
-rw-r--r--lib/stm32/f1/flash.c12
-rw-r--r--lib/stm32/f1/gpio.c12
-rw-r--r--lib/stm32/f1/libopencm3_stm32f1.ld12
-rw-r--r--lib/stm32/f1/rcc.c12
-rw-r--r--lib/stm32/f1/rtc.c12
-rw-r--r--lib/stm32/f1/scb.c12
-rw-r--r--lib/stm32/f1/timer.c12
-rw-r--r--lib/stm32/f1/vector.c12
-rw-r--r--lib/stm32/f2/exti.c12
-rw-r--r--lib/stm32/f2/flash.c12
-rw-r--r--lib/stm32/f2/gpio.c12
-rw-r--r--lib/stm32/f2/libopencm3_stm32f2.ld12
-rw-r--r--lib/stm32/f2/rcc.c12
-rw-r--r--lib/stm32/f2/scb.c12
-rw-r--r--lib/stm32/f2/timer.c12
-rw-r--r--lib/stm32/f2/vector.c12
-rw-r--r--lib/stm32/f4/exti.c12
-rw-r--r--lib/stm32/f4/flash.c12
-rw-r--r--lib/stm32/f4/gpio.c12
-rw-r--r--lib/stm32/f4/libopencm3_stm32f4.ld12
-rw-r--r--lib/stm32/f4/pwr.c12
-rw-r--r--lib/stm32/f4/rcc.c12
-rw-r--r--lib/stm32/f4/scb.c12
-rw-r--r--lib/stm32/f4/timer.c12
-rw-r--r--lib/stm32/f4/vector.c12
-rw-r--r--lib/stm32/i2c.c12
-rw-r--r--lib/stm32/nvic.c12
-rw-r--r--lib/stm32/spi.c39
-rw-r--r--lib/stm32/systick.c12
-rw-r--r--lib/stm32/usart.c12
-rw-r--r--lib/usb/usb.c12
-rw-r--r--lib/usb/usb_control.c12
-rw-r--r--lib/usb/usb_f103.c12
-rw-r--r--lib/usb/usb_f107.c14
-rw-r--r--lib/usb/usb_private.h12
-rw-r--r--lib/usb/usb_standard.c12
46 files changed, 348 insertions, 695 deletions
diff --git a/lib/lm3s/gpio.c b/lib/lm3s/gpio.c
index 88e105f..a92c96e 100644
--- a/lib/lm3s/gpio.c
+++ b/lib/lm3s/gpio.c
@@ -3,18 +3,18 @@
*
* Copyright (C) 2011 Gareth McMullin <gareth@blacksphere.co.nz>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/lm3s/gpio.h>
diff --git a/lib/lm3s/libopencm3_lm3s.ld b/lib/lm3s/libopencm3_lm3s.ld
index 87c940a..c1453fe 100644
--- a/lib/lm3s/libopencm3_lm3s.ld
+++ b/lib/lm3s/libopencm3_lm3s.ld
@@ -3,18 +3,18 @@
*
* Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/* Generic linker script for LM3S targets using libopencm3. */
diff --git a/lib/lm3s/vector.c b/lib/lm3s/vector.c
index 8e54aeb..5968d76 100644
--- a/lib/lm3s/vector.c
+++ b/lib/lm3s/vector.c
@@ -3,18 +3,18 @@
*
* Copyright (C) 2011 Gareth McMullin <gareth@blacksphere.co.nz>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#define WEAK __attribute__ ((weak))
diff --git a/lib/lpc13xx/gpio.c b/lib/lpc13xx/gpio.c
index 9eb057e..be4874c 100644
--- a/lib/lpc13xx/gpio.c
+++ b/lib/lpc13xx/gpio.c
@@ -3,18 +3,18 @@
*
* Copyright (C) 2010 Uwe Hermann <uwe@hermann-uwe.de>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/lpc13xx/gpio.h>
diff --git a/lib/lpc13xx/libopencm3_lpc13xx.ld b/lib/lpc13xx/libopencm3_lpc13xx.ld
index 009ee2a..5f1630f 100644
--- a/lib/lpc13xx/libopencm3_lpc13xx.ld
+++ b/lib/lpc13xx/libopencm3_lpc13xx.ld
@@ -3,18 +3,18 @@
*
* Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/* Generic linker script for LPC13XX targets using libopencm3. */
diff --git a/lib/stm32/f1/adc.c b/lib/stm32/f1/adc.c
index 766986f..7df1835 100644
--- a/lib/stm32/f1/adc.c
+++ b/lib/stm32/f1/adc.c
@@ -3,18 +3,18 @@
*
* Copyright (C) 2009 Edward Cheeseman <evbuilder@users.sourceforge.net>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/*
diff --git a/lib/stm32/f1/can.c b/lib/stm32/f1/can.c
index 4cfe84b..151c47c 100644
--- a/lib/stm32/f1/can.c
+++ b/lib/stm32/f1/can.c
@@ -3,18 +3,18 @@
*
* Copyright (C) 2010 Piotr Esden-Tempski <piotr@esden.net>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/stm32/can.h>
diff --git a/lib/stm32/f1/dma.c b/lib/stm32/f1/dma.c
index 3a7a158..6bcb396 100644
--- a/lib/stm32/f1/dma.c
+++ b/lib/stm32/f1/dma.c
@@ -3,514 +3,140 @@
*
* Copyright (C) 2010 Thomas Otto <tommi@viadmin.org>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/stm32/f1/dma.h>
-void dma_enable_mem2mem_mode(u32 dma, u8 channel)
+void dma_channel_reset(u32 dma, u8 channel)
{
- switch (channel) {
- case 1:
- DMA_CCR1(dma) |= DMA_CCR1_MEM2MEM;
- DMA_CCR1(dma) &= ~DMA_CCR1_CIRC;
- case 2:
- DMA_CCR2(dma) |= DMA_CCR2_MEM2MEM;
- DMA_CCR2(dma) &= ~DMA_CCR2_CIRC;
- case 3:
- DMA_CCR3(dma) |= DMA_CCR3_MEM2MEM;
- DMA_CCR3(dma) &= ~DMA_CCR3_CIRC;
- case 4:
- DMA_CCR4(dma) |= DMA_CCR4_MEM2MEM;
- DMA_CCR4(dma) &= ~DMA_CCR4_CIRC;
- case 5:
- DMA_CCR5(dma) |= DMA_CCR5_MEM2MEM;
- DMA_CCR5(dma) &= ~DMA_CCR5_CIRC;
- case 6:
- if (dma == DMA1) {
- DMA_CCR6(dma) |= DMA_CCR6_MEM2MEM;
- DMA_CCR6(dma) &= ~DMA_CCR6_CIRC;
- }
- case 7:
- if (dma == DMA1) {
- DMA_CCR7(dma) |= DMA_CCR7_MEM2MEM;
- DMA_CCR7(dma) &= ~DMA_CCR7_CIRC;
- }
- }
+ /* Disable channel. */
+ DMA_CCR(dma, channel) &= ~DMA_CCR_EN;
+ /* Reset config bits. */
+ DMA_CCR(dma, channel) = 0;
+ /* Reset data transfer number. */
+ DMA_CNDTR(dma, channel) = 0;
+ /* Reset peripheral address. */
+ DMA_CPAR(dma, channel) = 0;
+ /* Reset memory address. */
+ DMA_CMAR(dma, channel) = 0;
+ /* Reset interrupt flags. */
+ DMA_IFCR(dma) |= DMA_IFCR_CIF(channel);
}
-void dma_set_priority(u32 dma, u8 channel, u8 prio)
+void dma_enable_mem2mem_mode(u32 dma, u8 channel)
{
- if (prio > 3)
- return;
+ DMA_CCR(dma, channel) |= DMA_CCR_MEM2MEM;
+ DMA_CCR(dma, channel) &= ~DMA_CCR_CIRC;
+}
- switch (channel) {
- case 1:
- DMA_CCR1(dma) &= ~(0x3 << DMA_CCR1_PL_LSB);
- DMA_CCR1(dma) |= (prio << DMA_CCR1_PL_LSB);
- case 2:
- DMA_CCR2(dma) &= ~(0x3 << DMA_CCR2_PL_LSB);
- DMA_CCR2(dma) |= (prio << DMA_CCR2_PL_LSB);
- case 3:
- DMA_CCR3(dma) &= ~(0x3 << DMA_CCR3_PL_LSB);
- DMA_CCR3(dma) |= (prio << DMA_CCR3_PL_LSB);
- case 4:
- DMA_CCR4(dma) &= ~(0x3 << DMA_CCR4_PL_LSB);
- DMA_CCR4(dma) |= (prio << DMA_CCR4_PL_LSB);
- case 5:
- DMA_CCR5(dma) &= ~(0x3 << DMA_CCR5_PL_LSB);
- DMA_CCR5(dma) |= (prio << DMA_CCR5_PL_LSB);
- case 6:
- if (dma == DMA1) {
- DMA_CCR6(dma) &= ~(0x3 << DMA_CCR6_PL_LSB);
- DMA_CCR6(dma) |= (prio << DMA_CCR6_PL_LSB);
- }
- case 7:
- if (dma == DMA1) {
- DMA_CCR7(dma) &= ~(0x3 << DMA_CCR7_PL_LSB);
- DMA_CCR7(dma) |= (prio << DMA_CCR7_PL_LSB);
- }
- }
+void dma_set_priority(u32 dma, u8 channel, u32 prio)
+{
+ DMA_CCR(dma, channel) &= ~(DMA_CCR_PL_MASK);
+ DMA_CCR(dma, channel) |= prio;
}
-void dma_set_memory_size(u32 dma, u8 channel, u8 mem_size)
+void dma_set_memory_size(u32 dma, u8 channel, u32 mem_size)
{
- if (mem_size > 2)
- return;
- switch (channel) {
- case 1:
- DMA_CCR1(dma) &= ~(0x3 << DMA_CCR1_MSIZE_LSB);
- DMA_CCR1(dma) |= (mem_size << DMA_CCR1_MSIZE_LSB);
- case 2:
- DMA_CCR2(dma) &= ~(0x3 << DMA_CCR2_MSIZE_LSB);
- DMA_CCR2(dma) |= (mem_size << DMA_CCR2_MSIZE_LSB);
- case 3:
- DMA_CCR3(dma) &= ~(0x3 << DMA_CCR3_MSIZE_LSB);
- DMA_CCR3(dma) |= (mem_size << DMA_CCR3_MSIZE_LSB);
- case 4:
- DMA_CCR4(dma) &= ~(0x3 << DMA_CCR4_MSIZE_LSB);
- DMA_CCR4(dma) |= (mem_size << DMA_CCR4_MSIZE_LSB);
- case 5:
- DMA_CCR5(dma) &= ~(0x3 << DMA_CCR5_MSIZE_LSB);
- DMA_CCR5(dma) |= (mem_size << DMA_CCR5_MSIZE_LSB);
- case 6:
- if (dma == DMA1) {
- DMA_CCR6(dma) &= ~(0x3 << DMA_CCR6_MSIZE_LSB);
- DMA_CCR6(dma) |= (mem_size << DMA_CCR6_MSIZE_LSB);
- }
- case 7:
- if (dma == DMA1) {
- DMA_CCR7(dma) &= ~(0x3 << DMA_CCR7_MSIZE_LSB);
- DMA_CCR7(dma) |= (mem_size << DMA_CCR7_MSIZE_LSB);
- }
- }
+ DMA_CCR(dma, channel) &= ~(DMA_CCR_MSIZE_MASK);
+ DMA_CCR(dma, channel) |= mem_size;
}
-void dma_set_peripheral_size(u32 dma, u8 channel, u8 peripheral_size)
+void dma_set_peripheral_size(u32 dma, u8 channel, u32 peripheral_size)
{
- if (peripheral_size > 2)
- return;
-
- switch (channel) {
- case 1:
- DMA_CCR1(dma) &= ~(0x3 << DMA_CCR1_PSIZE_LSB);
- DMA_CCR1(dma) |= (peripheral_size << DMA_CCR1_PSIZE_LSB);
- case 2:
- DMA_CCR2(dma) &= ~(0x3 << DMA_CCR2_PSIZE_LSB);
- DMA_CCR2(dma) |= (peripheral_size << DMA_CCR2_PSIZE_LSB);
- case 3:
- DMA_CCR3(dma) &= ~(0x3 << DMA_CCR3_PSIZE_LSB);
- DMA_CCR3(dma) |= (peripheral_size << DMA_CCR3_PSIZE_LSB);
- case 4:
- DMA_CCR4(dma) &= ~(0x3 << DMA_CCR4_PSIZE_LSB);
- DMA_CCR4(dma) |= (peripheral_size << DMA_CCR4_PSIZE_LSB);
- case 5:
- DMA_CCR5(dma) &= ~(0x3 << DMA_CCR5_PSIZE_LSB);
- DMA_CCR5(dma) |= (peripheral_size << DMA_CCR5_PSIZE_LSB);
- case 6:
- if (dma == DMA1) {
- DMA_CCR6(dma) &= ~(0x3 << DMA_CCR6_PSIZE_LSB);
- DMA_CCR6(dma) |=
- (peripheral_size << DMA_CCR6_PSIZE_LSB);
- }
- case 7:
- if (dma == DMA1) {
- DMA_CCR7(dma) &= ~(0x3 << DMA_CCR7_PSIZE_LSB);
- DMA_CCR7(dma) |=
- (peripheral_size << DMA_CCR7_PSIZE_LSB);
- }
- }
+ DMA_CCR(dma, channel) &= ~(DMA_CCR_PSIZE_MASK);
+ DMA_CCR(dma, channel) |= peripheral_size;
}
void dma_enable_memory_increment_mode(u32 dma, u8 channel)
{
- switch (channel) {
- case 1:
- DMA_CCR1(dma) |= DMA_CCR1_MINC;
- case 2:
- DMA_CCR2(dma) |= DMA_CCR2_MINC;
- case 3:
- DMA_CCR3(dma) |= DMA_CCR3_MINC;
- case 4:
- DMA_CCR4(dma) |= DMA_CCR4_MINC;
- case 5:
- DMA_CCR5(dma) |= DMA_CCR5_MINC;
- case 6:
- if (dma == DMA1)
- DMA_CCR6(dma) |= DMA_CCR6_MINC;
- case 7:
- if (dma == DMA1)
- DMA_CCR7(dma) |= DMA_CCR7_MINC;
- }
+ DMA_CCR(dma, channel) |= DMA_CCR_MINC;
}
void dma_enable_peripheral_increment_mode(u32 dma, u8 channel)
{
- switch (channel) {
- case 1:
- DMA_CCR1(dma) |= DMA_CCR1_PINC;
- case 2:
- DMA_CCR2(dma) |= DMA_CCR2_PINC;
- case 3:
- DMA_CCR3(dma) |= DMA_CCR3_PINC;
- case 4:
- DMA_CCR4(dma) |= DMA_CCR4_PINC;
- case 5:
- DMA_CCR5(dma) |= DMA_CCR5_PINC;
- case 6:
- if (dma == DMA1)
- DMA_CCR6(dma) |= DMA_CCR6_PINC;
- case 7:
- if (dma == DMA1)
- DMA_CCR7(dma) |= DMA_CCR7_PINC;
- }
+ DMA_CCR(dma, channel) |= DMA_CCR_PINC;
}
void dma_enable_circular_mode(u32 dma, u8 channel)
{
- switch (channel) {
- case 1:
- DMA_CCR1(dma) |= DMA_CCR1_CIRC;
- DMA_CCR1(dma) &= ~DMA_CCR1_MEM2MEM;
- case 2:
- DMA_CCR2(dma) |= DMA_CCR2_CIRC;
- DMA_CCR2(dma) &= ~DMA_CCR2_MEM2MEM;
- case 3:
- DMA_CCR3(dma) |= DMA_CCR3_CIRC;
- DMA_CCR3(dma) &= ~DMA_CCR3_MEM2MEM;
- case 4:
- DMA_CCR4(dma) |= DMA_CCR4_CIRC;
- DMA_CCR4(dma) &= ~DMA_CCR4_MEM2MEM;
- case 5:
- DMA_CCR5(dma) |= DMA_CCR5_CIRC;
- DMA_CCR5(dma) &= ~DMA_CCR5_MEM2MEM;
- case 6:
- if (dma == DMA1) {
- DMA_CCR6(dma) |= DMA_CCR6_CIRC;
- DMA_CCR6(dma) &= ~DMA_CCR6_MEM2MEM;
- }
- case 7:
- if (dma == DMA1) {
- DMA_CCR7(dma) |= DMA_CCR7_CIRC;
- DMA_CCR7(dma) &= ~DMA_CCR7_MEM2MEM;
- }
- }
+ DMA_CCR(dma, channel) |= DMA_CCR_CIRC;
+ DMA_CCR(dma, channel) &= ~DMA_CCR_MEM2MEM;
}
void dma_set_read_from_peripheral(u32 dma, u8 channel)
{
- switch (channel) {
- case 1:
- DMA_CCR1(dma) &= ~DMA_CCR1_DIR;
- case 2:
- DMA_CCR2(dma) &= ~DMA_CCR2_DIR;
- case 3:
- DMA_CCR3(dma) &= ~DMA_CCR3_DIR;
- case 4:
- DMA_CCR4(dma) &= ~DMA_CCR4_DIR;
- case 5:
- DMA_CCR5(dma) &= ~DMA_CCR5_DIR;
- case 6:
- if (dma == DMA1)
- DMA_CCR6(dma) &= ~DMA_CCR6_DIR;
- case 7:
- if (dma == DMA1)
- DMA_CCR7(dma) &= ~DMA_CCR7_DIR;
- }
+ DMA_CCR(dma, channel) &= ~DMA_CCR_DIR;
}
void dma_set_read_from_memory(u32 dma, u8 channel)
{
- switch (channel) {
- case 1:
- DMA_CCR1(dma) |= DMA_CCR1_DIR;
- case 2:
- DMA_CCR2(dma) |= DMA_CCR2_DIR;
- case 3:
- DMA_CCR3(dma) |= DMA_CCR3_DIR;
- case 4:
- DMA_CCR4(dma) |= DMA_CCR4_DIR;
- case 5:
- DMA_CCR5(dma) |= DMA_CCR5_DIR;
- case 6:
- if (dma == DMA1)
- DMA_CCR6(dma) |= DMA_CCR6_DIR;
- case 7:
- if (dma == DMA1)
- DMA_CCR7(dma) |= DMA_CCR7_DIR;
- }
+ DMA_CCR(dma, channel) |= DMA_CCR_DIR;
}
void dma_enable_transfer_error_interrupt(u32 dma, u8 channel)
{
- switch (channel) {
- case 1:
- DMA_CCR1(dma) |= DMA_CCR1_TEIE;
- case 2:
- DMA_CCR2(dma) |= DMA_CCR2_TEIE;
- case 3:
- DMA_CCR3(dma) |= DMA_CCR3_TEIE;
- case 4:
- DMA_CCR4(dma) |= DMA_CCR4_TEIE;
- case 5:
- DMA_CCR5(dma) |= DMA_CCR5_TEIE;
- case 6:
- if (dma == DMA1)
- DMA_CCR6(dma) |= DMA_CCR6_TEIE;
- case 7:
- if (dma == DMA1)
- DMA_CCR7(dma) |= DMA_CCR7_TEIE;
- }
+ DMA_CCR(dma, channel) |= DMA_CCR_TEIE;
}
void dma_disable_transfer_error_interrupt(u32 dma, u8 channel)
{
- switch (channel) {
- case 1:
- DMA_CCR1(dma) &= ~DMA_CCR1_TEIE;
- case 2:
- DMA_CCR2(dma) &= ~DMA_CCR2_TEIE;
- case 3:
- DMA_CCR3(dma) &= ~DMA_CCR3_TEIE;
- case 4:
- DMA_CCR4(dma) &= ~DMA_CCR4_TEIE;
- case 5:
- DMA_CCR5(dma) &= ~DMA_CCR5_TEIE;
- case 6:
- if (dma == DMA1)
- DMA_CCR6(dma) &= ~DMA_CCR6_TEIE;
- case 7:
- if (dma == DMA1)
- DMA_CCR7(dma) &= ~DMA_CCR7_TEIE;
- }
+ DMA_CCR(dma, channel) &= ~DMA_CCR_TEIE;
}
void dma_enable_half_transfer_interrupt(u32 dma, u8 channel)
{
- switch (channel) {
- case 1:
- DMA_CCR1(dma) |= DMA_CCR1_HTIE;
- case 2:
- DMA_CCR2(dma) |= DMA_CCR2_HTIE;
- case 3:
- DMA_CCR3(dma) |= DMA_CCR3_HTIE;
- case 4:
- DMA_CCR4(dma) |= DMA_CCR4_HTIE;
- case 5:
- DMA_CCR5(dma) |= DMA_CCR5_HTIE;
- case 6:
- if (dma == DMA1)
- DMA_CCR6(dma) |= DMA_CCR6_HTIE;
- case 7:
- if (dma == DMA1)
- DMA_CCR7(dma) |= DMA_CCR7_HTIE;
- }
+ DMA_CCR(dma, channel) |= DMA_CCR_HTIE;
}
void dma_disable_half_transfer_interrupt(u32 dma, u8 channel)
{
- switch (channel) {
- case 1:
- DMA_CCR1(dma) &= ~DMA_CCR1_HTIE;
- case 2:
- DMA_CCR2(dma) &= ~DMA_CCR2_HTIE;
- case 3:
- DMA_CCR3(dma) &= ~DMA_CCR3_HTIE;
- case 4:
- DMA_CCR4(dma) &= ~DMA_CCR4_HTIE;
- case 5:
- DMA_CCR5(dma) &= ~DMA_CCR5_HTIE;
- case 6:
- if (dma == DMA1)
- DMA_CCR6(dma) &= ~DMA_CCR6_HTIE;
- case 7:
- if (dma == DMA1)
- DMA_CCR7(dma) &= ~DMA_CCR7_HTIE;
- }
+ DMA_CCR(dma, channel) &= ~DMA_CCR_HTIE;
}
void dma_enable_transfer_complete_interrupt(u32 dma, u8 channel)
{
- switch (channel) {
- case 1:
- DMA_CCR1(dma) |= DMA_CCR1_TCIE;
- case 2:
- DMA_CCR2(dma) |= DMA_CCR2_TCIE;
- case 3:
- DMA_CCR3(dma) |= DMA_CCR3_TCIE;
- case 4:
- DMA_CCR4(dma) |= DMA_CCR4_TCIE;
- case 5:
- DMA_CCR5(dma) |= DMA_CCR5_TCIE;
- case 6:
- if (dma == DMA1)
- DMA_CCR6(dma) |= DMA_CCR6_TCIE;
- case 7:
- if (dma == DMA1)
- DMA_CCR7(dma) |= DMA_CCR7_TCIE;
- }
+ DMA_CCR(dma, channel) |= DMA_CCR_TCIE;
}
void dma_disable_transfer_complete_interrupt(u32 dma, u8 channel)
{
- switch (channel) {
- case 1:
- DMA_CCR1(dma) &= ~DMA_CCR1_TCIE;
- case 2:
- DMA_CCR2(dma) &= ~DMA_CCR2_TCIE;
- case 3:
- DMA_CCR3(dma) &= ~DMA_CCR3_TCIE;
- case 4:
- DMA_CCR4(dma) &= ~DMA_CCR4_TCIE;
- case 5:
- DMA_CCR5(dma) &= ~DMA_CCR5_TCIE;
- case 6:
- if (dma == DMA1)
- DMA_CCR6(dma) &= ~DMA_CCR6_TCIE;
- case 7:
- if (dma == DMA1)
- DMA_CCR7(dma) &= ~DMA_CCR7_TCIE;
- }
+ DMA_CCR(dma, channel) &= ~DMA_CCR_TCIE;
}
void dma_enable_channel(u32 dma, u8 channel)
{
- switch (channel) {
- case 1:
- DMA_CCR1(dma) |= DMA_CCR1_EN;
- case 2:
- DMA_CCR2(dma) |= DMA_CCR2_EN;
- case 3:
- DMA_CCR3(dma) |= DMA_CCR3_EN;
- case 4:
- DMA_CCR4(dma) |= DMA_CCR4_EN;
- case 5:
- DMA_CCR5(dma) |= DMA_CCR5_EN;
- case 6:
- if (dma == DMA1)
- DMA_CCR6(dma) |= DMA_CCR6_EN;
- case 7:
- if (dma == DMA1)
- DMA_CCR7(dma) |= DMA_CCR7_EN;
- }
+ DMA_CCR(dma, channel) |= DMA_CCR_EN;
}
void dma_disable_channel(u32 dma, u8 channel)
{
- switch (channel) {
- case 1:
- DMA_CCR1(dma) &= ~DMA_CCR1_EN;
- case 2:
- DMA_CCR2(dma) &= ~DMA_CCR2_EN;
- case 3:
- DMA_CCR3(dma) &= ~DMA_CCR3_EN;
- case 4:
- DMA_CCR4(dma) &= ~DMA_CCR4_EN;
- case 5:
- DMA_CCR5(dma) &= ~DMA_CCR5_EN;
- case 6:
- if (dma == DMA1)
- DMA_CCR6(dma) &= ~DMA_CCR6_EN;
- case 7:
- if (dma == DMA1)
- DMA_CCR7(dma) &= ~DMA_CCR7_EN;
- }
+ DMA_CCR(dma, channel) &= ~DMA_CCR_EN;
}
void dma_set_peripheral_address(u32 dma, u8 channel, u32 address)
{
- switch (channel) {
- case 1:
- DMA_CPAR1(dma) = (u32) address;
- case 2:
- DMA_CPAR2(dma) = (u32) address;
- case 3:
- DMA_CPAR3(dma) = (u32) address;
- case 4:
- DMA_CPAR4(dma) = (u32) address;
- case 5:
- DMA_CPAR5(dma) = (u32) address;
- case 6:
- if (dma == DMA1)
- DMA_CPAR6(dma) = (u32) address;
- case 7:
- if (dma == DMA1)
- DMA_CPAR7(dma) = (u32) address;
- }
+ DMA_CPAR(dma, channel) = (u32) address;
}
void dma_set_memory_address(u32 dma, u8 channel, u32 address)
{
- switch (channel) {
- case 1:
- DMA_CMAR1(dma) = (u32) address;
- case 2:
- DMA_CMAR2(dma) = (u32) address;
- case 3:
- DMA_CMAR3(dma) = (u32) address;
- case 4:
- DMA_CMAR4(dma) = (u32) address;
- case 5:
- DMA_CMAR5(dma) = (u32) address;
- case 6:
- if (dma == DMA1)
- DMA_CMAR6(dma) = (u32) address;
- case 7:
- if (dma == DMA1)
- DMA_CMAR7(dma) = (u32) address;
- }
+ DMA_CMAR(dma, channel) = (u32) address;
}
void dma_set_number_of_data(u32 dma, u8 channel, u16 number)
{
- switch (channel) {
- case 1:
- DMA_CNDTR1(dma) = number;
- case 2:
- DMA_CNDTR2(dma) = number;
- case 3:
- DMA_CNDTR3(dma) = number;
- case 4:
- DMA_CNDTR4(dma) = number;
- case 5:
- DMA_CNDTR5(dma) = number;
- case 6:
- if (dma == DMA1)
- DMA_CNDTR6(dma) = number;
- case 7:
- if (dma == DMA1)
- DMA_CNDTR7(dma) = number;
- }
+ DMA_CNDTR(dma, channel) = number;
}
diff --git a/lib/stm32/f1/ethernet.c b/lib/stm32/f1/ethernet.c
index 24864ea..c330609 100644
--- a/lib/stm32/f1/ethernet.c
+++ b/lib/stm32/f1/ethernet.c
@@ -3,18 +3,18 @@
*
* Copyright (C) 2010 Gareth McMullin <gareth@blacksphere.co.nz>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/stm32/f1/ethernet.h>
diff --git a/lib/stm32/f1/exti.c b/lib/stm32/f1/exti.c
index eec4157..ecb58b8 100644
--- a/lib/stm32/f1/exti.c
+++ b/lib/stm32/f1/exti.c
@@ -3,18 +3,18 @@
*
* Copyright (C) 2010 Mark Butler <mbutler@physics.otago.ac.nz>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/stm32/exti.h>
diff --git a/lib/stm32/f1/flash.c b/lib/stm32/f1/flash.c
index b8b3d52..232086c 100644
--- a/lib/stm32/f1/flash.c
+++ b/lib/stm32/f1/flash.c
@@ -4,18 +4,18 @@
* Copyright (C) 2010 Thomas Otto <tommi@viadmin.org>
* Copyright (C) 2010 Mark Butler <mbutler@physics.otago.ac.nz>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/stm32/f1/flash.h>
diff --git a/lib/stm32/f1/gpio.c b/lib/stm32/f1/gpio.c
index f6f3da6..4f7e663 100644
--- a/lib/stm32/f1/gpio.c
+++ b/lib/stm32/f1/gpio.c
@@ -3,18 +3,18 @@
*
* Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/*
diff --git a/lib/stm32/f1/libopencm3_stm32f1.ld b/lib/stm32/f1/libopencm3_stm32f1.ld
index 9fa128d..1dbc62a 100644
--- a/lib/stm32/f1/libopencm3_stm32f1.ld
+++ b/lib/stm32/f1/libopencm3_stm32f1.ld
@@ -3,18 +3,18 @@
*
* Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/* Generic linker script for STM32 targets using libopencm3. */
diff --git a/lib/stm32/f1/rcc.c b/lib/stm32/f1/rcc.c
index ce45832..8945e80 100644
--- a/lib/stm32/f1/rcc.c
+++ b/lib/stm32/f1/rcc.c
@@ -5,18 +5,18 @@
* Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
* Copyright (C) 2010 Thomas Otto <tommi@viadmin.org>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/stm32/f1/rcc.h>
diff --git a/lib/stm32/f1/rtc.c b/lib/stm32/f1/rtc.c
index d047bc3..0b7769e 100644
--- a/lib/stm32/f1/rtc.c
+++ b/lib/stm32/f1/rtc.c
@@ -4,18 +4,18 @@
* Copyright (C) 2010 Uwe Hermann <uwe@hermann-uwe.de>
* Copyright (C) 2010 Lord James <lordjames@y7mail.com>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/stm32/f1/rcc.h>
diff --git a/lib/stm32/f1/scb.c b/lib/stm32/f1/scb.c
index 8c3238c..e59134e 100644
--- a/lib/stm32/f1/scb.c
+++ b/lib/stm32/f1/scb.c
@@ -3,18 +3,18 @@
*
* Copyright (C) 2010 Gareth McMullin <gareth@blacksphere.co.nz>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/stm32/f1/scb.h>
diff --git a/lib/stm32/f1/timer.c b/lib/stm32/f1/timer.c
index 10c28e2..8c32670 100644
--- a/lib/stm32/f1/timer.c
+++ b/lib/stm32/f1/timer.c
@@ -3,18 +3,18 @@
*
* Copyright (C) 2010 Edward Cheeseman <evbuilder@users.sourceforge.org>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/*
diff --git a/lib/stm32/f1/vector.c b/lib/stm32/f1/vector.c
index 51135d5..fe61e29 100644
--- a/lib/stm32/f1/vector.c
+++ b/lib/stm32/f1/vector.c
@@ -3,18 +3,18 @@
*
* Copyright (C) 2010 Piotr Esden-Tempski <piotr@esden.net>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#define WEAK __attribute__ ((weak))
diff --git a/lib/stm32/f2/exti.c b/lib/stm32/f2/exti.c
index 3a12077..5280914 100644
--- a/lib/stm32/f2/exti.c
+++ b/lib/stm32/f2/exti.c
@@ -3,18 +3,18 @@
*
* Copyright (C) 2010 Mark Butler <mbutler@physics.otago.ac.nz>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/stm32/exti.h>
diff --git a/lib/stm32/f2/flash.c b/lib/stm32/f2/flash.c
index e9bc73e..6e2c64d 100644
--- a/lib/stm32/f2/flash.c
+++ b/lib/stm32/f2/flash.c
@@ -4,18 +4,18 @@
* Copyright (C) 2010 Thomas Otto <tommi@viadmin.org>
* Copyright (C) 2010 Mark Butler <mbutler@physics.otago.ac.nz>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/stm32/f2/flash.h>
diff --git a/lib/stm32/f2/gpio.c b/lib/stm32/f2/gpio.c
index 835eb91..7a38120 100644
--- a/lib/stm32/f2/gpio.c
+++ b/lib/stm32/f2/gpio.c
@@ -3,18 +3,18 @@
*
* Copyright (C) 2011 Fergus Noble <fergusnoble@gmail.com>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/stm32/f2/gpio.h>
diff --git a/lib/stm32/f2/libopencm3_stm32f2.ld b/lib/stm32/f2/libopencm3_stm32f2.ld
index 9fa128d..1dbc62a 100644
--- a/lib/stm32/f2/libopencm3_stm32f2.ld
+++ b/lib/stm32/f2/libopencm3_stm32f2.ld
@@ -3,18 +3,18 @@
*
* Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/* Generic linker script for STM32 targets using libopencm3. */
diff --git a/lib/stm32/f2/rcc.c b/lib/stm32/f2/rcc.c
index 2eab47b..9461a24 100644
--- a/lib/stm32/f2/rcc.c
+++ b/lib/stm32/f2/rcc.c
@@ -5,18 +5,18 @@
* Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
* Copyright (C) 2010 Thomas Otto <tommi@viadmin.org>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/stm32/f2/rcc.h>
diff --git a/lib/stm32/f2/scb.c b/lib/stm32/f2/scb.c
index 33088f3..abb7b44 100644
--- a/lib/stm32/f2/scb.c
+++ b/lib/stm32/f2/scb.c
@@ -3,18 +3,18 @@
*
* Copyright (C) 2010 Gareth McMullin <gareth@blacksphere.co.nz>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/stm32/f2/scb.h>
diff --git a/lib/stm32/f2/timer.c b/lib/stm32/f2/timer.c
index f3782a9..3cd5e91 100644
--- a/lib/stm32/f2/timer.c
+++ b/lib/stm32/f2/timer.c
@@ -4,18 +4,18 @@
* Copyright (C) 2010 Edward Cheeseman <evbuilder@users.sourceforge.org>
* Copyright (C) 2011 Stephen Caudle <scaudle@doceme.com>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/*
diff --git a/lib/stm32/f2/vector.c b/lib/stm32/f2/vector.c
index ca4c66a..1c901da 100644
--- a/lib/stm32/f2/vector.c
+++ b/lib/stm32/f2/vector.c
@@ -4,18 +4,18 @@
* Copyright (C) 2010 Piotr Esden-Tempski <piotr@esden.net>
* Copyright (C) 2011 Fergus Noble <fergusnoble@gmail.com>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#define WEAK __attribute__ ((weak))
diff --git a/lib/stm32/f4/exti.c b/lib/stm32/f4/exti.c
index 586b66c..155c21f 100644
--- a/lib/stm32/f4/exti.c
+++ b/lib/stm32/f4/exti.c
@@ -3,18 +3,18 @@
*
* Copyright (C) 2010 Mark Butler <mbutler@physics.otago.ac.nz>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/stm32/exti.h>
diff --git a/lib/stm32/f4/flash.c b/lib/stm32/f4/flash.c
index 3751af3..a9fe06c 100644
--- a/lib/stm32/f4/flash.c
+++ b/lib/stm32/f4/flash.c
@@ -4,18 +4,18 @@
* Copyright (C) 2010 Thomas Otto <tommi@viadmin.org>
* Copyright (C) 2010 Mark Butler <mbutler@physics.otago.ac.nz>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/stm32/f4/flash.h>
diff --git a/lib/stm32/f4/gpio.c b/lib/stm32/f4/gpio.c
index e8b2dac..dea3720 100644
--- a/lib/stm32/f4/gpio.c
+++ b/lib/stm32/f4/gpio.c
@@ -3,18 +3,18 @@
*
* Copyright (C) 2011 Fergus Noble <fergusnoble@gmail.com>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/stm32/f4/gpio.h>
diff --git a/lib/stm32/f4/libopencm3_stm32f4.ld b/lib/stm32/f4/libopencm3_stm32f4.ld
index 9fa128d..1dbc62a 100644
--- a/lib/stm32/f4/libopencm3_stm32f4.ld
+++ b/lib/stm32/f4/libopencm3_stm32f4.ld
@@ -3,18 +3,18 @@
*
* Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/* Generic linker script for STM32 targets using libopencm3. */
diff --git a/lib/stm32/f4/pwr.c b/lib/stm32/f4/pwr.c
index c7cdd6a..7be34f4 100644
--- a/lib/stm32/f4/pwr.c
+++ b/lib/stm32/f4/pwr.c
@@ -3,18 +3,18 @@
*
* Copyright (C) 2011 Stephen Caudle <scaudle@doceme.com>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/stm32/f4/pwr.h>
diff --git a/lib/stm32/f4/rcc.c b/lib/stm32/f4/rcc.c
index 1a5d868..6294ff7 100644
--- a/lib/stm32/f4/rcc.c
+++ b/lib/stm32/f4/rcc.c
@@ -5,18 +5,18 @@
* Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
* Copyright (C) 2010 Thomas Otto <tommi@viadmin.org>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/stm32/f4/rcc.h>
diff --git a/lib/stm32/f4/scb.c b/lib/stm32/f4/scb.c
index 30510f8..cbf4d53 100644
--- a/lib/stm32/f4/scb.c
+++ b/lib/stm32/f4/scb.c
@@ -3,18 +3,18 @@
*
* Copyright (C) 2010 Gareth McMullin <gareth@blacksphere.co.nz>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/stm32/f4/scb.h>
diff --git a/lib/stm32/f4/timer.c b/lib/stm32/f4/timer.c
index 59a0018..bb7b0e7 100644
--- a/lib/stm32/f4/timer.c
+++ b/lib/stm32/f4/timer.c
@@ -4,18 +4,18 @@
* Copyright (C) 2010 Edward Cheeseman <evbuilder@users.sourceforge.org>
* Copyright (C) 2011 Stephen Caudle <scaudle@doceme.com>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/*
diff --git a/lib/stm32/f4/vector.c b/lib/stm32/f4/vector.c
index ca4c66a..1c901da 100644
--- a/lib/stm32/f4/vector.c
+++ b/lib/stm32/f4/vector.c
@@ -4,18 +4,18 @@
* Copyright (C) 2010 Piotr Esden-Tempski <piotr@esden.net>
* Copyright (C) 2011 Fergus Noble <fergusnoble@gmail.com>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#define WEAK __attribute__ ((weak))
diff --git a/lib/stm32/i2c.c b/lib/stm32/i2c.c
index 41670c3..87d9061 100644
--- a/lib/stm32/i2c.c
+++ b/lib/stm32/i2c.c
@@ -3,18 +3,18 @@
*
* Copyright (C) 2010 Thomas Otto <tommi@viadmin.org>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/stm32/i2c.h>
diff --git a/lib/stm32/nvic.c b/lib/stm32/nvic.c
index 1c7f4b9..cd823e1 100644
--- a/lib/stm32/nvic.c
+++ b/lib/stm32/nvic.c
@@ -4,18 +4,18 @@
* Copyright (C) 2010 Thomas Otto <tommi@viadmin.org>
* Copyright (C) 2012 Fergus Noble <fergusnoble@gmail.com>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/stm32/nvic.h>
diff --git a/lib/stm32/spi.c b/lib/stm32/spi.c
index 87392c0..af093ad 100644
--- a/lib/stm32/spi.c
+++ b/lib/stm32/spi.c
@@ -3,21 +3,30 @@
*
* Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/stm32/spi.h>
+#if defined(STM32F1)
+# include <libopencm3/stm32/f1/rcc.h>
+#elif defined(STM32F2)
+# include <libopencm3/stm32/f2/rcc.h>
+#elif defined(STM32F4)
+# include <libopencm3/stm32/f4/rcc.h>
+#else
+# error "stm32 family not defined."
+#endif
/*
* SPI and I2S code.
@@ -32,6 +41,24 @@
* reg16 = spi_read(SPI1); // 16-bit read
*/
+void spi_reset(u32 spi_peripheral)
+{
+ switch (spi_peripheral) {
+ case SPI1:
+ rcc_peripheral_reset(&RCC_APB2RSTR, RCC_APB2RSTR_SPI1RST);
+ rcc_peripheral_clear_reset(&RCC_APB2RSTR, RCC_APB2RSTR_SPI1RST);
+ break;
+ case SPI2:
+ rcc_peripheral_reset(&RCC_APB1RSTR, RCC_APB1RSTR_SPI2RST);
+ rcc_peripheral_clear_reset(&RCC_APB1RSTR, RCC_APB1RSTR_SPI2RST);
+ break;
+ case SPI3:
+ rcc_peripheral_reset(&RCC_APB1RSTR, RCC_APB1RSTR_SPI3RST);
+ rcc_peripheral_clear_reset(&RCC_APB1RSTR, RCC_APB1RSTR_SPI3RST);
+ break;
+ }
+}
+
int spi_init_master(u32 spi, u32 br, u32 cpol, u32 cpha, u32 dff, u32 lsbfirst)
{
u32 reg32 = 0;
diff --git a/lib/stm32/systick.c b/lib/stm32/systick.c
index 2b7886b..c49d11d 100644
--- a/lib/stm32/systick.c
+++ b/lib/stm32/systick.c
@@ -3,18 +3,18 @@
*
* Copyright (C) 2010 Thomas Otto <tommi@viadmin.org>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/stm32/systick.h>
diff --git a/lib/stm32/usart.c b/lib/stm32/usart.c
index 7ce0ddc..1d0ea9b 100644
--- a/lib/stm32/usart.c
+++ b/lib/stm32/usart.c
@@ -3,18 +3,18 @@
*
* Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/stm32/usart.h>
diff --git a/lib/usb/usb.c b/lib/usb/usb.c
index abb870e..1ebb6ec 100644
--- a/lib/usb/usb.c
+++ b/lib/usb/usb.c
@@ -3,18 +3,18 @@
*
* Copyright (C) 2010 Gareth McMullin <gareth@blacksphere.co.nz>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <string.h>
diff --git a/lib/usb/usb_control.c b/lib/usb/usb_control.c
index 09e7976..3dd0857 100644
--- a/lib/usb/usb_control.c
+++ b/lib/usb/usb_control.c
@@ -3,18 +3,18 @@
*
* Copyright (C) 2010 Gareth McMullin <gareth@blacksphere.co.nz>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
diff --git a/lib/usb/usb_f103.c b/lib/usb/usb_f103.c
index 972ceda..22db8cc 100644
--- a/lib/usb/usb_f103.c
+++ b/lib/usb/usb_f103.c
@@ -3,18 +3,18 @@
*
* Copyright (C) 2010 Gareth McMullin <gareth@blacksphere.co.nz>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libopencm3/stm32/f1/rcc.h>
diff --git a/lib/usb/usb_f107.c b/lib/usb/usb_f107.c
index 1cd3eec..a5a4a6c 100644
--- a/lib/usb/usb_f107.c
+++ b/lib/usb/usb_f107.c
@@ -3,18 +3,18 @@
*
* Copyright (C) 2011 Gareth McMullin <gareth@blacksphere.co.nz>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <string.h>
@@ -386,4 +386,4 @@ static void stm32f107_disconnect(bool disconnected)
} else {
OTG_FS_DCTL &= ~OTG_FS_DCTL_SDIS;
}
-} \ No newline at end of file
+}
diff --git a/lib/usb/usb_private.h b/lib/usb/usb_private.h
index 5b367fb..a1e5e4c 100644
--- a/lib/usb/usb_private.h
+++ b/lib/usb/usb_private.h
@@ -3,18 +3,18 @@
*
* Copyright (C) 2010 Gareth McMullin <gareth@blacksphere.co.nz>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __USB_PRIVATE_H
diff --git a/lib/usb/usb_standard.c b/lib/usb/usb_standard.c
index 455d3e7..2d7c619 100644
--- a/lib/usb/usb_standard.c
+++ b/lib/usb/usb_standard.c
@@ -3,18 +3,18 @@
*
* Copyright (C) 2010 Gareth McMullin <gareth@blacksphere.co.nz>
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <string.h>