aboutsummaryrefslogtreecommitdiffstats
path: root/wirish/boards.h
diff options
context:
space:
mode:
Diffstat (limited to 'wirish/boards.h')
-rw-r--r--wirish/boards.h30
1 files changed, 22 insertions, 8 deletions
diff --git a/wirish/boards.h b/wirish/boards.h
index 0625d0a..558e1c3 100644
--- a/wirish/boards.h
+++ b/wirish/boards.h
@@ -70,12 +70,15 @@ typedef struct PinMapping {
uint32 timer_chan;
} PinMapping;
-/* LeafLabs Maple rev3, rev4 */
+/* LeafLabs Maple rev3, rev5 */
#ifdef BOARD_maple
#define CYCLES_PER_MICROSECOND 72
#define MAPLE_RELOAD_VAL 71999 /* takes a cycle to reload */
+ #define BOARD_BUTTON_PIN 38
+ #define BOARD_LED_PIN 13
+
static __attribute__ ((unused)) PinMapping PIN_MAP[NR_GPIO_PINS] = {
/* D0/PA3 */
{GPIOA_BASE, 3, ADC3, TIMER2_CH4_CCR, EXTI_CONFIG_PORTA, TIMER2, 4},
@@ -163,10 +166,12 @@ typedef struct PinMapping {
{GPIOC_BASE, 9, ADC_INVALID, TIMER_INVALID, EXTI_CONFIG_PORTC, TIMER_INVALID, TIMER_INVALID}
};
-#endif
+ #define BOARD_INIT do { \
+ } while(0)
-/* LeafLabs Maple Native (prototype) */
-#ifdef BOARD_maple_native
+#elif defined(BOARD_maple_native)
+
+ /* LeafLabs Maple Native (prototype) */
#define CYCLES_PER_MICROSECOND 72
#define MAPLE_RELOAD_VAL 71999 /* takes a cycle to reload */
@@ -290,13 +295,15 @@ typedef struct PinMapping {
/* D13/PA5 */
{EXTI5, EXTI_CONFIG_PORTA},
};
-#endif
-#ifdef BOARD_maple_mini
+#elif defined(BOARD_maple_mini)
#define CYCLES_PER_MICROSECOND 72
#define MAPLE_RELOAD_VAL 71999 /* takes a cycle to reload */
+ #define BOARD_BUTTON_PIN 32
+ #define BOARD_LED_PIN 33
+
static __attribute__ ((unused)) PinMapping PIN_MAP[NR_GPIO_PINS] = {
/* D0/PC15 */
{GPIOC_BASE, 15, ADC_INVALID, TIMER_INVALID, EXTI_CONFIG_PORTC, TIMER_INVALID, TIMER_INVALID},
@@ -368,11 +375,18 @@ typedef struct PinMapping {
{GPIOB_BASE, 12, ADC_INVALID, TIMER_INVALID, EXTI_CONFIG_PORTB, TIMER_INVALID, TIMER_INVALID},
};
+ /* since we want the Serial Wire/JTAG pins as GPIOs, disable both
+ SW and JTAG debug support */
+ /* don't use __clear_bits here! */
+ #define BOARD_INIT \
+ do { \
+ *AFIO_MAPR = (*AFIO_MAPR | BIT(26)) & ~(BIT(25) | BIT(24)); \
+ } while (0)
-#endif
+#else
-#ifndef CYCLES_PER_MICROSECOND
#error "Board type has not been selected correctly."
+
#endif
#ifdef __cplusplus