aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32/l1/stm32l-discovery/button-irq-printf/syscfg.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/stm32/l1/stm32l-discovery/button-irq-printf/syscfg.h')
-rw-r--r--examples/stm32/l1/stm32l-discovery/button-irq-printf/syscfg.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/examples/stm32/l1/stm32l-discovery/button-irq-printf/syscfg.h b/examples/stm32/l1/stm32l-discovery/button-irq-printf/syscfg.h
new file mode 100644
index 0000000..32cf465
--- /dev/null
+++ b/examples/stm32/l1/stm32l-discovery/button-irq-printf/syscfg.h
@@ -0,0 +1,45 @@
+/*
+ * General configuration of the device
+ *
+ * Karl Palsson <karlp@tweak.net.au> 2012
+ */
+
+#ifndef SYSCFG_H
+#define SYSCFG_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <libopencm3/stm32/l1/gpio.h>
+#include <libopencm3/stm32/l1/nvic.h>
+#include <libopencm3/stm32/exti.h>
+#include <libopencm3/stm32/usart.h>
+
+
+#define USART_CONSOLE USART2
+#define USE_NASTYLOG 1
+
+#define LED_DISCO_GREEN_PORT GPIOB
+#define LED_DISCO_GREEN_PIN GPIO7
+#define LED_DISCO_BLUE_PORT GPIOB
+#define LED_DISCO_BLUE_PIN GPIO6
+
+#define BUTTON_DISCO_USER_PORT GPIOA
+#define BUTTON_DISCO_USER_PIN GPIO0
+#define BUTTON_DISCO_USER_EXTI EXTI0
+#define BUTTON_DISCO_USER_isr exti0_isr
+#define BUTTON_DISCO_USER_NVIC NVIC_EXTI0_IRQ
+
+
+ struct state_t {
+ bool falling;
+ };
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* SYSCFG_H */
+