1 | /*
|
---|
2 | * TOPPERS/ASP Kernel
|
---|
3 | * Toyohashi Open Platform for Embedded Real-Time Systems/
|
---|
4 | * Advanced Standard Profile Kernel
|
---|
5 | *
|
---|
6 | * Copyright (C) 2015 by Ushio Laboratory
|
---|
7 | * Graduate School of Engineering Science, Osaka Univ., JAPAN
|
---|
8 | * Copyright (C) 2015-2018 by Embedded and Real-Time Systems Laboratory
|
---|
9 | * Graduate School of Information Science, Nagoya Univ., JAPAN
|
---|
10 | *
|
---|
11 | * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
|
---|
12 | * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改
|
---|
13 | * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する.
|
---|
14 | * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
|
---|
15 | * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
|
---|
16 | * スコード中に含まれていること.
|
---|
17 | * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
|
---|
18 | * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用
|
---|
19 | * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記
|
---|
20 | * の無保証規定を掲載すること.
|
---|
21 | * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
|
---|
22 | * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ
|
---|
23 | * と.
|
---|
24 | * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
|
---|
25 | * 作権表示,この利用条件および下記の無保証規定を掲載すること.
|
---|
26 | * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
|
---|
27 | * 報告すること.
|
---|
28 | * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
|
---|
29 | * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
|
---|
30 | * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理
|
---|
31 | * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを
|
---|
32 | * 免責すること.
|
---|
33 | *
|
---|
34 | * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お
|
---|
35 | * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的
|
---|
36 | * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ
|
---|
37 | * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ
|
---|
38 | * の責任を負わない.
|
---|
39 | *
|
---|
40 | * $Id$
|
---|
41 | */
|
---|
42 |
|
---|
43 | /*
|
---|
44 | * シリアルインタフェースドライバのターゲット依存部(GR-PEACH用)
|
---|
45 | * のコンポーネント記述
|
---|
46 | */
|
---|
47 |
|
---|
48 | /*
|
---|
49 | * GR-PEACHのハードウェア資源の定義
|
---|
50 | */
|
---|
51 | import_C("gr_peach.h");
|
---|
52 | import_C("device.h");
|
---|
53 |
|
---|
54 | /*
|
---|
55 | * シリアルインタフェースドライバのチップ依存部(RZ/A1用)
|
---|
56 | */
|
---|
57 | import("tMbedSerial.cdl");
|
---|
58 |
|
---|
59 | /*
|
---|
60 | * シリアルインタフェースドライバのターゲット依存部の本体(シリアルイ
|
---|
61 | * ンタフェースドライバとSIOドライバを接続する部分)のセルタイプ
|
---|
62 | */
|
---|
63 | celltype tSIOPortGRPeachMain {
|
---|
64 | /*
|
---|
65 | * シリアルインタフェースドライバとの結合
|
---|
66 | */
|
---|
67 | [inline] entry sSIOPort eSIOPort;
|
---|
68 | [optional] call siSIOCBR ciSIOCBR;
|
---|
69 |
|
---|
70 | /*
|
---|
71 | * SIOドライバとの結合
|
---|
72 | */
|
---|
73 | call sSIOPort cSIOPort;
|
---|
74 | [inline] entry siSIOCBR eiSIOCBR;
|
---|
75 | };
|
---|
76 |
|
---|
77 | /*
|
---|
78 | * シリアルインタフェースドライバのターゲット依存部(複合コンポーネン
|
---|
79 | * ト)のセルタイプ
|
---|
80 | */
|
---|
81 | composite tSIOPortGRPeach {
|
---|
82 | /*
|
---|
83 | * シリアルインタフェースドライバとの結合
|
---|
84 | */
|
---|
85 | entry sSIOPort eSIOPort;
|
---|
86 | [optional] call siSIOCBR ciSIOCBR;
|
---|
87 |
|
---|
88 | /*
|
---|
89 | * 属性の定義
|
---|
90 | */
|
---|
91 | attr {
|
---|
92 | int32_t tx; /* 送信Pin */
|
---|
93 | int32_t rx; /* 受信Pin */
|
---|
94 | uint32_t baudRate = 115200; /* ボーレートの設定値 */
|
---|
95 | };
|
---|
96 |
|
---|
97 | /*
|
---|
98 | * SIOドライバ
|
---|
99 | */
|
---|
100 | cell tMbedSerial MbedSerial {
|
---|
101 | tx = composite.tx;
|
---|
102 | rx = composite.rx;
|
---|
103 | baudRate = composite.baudRate;
|
---|
104 | ciSIOCBR = SIOPortMain.eiSIOCBR;
|
---|
105 | };
|
---|
106 |
|
---|
107 | /*
|
---|
108 | * シリアルインタフェースドライバのターゲット依存部の本体
|
---|
109 | */
|
---|
110 | cell tSIOPortGRPeachMain SIOPortMain {
|
---|
111 | ciSIOCBR => composite.ciSIOCBR;
|
---|
112 | cSIOPort = MbedSerial.eSIOPort;
|
---|
113 | };
|
---|
114 | composite.eSIOPort => SIOPortMain.eSIOPort;
|
---|
115 | };
|
---|
116 |
|
---|
117 | /*
|
---|
118 | * シリアルインタフェースドライバのターゲット依存部のプロトタイプ
|
---|
119 | *
|
---|
120 | * サンプルプログラムが使うポートが,SIOPortTarget1に固定されているた
|
---|
121 | * め,ポート1とポート3を入れ換えている.具体的には,SIOPortTarget1は
|
---|
122 | * MbedSerialのチャネル2(チャネル番号は0から始まるので,ポート3のこと)に,
|
---|
123 | * SIOPortTarget3はMbedSerialのチャネル0につながっている.
|
---|
124 | */
|
---|
125 | [prototype]
|
---|
126 | cell tSIOPortGRPeach SIOPortTarget1 {
|
---|
127 | /* 属性の設定 */
|
---|
128 | tx = C_EXP("P6_3");
|
---|
129 | rx = C_EXP("P6_2");
|
---|
130 | };
|
---|
131 |
|
---|
132 | [prototype]
|
---|
133 | cell tSIOPortGRPeach SIOPortTarget2 {
|
---|
134 | /* 属性の設定 */
|
---|
135 | tx = C_EXP("P2_5");
|
---|
136 | rx = C_EXP("P2_6");
|
---|
137 | };
|
---|
138 |
|
---|
139 | [prototype]
|
---|
140 | cell tSIOPortGRPeach SIOPortTarget3 {
|
---|
141 | /* 属性の設定 */
|
---|
142 | tx = C_EXP("P4_12");
|
---|
143 | rx = C_EXP("P4_13");
|
---|
144 | };
|
---|
145 |
|
---|
146 | [prototype]
|
---|
147 | cell tSIOPortGRPeach SIOPortTarget4 {
|
---|
148 | /* 属性の設定 */
|
---|
149 | tx = C_EXP("P2_14");
|
---|
150 | rx = C_EXP("P2_15");
|
---|
151 | };
|
---|
152 |
|
---|
153 | [prototype]
|
---|
154 | cell tSIOPortGRPeach SIOPortTarget5 {
|
---|
155 | /* 属性の設定 */
|
---|
156 | tx = C_EXP("P4_14");
|
---|
157 | rx = C_EXP("P4_15");
|
---|
158 | };
|
---|
159 |
|
---|
160 | [prototype]
|
---|
161 | cell tSIOPortGRPeach SIOPortTarget6 {
|
---|
162 | /* 属性の設定 */
|
---|
163 | tx = C_EXP("P5_3");
|
---|
164 | rx = C_EXP("P5_4");
|
---|
165 | };
|
---|
166 |
|
---|
167 | [prototype]
|
---|
168 | cell tSIOPortGRPeach SIOPortTarget7 {
|
---|
169 | /* 属性の設定 */
|
---|
170 | tx = C_EXP("P8_8");
|
---|
171 | rx = C_EXP("P8_9");
|
---|
172 | };
|
---|
173 |
|
---|
174 | [prototype]
|
---|
175 | cell tSIOPortGRPeach SIOPortTarget8 {
|
---|
176 | /* 属性の設定 */
|
---|
177 | tx = C_EXP("P5_0");
|
---|
178 | rx = C_EXP("P5_1");
|
---|
179 | };
|
---|
180 |
|
---|
181 | [prototype]
|
---|
182 | cell tSIOPortGRPeach SIOPortTarget9 {
|
---|
183 | /* 属性の設定 */
|
---|
184 | tx = C_EXP("P8_14");
|
---|
185 | rx = C_EXP("P8_15");
|
---|
186 | };
|
---|
187 |
|
---|
188 | [prototype]
|
---|
189 | cell tSIOPortGRPeach SIOPortTarget10 {
|
---|
190 | /* 属性の設定 */
|
---|
191 | tx = C_EXP("P8_13");
|
---|
192 | rx = C_EXP("P8_11");
|
---|
193 | };
|
---|
194 |
|
---|
195 | [prototype]
|
---|
196 | cell tSIOPortGRPeach SIOPortTarget11 {
|
---|
197 | /* 属性の設定 */
|
---|
198 | tx = C_EXP("P11_10");
|
---|
199 | rx = C_EXP("P11_11");
|
---|
200 | };
|
---|
201 |
|
---|
202 | [prototype]
|
---|
203 | cell tSIOPortGRPeach SIOPortTarget12 {
|
---|
204 | /* 属性の設定 */
|
---|
205 | tx = C_EXP("P6_6");
|
---|
206 | rx = C_EXP("P6_7");
|
---|
207 | };
|
---|
208 |
|
---|
209 | [prototype]
|
---|
210 | cell tSIOPortGRPeach SIOPortTarget13 {
|
---|
211 | /* 属性の設定 */
|
---|
212 | tx = C_EXP("P5_6");
|
---|
213 | rx = C_EXP("P5_7");
|
---|
214 | };
|
---|
215 |
|
---|
216 | [prototype]
|
---|
217 | cell tSIOPortGRPeach SIOPortTarget14 {
|
---|
218 | /* 属性の設定 */
|
---|
219 | tx = C_EXP("P11_1");
|
---|
220 | rx = C_EXP("P11_2");
|
---|
221 | };
|
---|
222 |
|
---|
223 | [prototype]
|
---|
224 | cell tSIOPortGRPeach SIOPortTarget15 {
|
---|
225 | /* 属性の設定 */
|
---|
226 | tx = C_EXP("P7_4");
|
---|
227 | rx = C_EXP("P7_5");
|
---|
228 | };
|
---|