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,2016 by Embedded and Real-Time Systems Laboratory
|
---|
9 | * Graduate School of Information Science, Nagoya Univ., JAPAN
|
---|
10 | * Copyright (C) 2017 by Cores Co., Ltd. Japan
|
---|
11 | *
|
---|
12 | * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
|
---|
13 | * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改
|
---|
14 | * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する.
|
---|
15 | * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
|
---|
16 | * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
|
---|
17 | * スコード中に含まれていること.
|
---|
18 | * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
|
---|
19 | * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用
|
---|
20 | * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記
|
---|
21 | * の無保証規定を掲載すること.
|
---|
22 | * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
|
---|
23 | * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ
|
---|
24 | * と.
|
---|
25 | * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
|
---|
26 | * 作権表示,この利用条件および下記の無保証規定を掲載すること.
|
---|
27 | * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
|
---|
28 | * 報告すること.
|
---|
29 | * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
|
---|
30 | * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
|
---|
31 | * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理
|
---|
32 | * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを
|
---|
33 | * 免責すること.
|
---|
34 | *
|
---|
35 | * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お
|
---|
36 | * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的
|
---|
37 | * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ
|
---|
38 | * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ
|
---|
39 | * の責任を負わない.
|
---|
40 | *
|
---|
41 | * $Id$
|
---|
42 | */
|
---|
43 |
|
---|
44 | /*
|
---|
45 | * シリアルインタフェースドライバのターゲット依存部(GR-PEACH用)
|
---|
46 | * のコンポーネント記述
|
---|
47 | */
|
---|
48 |
|
---|
49 | /*
|
---|
50 | * GR-PEACHとRZ/A1に関する定義
|
---|
51 | */
|
---|
52 | import_C("gr_sakura.h");
|
---|
53 | /*import_C("rza1.h");*/
|
---|
54 | import_C("rx630.h");
|
---|
55 |
|
---|
56 | /*
|
---|
57 | * FIFO内蔵シリアルコミュニケーションインタフェース用 簡易SIOドライバ
|
---|
58 | */
|
---|
59 | import("tSCIF.cdl");
|
---|
60 |
|
---|
61 | /*
|
---|
62 | * シリアルインタフェースドライバのターゲット依存部の本体(シリアルイ
|
---|
63 | * ンタフェースドライバとSIOドライバを接続する部分)のセルタイプ
|
---|
64 | */
|
---|
65 | celltype tSIOPortGRSakuraMain {
|
---|
66 | /*
|
---|
67 | * シリアルインタフェースドライバとの結合
|
---|
68 | */
|
---|
69 | [inline] entry sSIOPort eSIOPort;
|
---|
70 | [optional] call siSIOCBR ciSIOCBR;
|
---|
71 |
|
---|
72 | /*
|
---|
73 | * SIOドライバとの結合
|
---|
74 | */
|
---|
75 | call sSIOPort cSIOPort;
|
---|
76 | [inline] entry siSIOCBR eiSIOCBR;
|
---|
77 |
|
---|
78 | /*
|
---|
79 | * 割込み要求ライン操作のための結合
|
---|
80 | */
|
---|
81 | call sInterruptRequest cRxInterruptRequest;
|
---|
82 | call sInterruptRequest cTxInterruptRequest;
|
---|
83 | };
|
---|
84 |
|
---|
85 | /*
|
---|
86 | * シリアルインタフェースドライバのターゲット依存部(複合コンポーネン
|
---|
87 | * ト)のセルタイプ
|
---|
88 | */
|
---|
89 | [active]
|
---|
90 | composite tSIOPortGRSakura {
|
---|
91 | /*
|
---|
92 | * シリアルインタフェースドライバとの結合
|
---|
93 | */
|
---|
94 | entry sSIOPort eSIOPort;
|
---|
95 | [optional] call siSIOCBR ciSIOCBR;
|
---|
96 |
|
---|
97 | /*
|
---|
98 | * 属性の定義
|
---|
99 | */
|
---|
100 | attr {
|
---|
101 | uintptr_t baseAddress; /* ベースアドレス */
|
---|
102 | INTNO rxInterruptNumber; /* 受信割込み番号 */
|
---|
103 | INTNO txInterruptNumber; /* 送信割込み番号 */
|
---|
104 | PRI isrPriority = 1; /* ISR優先度 */
|
---|
105 | PRI interruptPriority = -4; /* 割込み優先度 */
|
---|
106 | uint32_t baudRate = 115200; /* ボーレートの設定値 */
|
---|
107 | };
|
---|
108 |
|
---|
109 | /*
|
---|
110 | * SIOドライバ
|
---|
111 | */
|
---|
112 | cell tSCIF SCIF {
|
---|
113 | baseAddress = composite.baseAddress;
|
---|
114 | baudRate = composite.baudRate;
|
---|
115 | ciSIOCBR = SIOPortMain.eiSIOCBR;
|
---|
116 | };
|
---|
117 |
|
---|
118 | /*
|
---|
119 | * シリアルインタフェースドライバのターゲット依存部の本体
|
---|
120 | */
|
---|
121 | cell tSIOPortGRSakuraMain SIOPortMain {
|
---|
122 | ciSIOCBR => composite.ciSIOCBR;
|
---|
123 | cSIOPort = SCIF.eSIOPort;
|
---|
124 | cRxInterruptRequest = RxInterruptRequest.eInterruptRequest;
|
---|
125 | cTxInterruptRequest = TxInterruptRequest.eInterruptRequest;
|
---|
126 | };
|
---|
127 | composite.eSIOPort => SIOPortMain.eSIOPort;
|
---|
128 |
|
---|
129 | /*
|
---|
130 | * SIOの受信割込みサービスルーチンと割込み要求ライン
|
---|
131 | */
|
---|
132 | cell tISR RxISRInstance {
|
---|
133 | interruptNumber = composite.rxInterruptNumber;
|
---|
134 | isrPriority = composite.isrPriority;
|
---|
135 | ciISRBody = SCIF.eiRxISR;
|
---|
136 | };
|
---|
137 | cell tInterruptRequest RxInterruptRequest {
|
---|
138 | interruptNumber = composite.rxInterruptNumber;
|
---|
139 | interruptPriority = composite.interruptPriority;
|
---|
140 | };
|
---|
141 |
|
---|
142 | /*
|
---|
143 | * SIOの受信割込みサービスルーチンと割込み要求ライン
|
---|
144 | */
|
---|
145 | cell tISR TxISRInstance {
|
---|
146 | interruptNumber = composite.txInterruptNumber;
|
---|
147 | isrPriority = composite.isrPriority;
|
---|
148 | ciISRBody = SCIF.eiTxISR;
|
---|
149 | };
|
---|
150 | cell tInterruptRequest TxInterruptRequest {
|
---|
151 | interruptNumber = composite.txInterruptNumber;
|
---|
152 | interruptPriority = composite.interruptPriority;
|
---|
153 | };
|
---|
154 | };
|
---|
155 |
|
---|
156 | /*
|
---|
157 | * シリアルインタフェースドライバのターゲット依存部のプロトタイプ
|
---|
158 | *
|
---|
159 | * サンプルプログラムが使うポートが,SIOPortTarget1に固定されているた
|
---|
160 | * め,ポート1とポート3を入れ換えている.具体的には,SIOPortTarget1は
|
---|
161 | * SCIFのチャネル2(チャネル番号は0から始まるので,ポート3のこと)に,
|
---|
162 | * SIOPortTarget3はSCIFのチャネル0につながっている.
|
---|
163 | */
|
---|
164 | [prototype]
|
---|
165 | cell tSIOPortGRSakura SIOPortTarget1 {
|
---|
166 | /* 属性の設定 */
|
---|
167 | baseAddress = C_EXP("SCI0_BASE");
|
---|
168 | rxInterruptNumber = C_EXP("INT_SCI0_RXI");
|
---|
169 | txInterruptNumber = C_EXP("INT_SCI0_TEI");
|
---|
170 | };
|
---|
171 |
|
---|
172 | [prototype]
|
---|
173 | cell tSIOPortGRSakura SIOPortTarget2 {
|
---|
174 | /* 属性の設定 */
|
---|
175 | baseAddress = C_EXP("SCI1_BASE");
|
---|
176 | rxInterruptNumber = C_EXP("INT_SCI1_RXI");
|
---|
177 | txInterruptNumber = C_EXP("INT_SCI1_TEI");
|
---|
178 | };
|
---|
179 |
|
---|
180 | [prototype]
|
---|
181 | cell tSIOPortGRSakura SIOPortTarget3 {
|
---|
182 | /* 属性の設定 */
|
---|
183 | baseAddress = C_EXP("SCI2_BASE");
|
---|
184 | rxInterruptNumber = C_EXP("INT_SCI2_RXI");
|
---|
185 | txInterruptNumber = C_EXP("INT_SCI2_TEI");
|
---|
186 | };
|
---|
187 |
|
---|
188 | [prototype]
|
---|
189 | cell tSIOPortGRSakura SIOPortTarget4 {
|
---|
190 | /* 属性の設定 */
|
---|
191 | baseAddress = C_EXP("SCI3_BASE");
|
---|
192 | rxInterruptNumber = C_EXP("INT_SCI3_RXI");
|
---|
193 | txInterruptNumber = C_EXP("INT_SCI3_TEI");
|
---|
194 | };
|
---|
195 |
|
---|
196 | [prototype]
|
---|
197 | cell tSIOPortGRSakura SIOPortTarget5 {
|
---|
198 | /* 属性の設定 */
|
---|
199 | baseAddress = C_EXP("SCI4_BASE");
|
---|
200 | rxInterruptNumber = C_EXP("INT_SCI4_RXI");
|
---|
201 | txInterruptNumber = C_EXP("INT_SCI4_TEI");
|
---|
202 | };
|
---|
203 |
|
---|
204 | [prototype]
|
---|
205 | cell tSIOPortGRSakura SIOPortTarget6 {
|
---|
206 | /* 属性の設定 */
|
---|
207 | baseAddress = C_EXP("SCI5_BASE");
|
---|
208 | rxInterruptNumber = C_EXP("INT_SCI5_RXI");
|
---|
209 | txInterruptNumber = C_EXP("INT_SCI5_TEI");
|
---|
210 | };
|
---|
211 |
|
---|
212 | [prototype]
|
---|
213 | cell tSIOPortGRSakura SIOPortTarget7 {
|
---|
214 | /* 属性の設定 */
|
---|
215 | baseAddress = C_EXP("SCI6_BASE");
|
---|
216 | rxInterruptNumber = C_EXP("INT_SCI6_RXI");
|
---|
217 | txInterruptNumber = C_EXP("INT_SCI6_TEI");
|
---|
218 | };
|
---|
219 |
|
---|
220 | [prototype]
|
---|
221 | cell tSIOPortGRSakura SIOPortTarget8 {
|
---|
222 | /* 属性の設定 */
|
---|
223 | baseAddress = NULL;
|
---|
224 | rxInterruptNumber = NULL;
|
---|
225 | txInterruptNumber = NULL;
|
---|
226 | };
|
---|