summaryrefslogtreecommitdiff
path: root/nuttx/configs/skp16c26/include
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-02-20 00:59:18 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-02-20 00:59:18 +0000
commit514a82fa266dbaffe22caf7013aa89b76d70de0a (patch)
tree96bd4c27aa46c55ca7f4e37749b7cdbe6aff164b /nuttx/configs/skp16c26/include
parent01f422d3de8c1d02b4183b9bbbbf91eb0d42a58f (diff)
downloadpx4-nuttx-514a82fa266dbaffe22caf7013aa89b76d70de0a.tar.gz
px4-nuttx-514a82fa266dbaffe22caf7013aa89b76d70de0a.tar.bz2
px4-nuttx-514a82fa266dbaffe22caf7013aa89b76d70de0a.zip
Add support for M16C buttons and LEDs
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1519 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/skp16c26/include')
-rw-r--r--nuttx/configs/skp16c26/include/board.h47
1 files changed, 18 insertions, 29 deletions
diff --git a/nuttx/configs/skp16c26/include/board.h b/nuttx/configs/skp16c26/include/board.h
index 029d5d628..961e1b0dd 100644
--- a/nuttx/configs/skp16c26/include/board.h
+++ b/nuttx/configs/skp16c26/include/board.h
@@ -71,25 +71,6 @@
#define M16C_XIN_FREQ 20000000 /* 20MHz */
-/* Switches */
-
-#define S1 p8_3
-#define S2 p8_2
-#define S3 p8_1
-#define S1_DDR pd8_3
-#define S2_DDR pd8_2
-#define S3_DDR pd8_1
-
-/* LEDs */
-
-#define RED_LED p8_0
-#define YLW_LED p7_4
-#define GRN_LED p7_2
-
-#define RED_DDR pd8_0 /* LED port direction register */
-#define YLW_DDR pd7_4
-#define GRN_DDR pd7_2
-
/* Interrupt Priority Levels ********************************************************/
/* IPL settings */
@@ -126,21 +107,29 @@
#undef M16C_INT0_PRIO /* INT0 interrupt priority */
#undef M16C_INT1_PRIO /* INT1 interrupt priority */
-/********************************************************************************/
-/* Macro Definitions */
-/********************************************************************************/
+/* LED definitions **********************************************************/
-#define LED_ON 0
-#define LED_OFF 1
+ /* GREEN YELLOW RED */
+#define LED_STARTED 0 /* OFF OFF OFF */
+#define LED_HEAPALLOCATE 1 /* ON OFF OFF */
+#define LED_IRQSENABLED 2 /* OFF ON OFF */
+#define LED_STACKCREATED 3 /* ON ON OFF */
+#define LED_INIRQ 4 /* ON OFF ON */
+#define LED_SIGNAL 5 /* OFF ON ON */
+#define LED_ASSERTION 6 /* ON ON ON */
+#define LED_PANIC 7 /* NC** NC** ON* */
-/* Use these macros for switch inputs */
+/* *=FLASHING **=if INIRQ, SIGNAL, or ASSERTION will be flashing */
-#define ENABLE_SWITCHES {S1_DDR = 0; S2_DDR = 0; S3_DDR = 0;}
+/* BUTTON definitions **************************************************************/
-/* Use these macros to control the LEDs */
+#define SW1_PRESSED 0x01 /* Bit 0: 1=SW1 pressed */
+#define SW2_PRESSED 0x02 /* Bit 1: 1=SW2 pressed */
+#define SW3_PRESSED 0x04 /* Bit 2: 1=SW3 pressed */
-#define LED(led, state) ((led) = !state)
-#define ENABLE_LEDS {RED_LED = LED_OFF; YLW_LED = LED_OFF; GRN_LED = LED_OFF; RED_DDR = 1; YLW_DDR = 1; GRN_DDR = 1; }
+/************************************************************************************
+ * Macro Definitions
+ ************************************************************************************/
/************************************************************************************
* Inline Functions