aboutsummaryrefslogtreecommitdiffstats
path: root/boards/GENERIC_SPC560P
diff options
context:
space:
mode:
Diffstat (limited to 'boards/GENERIC_SPC560P')
-rw-r--r--boards/GENERIC_SPC560P/board.c19
-rw-r--r--boards/GENERIC_SPC560P/board.h22
2 files changed, 25 insertions, 16 deletions
diff --git a/boards/GENERIC_SPC560P/board.c b/boards/GENERIC_SPC560P/board.c
index 4b4af7f1d..9dece532c 100644
--- a/boards/GENERIC_SPC560P/board.c
+++ b/boards/GENERIC_SPC560P/board.c
@@ -22,10 +22,17 @@
#include "hal.h"
#if HAL_USE_PAL || defined(__DOXYGEN__)
-/* List of the PCR values to be setup initially, the list is terminated by a
- {0, 0}.*/
-static const spc560p_pcr_init_t spc560p_pcrs_init[] = {
- {0, 0}
+/* Initial setup of all defined pads, the list is terminated by a {0, 0}.*/
+static const spc560p_siul_init_t spc560p_siul_init[] = {
+ {PCR(PD, PD_BUTTON1), PAL_LOW, PAL_MODE_INPUT},
+ {PCR(PD, PD_BUTTON2), PAL_LOW, PAL_MODE_INPUT},
+ {PCR(PD, PD_BUTTON3), PAL_LOW, PAL_MODE_INPUT},
+ {PCR(PD, PD_BUTTON4), PAL_LOW, PAL_MODE_INPUT},
+ {PCR(PD, PD_LED1), PAL_HIGH, PAL_MODE_OUTPUT_PUSHPULL},
+ {PCR(PD, PD_LED2), PAL_HIGH, PAL_MODE_OUTPUT_PUSHPULL},
+ {PCR(PD, PD_LED3), PAL_HIGH, PAL_MODE_OUTPUT_PUSHPULL},
+ {PCR(PD, PD_LED4), PAL_HIGH, PAL_MODE_OUTPUT_PUSHPULL},
+ {0, 0, 0}
};
/* Initialization array for the PSMI registers.*/
@@ -40,8 +47,8 @@ static const uint8_t spc560p_padsels_init[36] = {
*/
const PALConfig pal_default_config =
{
- PAL_MODE_UNCONNECTED,
- spc560p_pcrs_init,
+ PAL_MODE_UNCONNECTED, /* Default mode for all undefined pads. */
+ spc560p_siul_init,
spc560p_padsels_init
};
#endif
diff --git a/boards/GENERIC_SPC560P/board.h b/boards/GENERIC_SPC560P/board.h
index b3e74044f..6cbc6213a 100644
--- a/boards/GENERIC_SPC560P/board.h
+++ b/boards/GENERIC_SPC560P/board.h
@@ -41,18 +41,20 @@
/*
* I/O definitions.
*/
-#define GPIO_SCI_A_TX 89
-#define GPIO_SCI_A_RX 90
+#define PD_BUTTON1 0
+#define PD_BUTTON2 1
+#define PD_BUTTON3 2
+#define PD_BUTTON4 3
-#define GPIO_BUTTON1 179
-#define GPIO_BUTTON2 181
-#define GPIO_BUTTON3 183
-#define GPIO_BUTTON4 187
+#define PD_LED1 4
+#define PD_LED2 5
+#define PD_LED3 6
+#define PD_LED4 7
-#define GPIO_LED1 188
-#define GPIO_LED2 189
-#define GPIO_LED3 190
-#define GPIO_LED4 191
+/*
+ * Support macros.
+ */
+#define PCR(port, pin) (((port) * 16) + (pin))
#if !defined(_FROM_ASM_)
#ifdef __cplusplus