+
#include "defines.h"
#include "lib.h"
#include "dram.h"
-
-#define H8_3069F_ABWCR ((volatile uint8 *)0xfee020)
-#define H8_3069F_ASTCR ((volatile uint8 *)0xfee021)
-#define H8_3069F_RTCOR ((volatile uint8 *)0xfee02a)
-#define H8_3069F_RTMCSR ((volatile uint8 *)0xfee028)
-#define H8_3069F_DRCRB ((volatile uint8 *)0xfee027)
-#define H8_3069F_DRCRA ((volatile uint8 *)0xfee026)
-
-#define H8_3069F_P1DDR ((volatile uint8 *)0xfee000)
-#define H8_3069F_P2DDR ((volatile uint8 *)0xfee001)
-#define H8_3069F_P8DDR ((volatile uint8 *)0xfee007)
-#define H8_3069F_PBDDR ((volatile uint8 *)0xfee00a)
-
-#define H8_3069F_WCRH ((volatile uint8 *)0xfee022)
-#define H8_3069F_WCRL ((volatile uint8 *)0xfee023)
+#include "portconf.h"
+#include "spreg.h"
typedef struct {
union {
{
int i, j;
- *H8_3069F_ABWCR = 0xff;
- *H8_3069F_RTCOR = 0x03; /* ¥ê¥Õ¥ì¥Ã¥·¥å¼þ´ü¤òû¤á¤ËÀßÄê */
- *H8_3069F_RTMCSR = 0x37;
- *H8_3069F_DRCRB = 0x8f; /* ¥¦¥¨¥¤¥ÈÁÞÆþ */
- *H8_3069F_DRCRA = 0x20;
+ *SPREG_ABWCR = 0xff;
+ *SPREG_RTCOR = 0x03; /* ¥ê¥Õ¥ì¥Ã¥·¥å¼þ´ü¤òû¤á¤ËÀßÄê */
+ *SPREG_RTMCSR = 0x37;
+ *SPREG_DRCRB = 0x8f; /* ¥¦¥¨¥¤¥ÈÁÞÆþ */
+ *SPREG_DRCRA = 0x20;
- *H8_3069F_P1DDR = 0xff;
- *H8_3069F_P2DDR = 0x07;
- *H8_3069F_P8DDR = 0xee;
- *H8_3069F_PBDDR = 0x6c;
+ *PORTCONF_P1DDR = 0xff;
+ *PORTCONF_P2DDR = 0x07;
+ *PORTCONF_P8DDR = 0xee;
+ *PORTCONF_PBDDR = 0x6c;
for (i = 0; i < 200; i++) {
for (j = 0; j < 200; j++) {
/*
* 3¥¹¥Æ¡¼¥È¥¢¥¯¥»¥¹
*/
- *H8_3069F_WCRH = 0xff;
- *H8_3069F_WCRL = 0xff;
+ *SPREG_WCRH = 0xff;
+ *SPREG_WCRL = 0xff;
/*
* 3¥¹¥Æ¡¼¥È¥¢¥¯¥»¥¹
*/
- *H8_3069F_ASTCR = 0xff;
+ *SPREG_ASTCR = 0xff;
return 0;
}
#include "lcd.h"
#include "defines.h"
#include "portconf.h"
+#include "spreg.h"
static const uint8 FONT_X = 5;
static const uint8 FONT_Y = 7;
asm volatile ("nop");
*PORTCONF_P4DR |= PORTCONF_P4BIT_LCD_RES;
- *PORTCONF_CSCR = 0x3F;
+ *SPREG_CSCR = 0x3F;
LCD1_CMD(0xE2); // Reset
LCD1_CMD(0xA4); // Static Drive Off
* Data Direction Register
*/
+#define PORTCONF_P1DDR ((volatile uint8 *)0xfee000)
+#define PORTCONF_P2DDR ((volatile uint8 *)0xfee001)
#define PORTCONF_P4DDR ((volatile uint8 *)0xFEE003)
+#define PORTCONF_P8DDR ((volatile uint8 *)0xfee007)
#define PORTCONF_PADDR ((volatile uint8 *)0xFEE009)
+#define PORTCONF_PBDDR ((volatile uint8 *)0xfee00a)
/*
* Port Data Register
#define PORTCONF_PBDR ((volatile uint8 *)0xFFFFDA)
/*
- * Special Register
- */
-
-#define PORTCONF_CSCR ((volatile uint8 *)0xFEE01F)
-#define PORTCONF_TMDR ((volatile uint8 *)0xFFFF62)
-#define PORTCONF_TSTR ((volatile uint8 *)0xFFFF60)
-#define PORTCONF_16TCNT2H ((volatile uint8 *)0xFFFF7A)
-#define PORTCONF_16TCNT2L ((volatile uint8 *)0xFFFF7B)
-
-/*
* Bit
*/
-#define PORTCONF_TMDRBIT_MDF (1 << 6)
-#define PORTCONF_TSTRBIT_STR2 (1 << 2)
-
#define PORTCONF_PABIT_LEDG (1 << 2)
#define PORTCONF_PABIT_LEDR (1 << 3)
#define PORTCONF_PABIT_SWRE (1 << 4)
#include "re.h"
-#include "portconf.h"
+#include "spreg.h"
int re_init(void)
{
- *PORTCONF_TMDR = PORTCONF_TMDRBIT_MDF;
- *PORTCONF_TSTR = PORTCONF_TSTRBIT_STR2;
+ *SPREG_TMDR = SPREG_TMDR_BIT_MDF;
+ *SPREG_TSTR = SPREG_TSTR_BIT_STR2;
return 0;
}
uint16 re_read(void)
{
- return ((*PORTCONF_16TCNT2H) << 8) | (*PORTCONF_16TCNT2L << 0);
+ return ((*SPREG_16TCNT2H) << 8) | (*SPREG_16TCNT2L << 0);
}
--- /dev/null
+#ifndef SPREG_H
+#define SPREG_H
+
+#define SPREG_CSCR ((volatile uint8 *)0xFEE01F)
+
+/*
+ * Special Register
+ */
+#define SPREG_TMDR ((volatile uint8 *)0xFFFF62)
+#define SPREG_TSTR ((volatile uint8 *)0xFFFF60)
+#define SPREG_16TCNT2H ((volatile uint8 *)0xFFFF7A)
+#define SPREG_16TCNT2L ((volatile uint8 *)0xFFFF7B)
+
+#define SPREG_TMDR_BIT_MDF (1 << 6)
+#define SPREG_TSTR_BIT_STR2 (1 << 2)
+
+/*
+ * DRAM
+ */
+#define SPREG_ABWCR ((volatile uint8 *)0xfee020)
+#define SPREG_ASTCR ((volatile uint8 *)0xfee021)
+#define SPREG_RTCOR ((volatile uint8 *)0xfee02a)
+#define SPREG_RTMCSR ((volatile uint8 *)0xfee028)
+#define SPREG_DRCRB ((volatile uint8 *)0xfee027)
+#define SPREG_DRCRA ((volatile uint8 *)0xfee026)
+
+#define SPREG_WCRH ((volatile uint8 *)0xfee022)
+#define SPREG_WCRL ((volatile uint8 *)0xfee023)
+
+#endif
+