summaryrefslogtreecommitdiff
path: root/nuttx/configs/skp16c26/include
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-02-08 20:30:10 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-02-08 20:30:10 +0000
commit489cb13e329429d85b919eaf5fa2c80734eee18a (patch)
treec276126dc0d959e7d98d9baf7fa39e0e1c62b050 /nuttx/configs/skp16c26/include
parentae87859dba09246ac004b98999254ad7dafec620 (diff)
downloadpx4-nuttx-489cb13e329429d85b919eaf5fa2c80734eee18a.tar.gz
px4-nuttx-489cb13e329429d85b919eaf5fa2c80734eee18a.tar.bz2
px4-nuttx-489cb13e329429d85b919eaf5fa2c80734eee18a.zip
Add M16C info
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1483 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/skp16c26/include')
-rw-r--r--nuttx/configs/skp16c26/include/board.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/nuttx/configs/skp16c26/include/board.h b/nuttx/configs/skp16c26/include/board.h
index de04e1e19..5f694f5de 100644
--- a/nuttx/configs/skp16c26/include/board.h
+++ b/nuttx/configs/skp16c26/include/board.h
@@ -44,11 +44,54 @@
#ifndef __ASSEMBLY__
# include <sys/types.h>
#endif
+#include "sfr262.h" /* M16C/26 special function register definitions */
+#include "skp_lcd.h" /* SKP LCD function definitions */
/************************************************************************************
* Definitions
************************************************************************************/
+/* Xin Freq */
+
+#define XIN_FREQ 20e6 /* 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
+
+/********************************************************************************/
+/* Macro Definitions */
+/********************************************************************************/
+
+#define LED_ON 0
+#define LED_OFF 1
+
+#define ENABLE_IRQ {_asm(" FSET I");}
+#define DISABLE_IRQ {_asm(" FCLR I");}
+
+/* Use these macros for switch inputs */
+
+#define ENABLE_SWITCHES {S1_DDR = 0; S2_DDR = 0; S3_DDR = 0;}
+
+/* Use these macros to control the LEDs */
+
+#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; }
+
/************************************************************************************
* Inline Functions
************************************************************************************/