source: UsbWattMeter/trunk/asp_dcre/pdic/rx600/rx630_uart.h@ 164

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

TOPPERS/ECNLサンプルアプリ「USB充電器電力計」を追加

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