1 | /*
|
---|
2 | * TOPPERS/ASP Kernel
|
---|
3 | * Toyohashi Open Platform for Embedded Real-Time Systems/
|
---|
4 | * Advanced Standard Profile Kernel
|
---|
5 | *
|
---|
6 | * Copyright (C) 2007 by Embedded and Real-Time Systems Laboratory
|
---|
7 | * Graduate School of Information Science, Nagoya Univ., JAPAN
|
---|
8 | * Copyright (C) 2014,2015 by Naoki Saito
|
---|
9 | * Nagoya Municipal Industrial Research Institute, JAPAN
|
---|
10 | *
|
---|
11 | * ãLì ÒÍCȺÌ(1)`(4)Ìðð½·êÉÀèC{\tgEF
|
---|
12 | * Ai{\tgEFAðüϵ½àÌðÜÞDȺ¯¶jðgpE¡»Eü
|
---|
13 | * ÏEÄzziȺCpÆÄÔj·é±Æð³Åø·éD
|
---|
14 | * (1) {\tgEFAð\[XR[hÌ`Åp·éêÉÍCãLÌì
|
---|
15 | * \¦C±Ìpð¨æÑºLÌ³ÛØKèªC»ÌÜÜÌ`Å\[
|
---|
16 | * XR[hÉÜÜêĢ鱯D
|
---|
17 | * (2) {\tgEFAðCCu`®ÈÇC¼Ì\tgEFAJÉg
|
---|
18 | * pÅ«é`ÅÄzz·éêÉÍCÄzzɺ¤hL
|
---|
19 | gip
|
---|
20 | * Ò}j
|
---|
21 | AÈÇjÉCãLÌì \¦C±Ìpð¨æÑºL
|
---|
22 | * Ì³ÛØKèðfÚ·é±ÆD
|
---|
23 | * (3) {\tgEFAðC@íÉgÝÞÈÇC¼Ì\tgEFAJÉg
|
---|
24 | * pūȢ`ÅÄzz·éêÉÍCÌ¢¸ê©Ìðð½·±
|
---|
25 | * ÆD
|
---|
26 | * (a) Äzzɺ¤hL
|
---|
27 | gipÒ}j
|
---|
28 | AÈÇjÉCãLÌ
|
---|
29 | * ì \¦C±Ìpð¨æÑºLÌ³ÛØKèðfÚ·é±ÆD
|
---|
30 | * (b) ÄzzÌ`ÔðCÊÉèßéû@ÉæÁÄCTOPPERSvWFNgÉ
|
---|
31 | * ñ·é±ÆD
|
---|
32 | * (4) {\tgEFAÌpÉæè¼ÚIܽÍÔÚIɶ¶é¢©Èé¹
|
---|
33 | * Q©çàCãLì Ò¨æÑTOPPERSvWFNgðÆÓ·é±ÆD
|
---|
34 | * ܽC{\tgEFAÌ[UܽÍGh[U©çÌ¢©Èé
|
---|
35 | * RÉîÿ©çàCãLì Ò¨æÑTOPPERSvWFNgð
|
---|
36 | * ÆÓ·é±ÆD
|
---|
37 | *
|
---|
38 | * {\tgEFAÍC³ÛØÅñ³êÄ¢éàÌÅ éDãLì Ò¨
|
---|
39 | * æÑTOPPERSvWFNgÍC{\tgEFAÉÖµÄCÁèÌgpÚI
|
---|
40 | * ÉηéK«àÜßÄC¢©ÈéÛØàsíÈ¢DܽC{\tgEF
|
---|
41 | * AÌpÉæè¼ÚIܽÍÔÚIɶ¶½¢©Èé¹QÉÖµÄàC»
|
---|
42 | * ÌÓCðíÈ¢D
|
---|
43 | *
|
---|
44 | */
|
---|
45 |
|
---|
46 | /*
|
---|
47 | * VAI/OfoCXiSIOjhCo
|
---|
48 | */
|
---|
49 |
|
---|
50 | #ifndef TOPPERS_TARGET_SERIAL_H
|
---|
51 | #define TOPPERS_TARGET_SERIAL_H
|
---|
52 |
|
---|
53 | #include "qb_r5f100le.h"
|
---|
54 | #include "target_syssvc.h"
|
---|
55 |
|
---|
56 | #define TBIT_ENACB_RCV UINT8_C(0x02) /* óMR[obNÂ */
|
---|
57 | #define TBIT_ENACB_SND UINT8_C(0x01) /* MR[obNÂ */
|
---|
58 |
|
---|
59 | /*
|
---|
60 | * e|[gÉηéÝÔCDæx
|
---|
61 | */
|
---|
62 | /* |[g1 */
|
---|
63 | // ÝÔ
|
---|
64 | #define INTNO_SIOP1_SND INTNO_INTST0
|
---|
65 | #define INTNO_SIOP1_RCV INTNO_INTSR0
|
---|
66 |
|
---|
67 | // ÝDæx
|
---|
68 | #define INTPRI_SIOP1_SND (-1)
|
---|
69 | #define INTPRI_SIOP1_RCV (-2)
|
---|
70 |
|
---|
71 | // ÝvC®«
|
---|
72 | #define INTATR_SIOP1_RCV (0)
|
---|
73 | #define INTATR_SIOP1_SND (0)
|
---|
74 |
|
---|
75 | /*
|
---|
76 | * R[obN[`̯ÊÔ
|
---|
77 | */
|
---|
78 | #define SIO_RDY_SND 1U /* MÂ\R[obN */
|
---|
79 | #define SIO_RDY_RCV 2U /* óMÊmR[obN */
|
---|
80 |
|
---|
81 | #ifndef TOPPERS_MACRO_ONLY
|
---|
82 |
|
---|
83 | /*
|
---|
84 | * VAI/O|[gÇubN
|
---|
85 | */
|
---|
86 | typedef struct sio_port_control_block {
|
---|
87 | intptr_t exinf; /* g£îñ */
|
---|
88 | uint8_t enacb; /* R[obNÂÛÌóÔ */
|
---|
89 | };
|
---|
90 |
|
---|
91 | /*
|
---|
92 | * VAI/O|[gÇubNÌè`
|
---|
93 | */
|
---|
94 | typedef struct sio_port_control_block SIOPCB;
|
---|
95 |
|
---|
96 | /*
|
---|
97 | * SIOú»
|
---|
98 | */
|
---|
99 | extern void sio_initialize(intptr_t exinf);
|
---|
100 |
|
---|
101 | /*
|
---|
102 | * áxVAú»
|
---|
103 | */
|
---|
104 | extern void target_sau_init(ID siopid);
|
---|
105 |
|
---|
106 | /*
|
---|
107 | * VAI[v
|
---|
108 | */
|
---|
109 | extern SIOPCB *sio_opn_por(ID siopid, intptr_t exinf);
|
---|
110 |
|
---|
111 | /*
|
---|
112 | * VAN[Y
|
---|
113 | */
|
---|
114 | extern void sio_cls_por(SIOPCB *p_siopcb);
|
---|
115 |
|
---|
116 | /*
|
---|
117 | * ÝT[rX[`
|
---|
118 | */
|
---|
119 | extern void sio_isr_rcv(intptr_t exinf);
|
---|
120 | extern void sio_isr_snd(intptr_t exinf);
|
---|
121 |
|
---|
122 | /*
|
---|
123 | * 1¶M
|
---|
124 | */
|
---|
125 | extern bool_t sio_snd_chr(SIOPCB *siopcb, char c);
|
---|
126 |
|
---|
127 | /*
|
---|
128 | * 1¶óM
|
---|
129 | */
|
---|
130 | extern int_t sio_rcv_chr(SIOPCB *siopcb);
|
---|
131 |
|
---|
132 | /*
|
---|
133 | * R[obNÌÂ
|
---|
134 | */
|
---|
135 | extern void sio_ena_cbr(SIOPCB *siopcb, uint_t cbrtn);
|
---|
136 |
|
---|
137 | /*
|
---|
138 | * R[obNÌÖ~
|
---|
139 | */
|
---|
140 | extern void sio_dis_cbr(SIOPCB *siopcb, uint_t cbrtn);
|
---|
141 |
|
---|
142 | /*
|
---|
143 | * MÂ\R[obN
|
---|
144 | */
|
---|
145 | extern void sio_irdy_snd(intptr_t exinf);
|
---|
146 |
|
---|
147 | /*
|
---|
148 | * óMÊmR[obN
|
---|
149 | */
|
---|
150 | extern void sio_irdy_rcv(intptr_t exinf);
|
---|
151 |
|
---|
152 | /*
|
---|
153 | * 1¶Mi|[OÅÌoÍj
|
---|
154 | */
|
---|
155 | extern void sio_pol_snd_chr(char c, ID siopid);
|
---|
156 |
|
---|
157 | #endif /* TOPPERS_MACRO_ONLY */
|
---|
158 | #endif /* TOPPERS_TARGET_SERIAL_H */
|
---|