source: UsbWattMeter/trunk/asp_dcre/arch/rx630_msvc/prc_sil.h@ 164

Last change on this file since 164 was 164, checked in by coas-nagasima, 6 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: 3.9 KB
Line 
1/*
2 * TOPPERS Software
3 * Toyohashi Open Platform for Embedded Real-Time Systems
4 *
5 * Copyright (C) 2008-2010 by Witz Corporation, JAPAN
6 *
7 * ã‹L’˜ìŒ ŽÒ‚́CˆÈ‰º‚Ì(1)`(4)‚ÌðŒ‚ð–ž‚½‚·ê‡‚ÉŒÀ‚èC–{ƒ\ƒtƒgƒEƒF
8 * ƒAi–{ƒ\ƒtƒgƒEƒFƒA‚ð‰ü•Ï‚µ‚½‚à‚Ì‚ðŠÜ‚ށDˆÈ‰º“¯‚¶j‚ðŽg—pE•¡»E‰ü
9 * •ÏEÄ”z•ziˆÈ‰ºC—˜—p‚ƌĂԁj‚·‚邱‚Ƃ𖳏ž‚Å‹–‘ø‚·‚éD
10 * (1) –{ƒ\ƒtƒgƒEƒFƒA‚ðƒ\[ƒXƒR[ƒh‚ÌŒ`‚Å—˜—p‚·‚éê‡‚ɂ́Cã‹L‚Ì’˜ì
11 * Œ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’肪C‚»‚Ì‚Ü‚Ü‚ÌŒ`‚Ń\[
12 * ƒXƒR[ƒh’†‚ÉŠÜ‚Ü‚ê‚Ä‚¢‚邱‚ƁD
13 * (2) –{ƒ\ƒtƒgƒEƒFƒA‚ðCƒ‰ƒCƒuƒ‰ƒŠŒ`Ž®‚ȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
14 * —p‚Å‚«‚éŒ`‚ōĔz•z‚·‚éê‡‚ɂ́CÄ”z•z‚É”º‚¤ƒhƒLƒ…
15ƒƒ“ƒgi—˜—p
16 * ŽÒƒ}ƒjƒ…
17ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L
18 * ‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
19 * (3) –{ƒ\ƒtƒgƒEƒFƒA‚ðC‹@Ší‚É‘g‚ݍž‚ނȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
20 * —p‚Å‚«‚È‚¢Œ`‚ōĔz•z‚·‚éê‡‚ɂ́CŽŸ‚Ì‚¢‚¸‚ê‚©‚ÌðŒ‚ð–ž‚½‚·‚±
21 * ‚ƁD
22 * (a) Ä”z•z‚É”º‚¤ƒhƒLƒ…
23ƒƒ“ƒgi—˜—pŽÒƒ}ƒjƒ…
24ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜
25 * ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
26 * (b) Ä”z•z‚ÌŒ`‘Ô‚ðC•Ê‚É’è‚ß‚é•û–@‚É‚æ‚Á‚āCTOPPERSƒvƒƒWƒFƒNƒg‚É
27 * •ñ‚·‚邱‚ƁD
28 * (4) –{ƒ\ƒtƒgƒEƒFƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚é‚¢‚©‚Ȃ鑹
29 * ŠQ‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð–Ɛӂ·‚邱‚ƁD
30 * ‚Ü‚½C–{ƒ\ƒtƒgƒEƒFƒA‚̃†[ƒU‚Ü‚½‚̓Gƒ“ƒhƒ†[ƒU‚©‚ç‚Ì‚¢‚©‚Ȃ闝
31 * —R‚ÉŠî‚­¿‹‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð
32 * –Ɛӂ·‚邱‚ƁD
33 *
34 * –{ƒ\ƒtƒgƒEƒFƒA‚́C–³•ÛØ‚Å’ñ‹Ÿ‚³‚ê‚Ä‚¢‚é‚à‚Ì‚Å‚ ‚éDã‹L’˜ìŒ ŽÒ‚¨
35 * ‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚́C–{ƒ\ƒtƒgƒEƒFƒA‚ÉŠÖ‚µ‚āC“Á’è‚ÌŽg—p–Ú“I
36 * ‚ɑ΂·‚é“K‡«‚àŠÜ‚߂āC‚¢‚©‚È‚é•ÛØ‚às‚í‚È‚¢D‚Ü‚½C–{ƒ\ƒtƒgƒEƒF
37 * ƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚½‚¢‚©‚Ȃ鑹ŠQ‚ÉŠÖ‚µ‚Ä‚àC‚»
38 * ‚̐ӔC‚𕉂í‚È‚¢D
39 *
40 * @(#) $Id: prc_sil.h 164 2016-03-07 11:33:50Z coas-nagasima $
41 */
42
43/*
44 * sil.h‚̃vƒƒZƒbƒTˆË‘¶•”iRX630—pj
45 */
46
47#ifndef TOPPERS_PRC_SIL_H
48#define TOPPERS_PRC_SIL_H
49
50#define TOPPERS_OMIT_SIL_ACCESS
51
52#ifndef TOPPERS_MACRO_ONLY
53#include "prc_insn.h"
54
55
56/*
57 * 8ƒrƒbƒg’PˆÊ‚̓Ǐo‚µ^‘ž‚Ý
58 */
59#ifdef UINT8_MAX
60
61extern uint8_t sil_reb_mem(volatile uint8_t *mem);
62extern void sil_wrb_mem(volatile uint8_t *mem, uint8_t data);
63
64#endif /* UINT8_MAX */
65
66/*
67 * 16ƒrƒbƒg’PˆÊ‚̓Ǐo‚µ^‘ž‚Ý
68 */
69
70extern uint16_t sil_reh_mem(volatile uint16_t *mem);
71extern void sil_wrh_mem(volatile uint16_t *mem, uint16_t data);
72
73#define sil_reh_lem(mem) sil_reh_mem(mem)
74#define sil_wrh_lem(mem, data) sil_wrh_mem(mem, data)
75
76extern uint16_t sil_reh_bem(volatile uint16_t *mem);
77extern void sil_wrh_bem(volatile uint16_t *mem, uint16_t data);
78
79/*
80 * 32ƒrƒbƒg’PˆÊ‚̓Ǐo‚µ^‘ž‚Ý
81 */
82
83extern uint32_t sil_rew_mem(volatile uint32_t *mem);
84extern void sil_wrw_mem(volatile uint32_t *mem, uint32_t data);
85
86#define sil_rew_lem(mem) sil_rew_mem(mem)
87#define sil_wrw_lem(mem, data) sil_wrw_mem(mem, data)
88
89extern uint32_t sil_rew_bem(volatile uint32_t *mem);
90extern void sil_wrw_bem(volatile uint32_t *mem, uint32_t data);
91
92/*
93 * ‘SŠ„ž‚Ý‹ÖŽ~
94 */
95Inline uint32_t
96TOPPERS_disint( void )
97{
98 volatile uint32_t TOPPERS_psw;
99
100 TOPPERS_psw = current_psw();
101 disint();
102
103 return( TOPPERS_psw );
104}
105
106
107/*
108 * ‘SŠ„ž‚Ý‹–‰Â
109 */
110Inline void
111TOPPERS_enaint( uint32_t TOPPERS_psw )
112{
113 //if((TOPPERS_psw & PSW_I_MASK) != 0){
114 enaint();
115 //}
116}
117
118
119/*
120 * ‘SŠ„ž‚݃ƒbƒNó‘Ԃ̐§Œä
121 */
122#define SIL_PRE_LOC uint32_t TOPPERS_i_psw;
123#define SIL_LOC_INT() ( ( void )( TOPPERS_i_psw = TOPPERS_disint() ) )
124#define SIL_UNL_INT() ( TOPPERS_enaint( TOPPERS_i_psw ) )
125
126
127/*
128 * ƒGƒ“ƒfƒBƒAƒ“‚Ì”½“]
129 *
130 * –{ŠJ”­ŠÂ‹«‚ł̓Gƒ“ƒfƒBƒAƒ“•ÏŠ·–½—ß‚ª‘¶Ý‚·‚邽‚ß,
131 * ƒA[ƒLƒeƒNƒ`ƒƒˆË‘¶•”‚ɂă}ƒNƒ‚ðã‘‚«‚·‚é.
132 */
133#define TOPPERS_SIL_REV_ENDIAN_UINT16( data ) \
134 rev_endian_uint16( data )
135#define TOPPERS_SIL_REV_ENDIAN_UINT32( data ) \
136 rev_endian_uint32( data )
137
138
139/*
140 * ”÷­ŽžŠÔ‘Ò‚¿
141 */
142extern void sil_dly_nse( ulong_t dlytim );
143
144#endif /* TOPPERS_MACRO_ONLY */
145
146
147/*
148 * ƒvƒƒZƒbƒT‚̃Gƒ“ƒfƒBƒAƒ“
149 */
150#define SIL_ENDIAN_LITTLE /* ƒŠƒgƒ‹ƒGƒ“ƒfƒBƒAƒ“ */
151
152
153#endif /* TOPPERS_PRC_SIL_H */
Note: See TracBrowser for help on using the repository browser.