source: uKadecot/trunk/ssp/pdic/rx600/rx630_uart.h@ 101

Last change on this file since 101 was 101, checked in by coas-nagasima, 8 years ago

TOPPERS/uKadecotのソースコードを追加

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/plain
File size: 4.0 KB
Line 
1/*
2 * TOPPERS/SSP Kernel
3 * Smallest Set Profile Kernel
4 *
5 * Copyright (C) 2008-2010 by Witz Corporation, JAPAN
6 * Copyright (C) 2013 by Mitsuhiro Matsuura
7 *
8 * ã‹L’˜ìŒ ŽÒ‚́CˆÈ‰º‚Ì(1)`(4)‚ÌðŒ‚ð–ž‚½‚·ê‡‚ÉŒÀ‚èC–{ƒ\ƒtƒgƒEƒF
9 * ƒAi–{ƒ\ƒtƒgƒEƒFƒA‚ð‰ü•Ï‚µ‚½‚à‚Ì‚ðŠÜ‚ށDˆÈ‰º“¯‚¶j‚ðŽg—pE•¡»E‰ü
10 * •ÏEÄ”z•ziˆÈ‰ºC—˜—p‚ƌĂԁj‚·‚邱‚Ƃ𖳏ž‚Å‹–‘ø‚·‚éD
11 * (1) –{ƒ\ƒtƒgƒEƒFƒA‚ðƒ\[ƒXƒR[ƒh‚ÌŒ`‚Å—˜—p‚·‚éê‡‚ɂ́Cã‹L‚Ì’˜ì
12 * Œ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’肪C‚»‚Ì‚Ü‚Ü‚ÌŒ`‚Ń\[
13 * ƒXƒR[ƒh’†‚ÉŠÜ‚Ü‚ê‚Ä‚¢‚邱‚ƁD
14 * (2) –{ƒ\ƒtƒgƒEƒFƒA‚ðCƒ‰ƒCƒuƒ‰ƒŠŒ`Ž®‚ȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
15 * —p‚Å‚«‚éŒ`‚ōĔz•z‚·‚éê‡‚ɂ́CÄ”z•z‚É”º‚¤ƒhƒLƒ…
16ƒƒ“ƒgi—˜—p
17 * ŽÒƒ}ƒjƒ…
18ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L
19 * ‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
20 * (3) –{ƒ\ƒtƒgƒEƒFƒA‚ðC‹@Ší‚É‘g‚ݍž‚ނȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
21 * —p‚Å‚«‚È‚¢Œ`‚ōĔz•z‚·‚éê‡‚ɂ́CŽŸ‚Ì‚¢‚¸‚ê‚©‚ÌðŒ‚ð–ž‚½‚·‚±
22 * ‚ƁD
23 * (a) Ä”z•z‚É”º‚¤ƒhƒLƒ…
24ƒƒ“ƒgi—˜—pŽÒƒ}ƒjƒ…
25ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜
26 * ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
27 * (b) Ä”z•z‚ÌŒ`‘Ô‚ðC•Ê‚É’è‚ß‚é•û–@‚É‚æ‚Á‚āCTOPPERSƒvƒƒWƒFƒNƒg‚É
28 * •ñ‚·‚邱‚ƁD
29 * (4) –{ƒ\ƒtƒgƒEƒFƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚é‚¢‚©‚Ȃ鑹
30 * ŠQ‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð–Ɛӂ·‚邱‚ƁD
31 * ‚Ü‚½C–{ƒ\ƒtƒgƒEƒFƒA‚̃†[ƒU‚Ü‚½‚̓Gƒ“ƒhƒ†[ƒU‚©‚ç‚Ì‚¢‚©‚Ȃ闝
32 * —R‚ÉŠî‚­¿‹‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð
33 * –Ɛӂ·‚邱‚ƁD
34 *
35 * –{ƒ\ƒtƒgƒEƒFƒA‚́C–³•ÛØ‚Å’ñ‹Ÿ‚³‚ê‚Ä‚¢‚é‚à‚Ì‚Å‚ ‚éDã‹L’˜ìŒ ŽÒ‚¨
36 * ‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚́C–{ƒ\ƒtƒgƒEƒFƒA‚ÉŠÖ‚µ‚āC“Á’è‚ÌŽg—p–Ú“I
37 * ‚ɑ΂·‚é“K‡«‚àŠÜ‚߂āC‚¢‚©‚È‚é•ÛØ‚às‚í‚È‚¢D‚Ü‚½C–{ƒ\ƒtƒgƒEƒF
38 * ƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚½‚¢‚©‚Ȃ鑹ŠQ‚ÉŠÖ‚µ‚Ä‚àC‚»
39 * ‚̐ӔC‚𕉂í‚È‚¢D
40 *
41 */
42
43/*
44 * UART—p ŠÈˆÕSIOƒhƒ‰ƒCƒo
45 */
46
47#ifndef TOPPERS_RX630_UART_H
48#define TOPPERS_RX630_UART_H
49
50/* Žw’è‰Â”\‚ȃNƒƒbƒNƒ\[ƒX */
51#define CLK_F1 UINT_C(0x00)
52#define CLK_F4 UINT_C(0x01)
53#define CLK_F16 UINT_C(0x02)
54#define CLK_F64 UINT_C(0x03)
55
56#ifndef TOPPERS_MACRO_ONLY
57
58/*
59 * ƒVƒŠƒAƒ‹I/Oƒ|[ƒgŠÇ—ƒuƒƒbƒN‚Ì’è‹`
60 */
61typedef struct sio_port_control_block SIOPCB;
62
63/*
64 * ƒR[ƒ‹ƒoƒbƒNƒ‹[ƒ`ƒ“‚ÌŽ¯•Ê”ԍ†
65 */
66#define SIO_RDY_SND (1U) /* ‘—M‰Â”\ƒR[ƒ‹ƒoƒbƒN */
67#define SIO_RDY_RCV (2U) /* ŽóM’Ê’mƒR[ƒ‹ƒoƒbƒN */
68
69/*
70 * SIOƒhƒ‰ƒCƒo‚̏‰Šú‰»ƒ‹[ƒ`ƒ“
71 */
72extern void rx630_uart_initialize(void);
73
74/*
75 * ƒJ[ƒlƒ‹‹N“®Žž‚̃oƒi[o—Í—p‚̏‰Šú‰»
76 */
77extern void rx630_uart_init(ID siopid , uint8_t baud , uint8_t clksrc);
78
79/*
80 * ƒVƒŠƒAƒ‹I/Oƒ|[ƒg‚ւ̃|[ƒŠƒ“ƒO‚ł̏o—Í
81 */
82extern void rx630_uart_pol_putc(char c, ID siopid);
83
84/*
85 * ƒVƒŠƒAƒ‹I/Oƒ|[ƒg‚̃I[ƒvƒ“
86 */
87extern SIOPCB *rx630_uart_opn_por
88 (ID siopid, intptr_t exinf , uint8_t baud , uint8_t clksrc);
89
90/*
91 * ƒVƒŠƒAƒ‹I/Oƒ|[ƒg‚̃Nƒ[ƒY
92 */
93extern void rx630_uart_cls_por(SIOPCB *p_siopcb);
94
95/*
96 * ƒVƒŠƒAƒ‹I/Oƒ|[ƒg‚Ö‚Ì•¶Žš‘—M
97 */
98extern bool_t rx630_uart_snd_chr(SIOPCB *p_siopcb, char c);
99
100/*
101 * ƒVƒŠƒAƒ‹I/Oƒ|[ƒg‚©‚ç‚Ì•¶ŽšŽóM
102 */
103extern int_t rx630_uart_rcv_chr(SIOPCB *p_siopcb);
104
105/*
106 * ƒVƒŠƒAƒ‹I/Oƒ|[ƒg‚©‚ç‚̃R[ƒ‹ƒoƒbƒN‚Ì‹–‰Â
107 */
108extern void rx630_uart_ena_cbr(SIOPCB *p_siopcb, uint_t cbrtn);
109
110/*
111 * ƒVƒŠƒAƒ‹I/Oƒ|[ƒg‚©‚ç‚̃R[ƒ‹ƒoƒbƒN‚Ì‹ÖŽ~
112 */
113extern void rx630_uart_dis_cbr(SIOPCB *p_siopcb, uint_t cbrtn);
114
115/*
116 * SIO‚ÌŠ„ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“
117 */
118extern void rx630_uart_tx_isr(ID siopid);
119extern void rx630_uart_rx_isr(ID siopid);
120
121/*
122 * ƒVƒŠƒAƒ‹I/Oƒ|[ƒg‚©‚ç‚Ì‘—M‰Â”\ƒR[ƒ‹ƒoƒbƒN
123 */
124extern void rx630_uart_irdy_snd(intptr_t exinf);
125
126/*
127 * ƒVƒŠƒAƒ‹I/Oƒ|[ƒg‚©‚ç‚ÌŽóM’Ê’mƒR[ƒ‹ƒoƒbƒN
128 */
129extern void rx630_uart_irdy_rcv(intptr_t exinf);
130
131
132/*
133 * ƒ|[ƒg”ԍ†‚©‚çŠÇ—ƒuƒƒbƒN‚̐擪”Ô’n‚Ö‚Ì•ÏŠ·
134 */
135extern SIOPCB *rx630_uart_get_siopcb(ID siopid);
136
137/*
138 * ŠÇ—ƒuƒƒbƒN‚̐擪”Ô’n‚©‚çŽóMŠ„ž‚ݔԍ†‚Ö‚Ì•ÏŠ·
139 */
140extern INTNO rx630_uart_intno_rx(SIOPCB *p_siopcb);
141
142/*
143 * ŠÇ—ƒuƒƒbƒN‚̐擪”Ô’n‚©‚ç‘—MŠ„ž‚ݔԍ†‚Ö‚Ì•ÏŠ·
144 */
145extern INTNO rx630_uart_intno_tx(SIOPCB *p_siopcb);
146
147
148#endif /* TOPPERS_MACRO_ONLY */
149#endif /* TOPPERS_RX630_UART_H */
Note: See TracBrowser for help on using the repository browser.