OSDN Git Service

Step 10 added.
[kozos-expbrd/kozos_expbrd.git] / firm / junk / 06 / os / re.c
1 #include "re.h"
2
3 #define H8_3069F_TMDR       ((volatile uint8 *)0xFFFF62)
4 #define H8_3069F_TSTR       ((volatile uint8 *)0xFFFF60)
5 #define H8_3069F_16TCNT2H   ((volatile uint8 *)0xFFFF7A)
6 #define H8_3069F_16TCNT2L   ((volatile uint8 *)0xFFFF7B)
7
8 #define TMDR_BIT_MDF    (1 << 6)
9 #define TSTR_BIT_STR2   (1 << 2)
10
11 int re_init(void)
12 {
13   *H8_3069F_TMDR |= TMDR_BIT_MDF;
14   *H8_3069F_TSTR |= TSTR_BIT_STR2;
15
16   return 0;
17 }
18
19 uint16 re_read(void)
20 {
21   return ((*H8_3069F_16TCNT2H) << 8) | (*H8_3069F_16TCNT2L << 0);
22 }
23