aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile10
-rw-r--r--include/libopencm3/dispatch/nvic.h4
-rw-r--r--include/libopencm3/lpc13xx/irq.yaml62
-rw-r--r--include/libopencm3/lpc17xx/irq.yaml39
-rw-r--r--include/libopencm3/stm32/exti.h3
-rw-r--r--include/libopencm3/stm32/f1/adc.h12
-rw-r--r--lib/dispatch/vector_nvic.c4
-rw-r--r--lib/stm32/f4/exti.c6
-rwxr-xr-xscripts/irq2nvic_h19
9 files changed, 157 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 32c3925..6cb4b11 100644
--- a/Makefile
+++ b/Makefile
@@ -45,6 +45,12 @@ generatedheaders:
./scripts/irq2nvic_h $$yamlfile ; \
done
+cleanheaders:
+ @printf " CLEANING HEADERS\n"
+ $(Q)for yamlfile in `find -name 'irq.yaml'`; do \
+ ./scripts/irq2nvic_h --remove $$yamlfile ; \
+ done
+
lib: generatedheaders
$(Q)for i in $(addprefix $@/,$(TARGETS)); do \
if [ -d $$i ]; then \
@@ -80,7 +86,7 @@ install: lib
doc:
$(Q)$(MAKE) -C doc doc
-clean:
+clean: cleanheaders
$(Q)for i in $(addprefix lib/,$(TARGETS)) \
$(addsuffix /*/*,$(addprefix examples/,$(TARGETS))); do \
if [ -d $$i ]; then \
@@ -91,5 +97,5 @@ clean:
@printf " CLEAN doxygen\n"
$(Q)$(MAKE) -C doc clean
-.PHONY: build lib examples install doc clean
+.PHONY: build lib examples install doc clean generatedheaders cleanheaders
diff --git a/include/libopencm3/dispatch/nvic.h b/include/libopencm3/dispatch/nvic.h
index 2ae04d7..c797d40 100644
--- a/include/libopencm3/dispatch/nvic.h
+++ b/include/libopencm3/dispatch/nvic.h
@@ -14,6 +14,10 @@
#elif defined(EFM32GG)
# include <libopencm3/efm32/efm32gg/nvic.h>
+#elif defined(LPC13XX)
+# include <libopencm3/lpc13xx/nvic.h>
+#elif defined(LPC17XX)
+# include <libopencm3/lpc17xx/nvic.h>
#elif defined(LPC43XX)
# include <libopencm3/lpc43xx/nvic.h>
diff --git a/include/libopencm3/lpc13xx/irq.yaml b/include/libopencm3/lpc13xx/irq.yaml
new file mode 100644
index 0000000..5a372db
--- /dev/null
+++ b/include/libopencm3/lpc13xx/irq.yaml
@@ -0,0 +1,62 @@
+includeguard: LIBOPENCM3_LPC13xx_NVIC_H
+partname_humanreadable: LPC 13xx series
+partname_doxygen: LPC13xx
+irqs:
+ 0: pio0_0
+ 1: pio0_1
+ 2: pio0_2
+ 3: pio0_3
+ 4: pio0_4
+ 5: pio0_5
+ 6: pio0_6
+ 7: pio0_7
+ 8: pio0_8
+ 9: pio0_9
+ 10: pio0_10
+ 11: pio0_11
+ 12: pio1_0
+ 13: pio1_1
+ 14: pio1_2
+ 15: pio1_3
+ 16: pio1_4
+ 17: pio1_5
+ 18: pio1_6
+ 19: pio1_7
+ 20: pio1_8
+ 21: pio1_9
+ 22: pio1_10
+ 23: pio1_11
+ 24: pio2_0
+ 25: pio2_1
+ 26: pio2_2
+ 27: pio2_3
+ 28: pio2_4
+ 29: pio2_5
+ 30: pio2_6
+ 31: pio2_7
+ 32: pio2_8
+ 33: pio2_9
+ 34: pio2_10
+ 35: pio2_11
+ 36: pio3_0
+ 37: pio3_1
+ 38: pio3_2
+ 39: pio3_3
+ 40: i2c0
+ 41: ct16b0
+ 42: ct16b1
+ 43: ct32b0
+ 44: ct32b1
+ 45: ssp0
+ 46: uart
+ 47: usb
+ 48: usb_fiq
+ 49: adc
+ 50: wdt
+ 51: bod
+# 52: reserved
+ 53: pio3
+ 54: pio2
+ 55: pio1
+ 56: pio0
+ 56: ssp1
diff --git a/include/libopencm3/lpc17xx/irq.yaml b/include/libopencm3/lpc17xx/irq.yaml
new file mode 100644
index 0000000..faa140f
--- /dev/null
+++ b/include/libopencm3/lpc17xx/irq.yaml
@@ -0,0 +1,39 @@
+includeguard: LIBOPENCM3_LPC17xx_NVIC_H
+partname_humanreadable: LPC 17xx series
+partname_doxygen: LPC17xx
+irqs:
+ 0: wdt
+ 1: timer0
+ 2: timer1
+ 3: timer2
+ 4: timer3
+ 5: uart0
+ 6: uart1
+ 7: uart2
+ 8: uart3
+ 9: pwm
+ 10: i2c0
+ 11: i2c1
+ 12: i2c2
+ 13: spi
+ 14: ssp0
+ 15: ssp1
+ 16: pll0
+ 17: rtc
+ 18: eint0
+ 19: eint1
+ 20: eint2
+ 21: eint3
+ 22: adc
+ 23: bod
+ 24: usb
+ 25: can
+ 26: gpdma
+ 27: i2s
+ 28: ethernet
+ 29: rit
+ 30: motor_pwm
+ 31: qei
+ 32: pll1
+ 33: usb_act
+ 34: can_act
diff --git a/include/libopencm3/stm32/exti.h b/include/libopencm3/stm32/exti.h
index 7645825..48065b9 100644
--- a/include/libopencm3/stm32/exti.h
+++ b/include/libopencm3/stm32/exti.h
@@ -53,6 +53,9 @@
#define EXTI17 (1 << 17)
#define EXTI18 (1 << 18)
#define EXTI19 (1 << 19)
+#define EXTI20 (1 << 20)
+#define EXTI21 (1 << 21)
+#define EXTI22 (1 << 22)
/* Trigger types */
typedef enum trigger_e {
diff --git a/include/libopencm3/stm32/f1/adc.h b/include/libopencm3/stm32/f1/adc.h
index aa54bdf..95c3732 100644
--- a/include/libopencm3/stm32/f1/adc.h
+++ b/include/libopencm3/stm32/f1/adc.h
@@ -708,8 +708,12 @@ void adc_calibration(u32 adc);
void adc_set_continuous_conversion_mode(u32 adc);
void adc_set_single_conversion_mode(u32 adc);
#ifdef __GNUC__
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR_ > 4)
void adc_on(u32 adc) __attribute__ ((deprecated ("will be removed in the first release")));
#else
+void adc_on(u32 adc) __attribute__ ((deprecated));
+#endif
+#else
void adc_on(u32 adc);
#endif
void adc_off(u32 adc);
@@ -721,11 +725,19 @@ void adc_set_regular_sequence(u32 adc, u8 length, u8 channel[]);
void adc_set_injected_sequence(u32 adc, u8 length, u8 channel[]);
#ifdef __GNUC__
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR_ > 4)
void adc_set_continous_conversion_mode(u32 adc) __attribute__ ((deprecated ("change to adc_set_continuous_conversion_mode")));
void adc_set_conversion_time(u32 adc, u8 channel, u8 time) __attribute__ ((deprecated ("change to adc_set_sample_time")));
void adc_set_conversion_time_on_all_channels(u32 adc, u8 time) __attribute__ ((deprecated ("change to adc_set_sample_time_on_all_channels")));
void adc_enable_jeoc_interrupt(u32 adc) __attribute__ ((deprecated ("change to adc_enable_eoc_interrupt_injected")));
void adc_disable_jeoc_interrupt(u32 adc) __attribute__ ((deprecated ("change to adc_disable_eoc_interrupt_injected")));
+#else
+void adc_set_continous_conversion_mode(u32 adc) __attribute__ ((deprecated));
+void adc_set_conversion_time(u32 adc, u8 channel, u8 time) __attribute__ ((deprecated));
+void adc_set_conversion_time_on_all_channels(u32 adc, u8 time) __attribute__ ((deprecated));
+void adc_enable_jeoc_interrupt(u32 adc) __attribute__ ((deprecated));
+void adc_disable_jeoc_interrupt(u32 adc) __attribute__ ((deprecated));
+#endif
#endif
END_DECLS
diff --git a/lib/dispatch/vector_nvic.c b/lib/dispatch/vector_nvic.c
index 233c320..b8e9b7f 100644
--- a/lib/dispatch/vector_nvic.c
+++ b/lib/dispatch/vector_nvic.c
@@ -14,6 +14,10 @@
#elif defined(EFM32GG)
# include "../efm32/efm32gg/vector_nvic.c"
+#elif defined(LPC13XX)
+# include "../lpc13xx/vector_nvic.c"
+#elif defined(LPC17XX)
+# include "../lpc17xx/vector_nvic.c"
#elif defined(LPC43XX)
# include "../lpc43xx/vector_nvic.c"
diff --git a/lib/stm32/f4/exti.c b/lib/stm32/f4/exti.c
index 155c21f..f69e99e 100644
--- a/lib/stm32/f4/exti.c
+++ b/lib/stm32/f4/exti.c
@@ -127,6 +127,12 @@ void exti_select_source(u32 exti, u32 gpioport)
case GPIOG:
bits = 0x9;
break;
+ case GPIOH:
+ bits = 0x8;
+ break;
+ case GPIOI:
+ bits = 0x7;
+ break;
}
/* Ensure that only valid EXTI lines are used. */
diff --git a/scripts/irq2nvic_h b/scripts/irq2nvic_h
index 6e45fa2..d1a8a40 100755
--- a/scripts/irq2nvic_h
+++ b/scripts/irq2nvic_h
@@ -139,7 +139,16 @@ def makeparentdir(filename):
# where is my 'mkdir -p'?
pass
+def needs_update(infiles, outfiles):
+ timestamp = lambda filename: os.stat(filename).st_mtime
+ return any(not os.path.exists(o) for o in outfiles) or max(map(timestamp, infiles)) > min(map(timestamp, outfiles))
+
def main():
+ if sys.argv[1] == '--remove':
+ remove = True
+ del sys.argv[1]
+ else:
+ remove = False
infile = sys.argv[1]
if not infile.startswith('./include/libopencm3/') or not infile.endswith('/irq.yaml'):
raise ValueError("Arguent must match ./include/libopencm3/**/irq.yaml")
@@ -147,6 +156,16 @@ def main():
vector_nvic_c = infile.replace('./include/libopencm3/', './lib/').replace('irq.yaml', 'vector_nvic.c')
cmsis = infile.replace('irq.yaml', 'irqhandlers.h').replace('/libopencm3/', '/libopencmsis/')
+ if remove:
+ if os.path.exists(nvic_h):
+ os.unlink(nvic_h)
+ if os.path.exists(vector_nvic_c):
+ os.unlink(vector_nvic_c)
+ sys.exit(0)
+
+ if not needs_update([__file__, infile], [nvic_h, vector_nvic_c]):
+ sys.exit(0)
+
makeparentdir(nvic_h)
makeparentdir(vector_nvic_c)
makeparentdir(cmsis)