source: ssp_qb_r5f100le_cs/trunk/target/qb_r5f100le_cs/target_serial.h@ 93

Last change on this file since 93 was 93, checked in by nmir-saito, 8 years ago

add Combined package of SSP kernel for QB-R5F100LE-TB(RL78 processor)

File size: 4.2 KB
Line 
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–{ƒ\ƒtƒgƒEƒF
12 * ƒAi–{ƒ\ƒtƒgƒEƒFƒA‚ð‰ü•Ï‚µ‚½‚à‚Ì‚ðŠÜ‚ށDˆÈ‰º“¯‚¶j‚ðŽg—pE•¡»E‰ü
13 * •ÏEÄ”z•ziˆÈ‰ºC—˜—p‚ƌĂԁj‚·‚邱‚Ƃ𖳏ž‚Å‹–‘ø‚·‚éD
14 * (1) –{ƒ\ƒtƒgƒEƒFƒA‚ðƒ\[ƒXƒR[ƒh‚ÌŒ`‚Å—˜—p‚·‚éê‡‚ɂ́Cã‹L‚Ì’˜ì
15 * Œ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’肪C‚»‚Ì‚Ü‚Ü‚ÌŒ`‚Ń\[
16 * ƒXƒR[ƒh’†‚ÉŠÜ‚Ü‚ê‚Ä‚¢‚邱‚ƁD
17 * (2) –{ƒ\ƒtƒgƒEƒFƒA‚ðCƒ‰ƒCƒuƒ‰ƒŠŒ`Ž®‚ȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
18 * —p‚Å‚«‚éŒ`‚ōĔz•z‚·‚éê‡‚ɂ́CÄ”z•z‚É”º‚¤ƒhƒLƒ…
19ƒƒ“ƒgi—˜—p
20 * ŽÒƒ}ƒjƒ…
21ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L
22 * ‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
23 * (3) –{ƒ\ƒtƒgƒEƒFƒA‚ðC‹@Ší‚É‘g‚ݍž‚ނȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
24 * —p‚Å‚«‚È‚¢Œ`‚ōĔz•z‚·‚éê‡‚ɂ́CŽŸ‚Ì‚¢‚¸‚ê‚©‚ÌðŒ‚ð–ž‚½‚·‚±
25 * ‚ƁD
26 * (a) Ä”z•z‚É”º‚¤ƒhƒLƒ…
27ƒƒ“ƒgi—˜—pŽÒƒ}ƒjƒ…
28ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜
29 * ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
30 * (b) Ä”z•z‚ÌŒ`‘Ô‚ðC•Ê‚É’è‚ß‚é•û–@‚É‚æ‚Á‚āCTOPPERSƒvƒƒWƒFƒNƒg‚É
31 * •ñ‚·‚邱‚ƁD
32 * (4) –{ƒ\ƒtƒgƒEƒFƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚é‚¢‚©‚Ȃ鑹
33 * ŠQ‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð–Ɛӂ·‚邱‚ƁD
34 * ‚Ü‚½C–{ƒ\ƒtƒgƒEƒFƒA‚̃†[ƒU‚Ü‚½‚̓Gƒ“ƒhƒ†[ƒU‚©‚ç‚Ì‚¢‚©‚Ȃ闝
35 * —R‚ÉŠî‚­¿‹‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð
36 * –Ɛӂ·‚邱‚ƁD
37 *
38 * –{ƒ\ƒtƒgƒEƒFƒA‚́C–³•ÛØ‚Å’ñ‹Ÿ‚³‚ê‚Ä‚¢‚é‚à‚Ì‚Å‚ ‚éDã‹L’˜ìŒ ŽÒ‚¨
39 * ‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚́C–{ƒ\ƒtƒgƒEƒFƒA‚ÉŠÖ‚µ‚āC“Á’è‚ÌŽg—p–Ú“I
40 * ‚ɑ΂·‚é“K‡«‚àŠÜ‚߂āC‚¢‚©‚È‚é•ÛØ‚às‚í‚È‚¢D‚Ü‚½C–{ƒ\ƒtƒgƒEƒF
41 * ƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚½‚¢‚©‚Ȃ鑹ŠQ‚ÉŠÖ‚µ‚Ä‚àC‚»
42 * ‚̐ӔC‚𕉂í‚È‚¢D
43 *
44 */
45
46/*
47 * ƒVƒŠƒAƒ‹I/OƒfƒoƒCƒXiSIOjƒhƒ‰ƒCƒo
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) /* ŽóMƒR[ƒ‹ƒoƒbƒN‹–‰Â */
57#define TBIT_ENACB_SND UINT8_C(0x01) /* ‘—MƒR[ƒ‹ƒoƒbƒN‹–‰Â */
58
59/*
60 * Šeƒ|[ƒg‚ɑΉž‚·‚銄ž‚ݔԍ†C—Dæ“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// Š„ž‚Ý—v‹ƒ‰ƒCƒ“‘®«
72#define INTATR_SIOP1_RCV (0)
73#define INTATR_SIOP1_SND (0)
74
75/*
76 * ƒR[ƒ‹ƒoƒbƒNƒ‹[ƒ`ƒ“‚ÌŽ¯•Ê”ԍ†
77 */
78#define SIO_RDY_SND 1U /* ‘—M‰Â”\ƒR[ƒ‹ƒoƒbƒN */
79#define SIO_RDY_RCV 2U /* ŽóM’Ê’mƒR[ƒ‹ƒoƒbƒN */
80
81#ifndef TOPPERS_MACRO_ONLY
82
83/*
84 * ƒVƒŠƒAƒ‹I/Oƒ|[ƒgŠÇ—ƒuƒƒbƒN
85 */
86typedef struct sio_port_control_block {
87 intptr_t exinf; /* Šg’£î•ñ */
88 uint8_t enacb; /* ƒR[ƒ‹ƒoƒbƒN‰Â”ۂ̏ó‘Ô */
89};
90
91/*
92 * ƒVƒŠƒAƒ‹I/Oƒ|[ƒgŠÇ—ƒuƒƒbƒN‚Ì’è‹`
93 */
94typedef struct sio_port_control_block SIOPCB;
95
96/*
97 * SIO‰Šú‰»
98 */
99extern void sio_initialize(intptr_t exinf);
100
101/*
102 * ’჌ƒxƒ‹ƒVƒŠƒAƒ‹‰Šú‰»
103 */
104extern void target_sau_init(ID siopid);
105
106/*
107 * ƒVƒŠƒAƒ‹ƒI[ƒvƒ“
108 */
109extern SIOPCB *sio_opn_por(ID siopid, intptr_t exinf);
110
111/*
112 * ƒVƒŠƒAƒ‹ƒNƒ[ƒY
113 */
114extern void sio_cls_por(SIOPCB *p_siopcb);
115
116/*
117 * Š„ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“
118 */
119extern void sio_isr_rcv(intptr_t exinf);
120extern void sio_isr_snd(intptr_t exinf);
121
122/*
123 * 1•¶Žš‘—M
124 */
125extern bool_t sio_snd_chr(SIOPCB *siopcb, char c);
126
127/*
128 * 1•¶ŽšŽóM
129 */
130extern int_t sio_rcv_chr(SIOPCB *siopcb);
131
132/*
133 * ƒR[ƒ‹ƒoƒbƒN‚Ì‹–‰Â
134 */
135extern void sio_ena_cbr(SIOPCB *siopcb, uint_t cbrtn);
136
137/*
138 * ƒR[ƒ‹ƒoƒbƒN‚Ì‹ÖŽ~
139 */
140extern void sio_dis_cbr(SIOPCB *siopcb, uint_t cbrtn);
141
142/*
143 * ‘—M‰Â”\ƒR[ƒ‹ƒoƒbƒN
144 */
145extern void sio_irdy_snd(intptr_t exinf);
146
147/*
148 * ŽóM’Ê’mƒR[ƒ‹ƒoƒbƒN
149 */
150extern void sio_irdy_rcv(intptr_t exinf);
151
152/*
153 * 1•¶Žš‘—Miƒ|[ƒŠƒ“ƒO‚ł̏o—́j
154 */
155extern void sio_pol_snd_chr(char c, ID siopid);
156
157#endif /* TOPPERS_MACRO_ONLY */
158#endif /* TOPPERS_TARGET_SERIAL_H */
Note: See TracBrowser for help on using the repository browser.