summaryrefslogtreecommitdiffstats
path: root/nuttx/configs/skp16c26
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2009-02-08 20:30:10 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2009-02-08 20:30:10 +0000
commit211e1c59de15630ae9f7c3a4277d15a656dbe1c0 (patch)
treec276126dc0d959e7d98d9baf7fa39e0e1c62b050 /nuttx/configs/skp16c26
parent109983c972f5b5c186d27d51439c06adabaf8295 (diff)
Add M16C info
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@1483 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/configs/skp16c26')
-rw-r--r--nuttx/configs/skp16c26/include/board.h43
-rw-r--r--nuttx/configs/skp16c26/ostest/ld.script45
2 files changed, 84 insertions, 4 deletions
diff --git a/nuttx/configs/skp16c26/include/board.h b/nuttx/configs/skp16c26/include/board.h
index de04e1e194..5f694f5dee 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
************************************************************************************/
diff --git a/nuttx/configs/skp16c26/ostest/ld.script b/nuttx/configs/skp16c26/ostest/ld.script
index 63cfeccdbe..6474929170 100644
--- a/nuttx/configs/skp16c26/ostest/ld.script
+++ b/nuttx/configs/skp16c26/ostest/ld.script
@@ -37,9 +37,12 @@ OUTPUT_ARCH(m32c)
ENTRY(_stext)
SECTIONS
{
- /* The OS entry point is here */
+ /* Flash memory begins at address 0xf0000 for the M20262F8 part and
+ * ends at address 0xfffff (all parts). The program entry point is
+ * the first address in flash
+ */
- . = 0x00008000;
+ . = 0xf0000;
.text : {
_stext = ABSOLUTE(.);
*(.text)
@@ -52,8 +55,42 @@ SECTIONS
_etext = ABSOLUTE(.);
}
- _eronly = ABSOLUTE(.); /* See below */
- . = ALIGN(4096);
+ _eronly = ABSOLUTE(.); /* End of read-only values */
+ /* .data will be relocated from */
+ /* this address */
+
+ /* The "variable" vector table will be fixed at the following address */
+
+ . = 0xffd00
+ .varvect : {
+ _svarvect = ABSOLUTE(.);
+ *(.varvect)
+ _evarvect = ABSOLUTE(.);
+ }
+
+ /* Followed by the special page/fixed vector table. */
+
+ . = 0xffe00
+ .specpg : {
+ _sspecpg = ABSOLUTE(.);
+ *(.specpg)
+ _especpg = ABSOLUTE(.);
+ }
+
+ . = 0xfffdc
+ .fixvect : {
+ _sfixvect = ABSOLUTE(.);
+ *(.fixvect)
+ _efixvect = ABSOLUTE(.);
+ }
+
+ /* Internal RAM begins at address 0x00400 (all parts) and ends at
+ * address 0x00bff (M20262F6 and M20262F8 parts). With the RAM
+ * region, used is .data followed by .bss. The remainder of RAM
+ * carved up by the start-up code into stacks and heaps.
+ */
+
+ . = 0x00400;
.data : {
_sdata = ABSOLUTE(.);