aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32/l1/stm32l-discovery/button-irq-printf-lowpower/syscfg.h
diff options
context:
space:
mode:
authorPiotr Esden-Tempski2013-02-18 14:06:02 -0800
committerPiotr Esden-Tempski2013-02-18 14:06:02 -0800
commit9095f58fa3c167a8646a0f9abd5461115e53e2de (patch)
tree9019211307e8c3fde340c9465d9e9b623cd7440d /examples/stm32/l1/stm32l-discovery/button-irq-printf-lowpower/syscfg.h
parentb903ae75d847f0764a30744f26d68d9599c7df72 (diff)
parentd9fb4f7401b8bf546cc7e6ddeb9f22d343f0622d (diff)
Merge pull request #79 "More L1 support (and f2/f4 rtc)"
Merge remote-tracking branch 'karlp/pr_more_l1_rtc'
Diffstat (limited to 'examples/stm32/l1/stm32l-discovery/button-irq-printf-lowpower/syscfg.h')
-rw-r--r--examples/stm32/l1/stm32l-discovery/button-irq-printf-lowpower/syscfg.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/examples/stm32/l1/stm32l-discovery/button-irq-printf-lowpower/syscfg.h b/examples/stm32/l1/stm32l-discovery/button-irq-printf-lowpower/syscfg.h
new file mode 100644
index 0000000..8ca634b
--- /dev/null
+++ b/examples/stm32/l1/stm32l-discovery/button-irq-printf-lowpower/syscfg.h
@@ -0,0 +1,61 @@
+/*
+ * This file is part of the libopencm3 project.
+ *
+ * Copyright (C) 2012 Karl Palsson <karlp@tweak.net.au>
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef SYSCFG_H
+#define SYSCFG_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <libopencm3/cm3/nvic.h>
+#include <libopencm3/stm32/gpio.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
+#define TIMER_BUTTON_PRESS TIM7
+
+ struct state_t {
+ bool falling;
+ bool pressed;
+ int rtc_ticked;
+ int hold_time;
+ };
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* SYSCFG_H */
+