source: ssp_qb_r5f100le_cs/trunk/target/cq_frk_fm3_gcc/target_config.c@ 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: 3.9 KB
RevLine 
[93]1/*
2 * TOPPERS/SSP Kernel
3 * Smallest Set Profile Kernel
4 *
5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
6 * Toyohashi Univ. of Technology, JAPAN
7 * Copyright (C) 2005-2007 by Embedded and Real-Time Systems Laboratory
8 * Graduate School of Information Science, Nagoya Univ., JAPAN
9 * Copyright (C) 2012 Meika Sugimoto
10 * Copyright (C) 2015 by Naoki Saito
11 * Nagoya Municipal Industrial Research Institute, JAPAN
12 *
13 * ã‹L’˜ìŒ ŽÒ‚́CˆÈ‰º‚Ì(1)`(4)‚ÌðŒ‚ð–ž‚½‚·ê‡‚ÉŒÀ‚èC–{ƒ\ƒtƒgƒEƒF
14 * ƒAi–{ƒ\ƒtƒgƒEƒFƒA‚ð‰ü•Ï‚µ‚½‚à‚Ì‚ðŠÜ‚ށDˆÈ‰º“¯‚¶j‚ðŽg—pE•¡»E‰ü
15 * •ÏEÄ”z•ziˆÈ‰ºC—˜—p‚ƌĂԁj‚·‚邱‚Ƃ𖳏ž‚Å‹–‘ø‚·‚éD
16 * (1) –{ƒ\ƒtƒgƒEƒFƒA‚ðƒ\[ƒXƒR[ƒh‚ÌŒ`‚Å—˜—p‚·‚éê‡‚ɂ́Cã‹L‚Ì’˜ì
17 * Œ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’肪C‚»‚Ì‚Ü‚Ü‚ÌŒ`‚Ń\[
18 * ƒXƒR[ƒh’†‚ÉŠÜ‚Ü‚ê‚Ä‚¢‚邱‚ƁD
19 * (2) –{ƒ\ƒtƒgƒEƒFƒA‚ðCƒ‰ƒCƒuƒ‰ƒŠŒ`Ž®‚ȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
20 * —p‚Å‚«‚éŒ`‚ōĔz•z‚·‚éê‡‚ɂ́CÄ”z•z‚É”º‚¤ƒhƒLƒ…
21ƒƒ“ƒgi—˜—p
22 * ŽÒƒ}ƒjƒ…
23ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L
24 * ‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
25 * (3) –{ƒ\ƒtƒgƒEƒFƒA‚ðC‹@Ší‚É‘g‚ݍž‚ނȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
26 * —p‚Å‚«‚È‚¢Œ`‚ōĔz•z‚·‚éê‡‚ɂ́CŽŸ‚Ì‚¢‚¸‚ê‚©‚ÌðŒ‚ð–ž‚½‚·‚±
27 * ‚ƁD
28 * (a) Ä”z•z‚É”º‚¤ƒhƒLƒ…
29ƒƒ“ƒgi—˜—pŽÒƒ}ƒjƒ…
30ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜
31 * ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
32 * (b) Ä”z•z‚ÌŒ`‘Ô‚ðC•Ê‚É’è‚ß‚é•û–@‚É‚æ‚Á‚āCTOPPERSƒvƒƒWƒFƒNƒg‚É
33 * •ñ‚·‚邱‚ƁD
34 * (4) –{ƒ\ƒtƒgƒEƒFƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚é‚¢‚©‚Ȃ鑹
35 * ŠQ‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð–Ɛӂ·‚邱‚ƁD
36 * ‚Ü‚½C–{ƒ\ƒtƒgƒEƒFƒA‚̃†[ƒU‚Ü‚½‚̓Gƒ“ƒhƒ†[ƒU‚©‚ç‚Ì‚¢‚©‚Ȃ闝
37 * —R‚ÉŠî‚­¿‹‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð
38 * –Ɛӂ·‚邱‚ƁD
39 *
40 * –{ƒ\ƒtƒgƒEƒFƒA‚́C–³•ÛØ‚Å’ñ‹Ÿ‚³‚ê‚Ä‚¢‚é‚à‚Ì‚Å‚ ‚éDã‹L’˜ìŒ ŽÒ‚¨
41 * ‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚́C–{ƒ\ƒtƒgƒEƒFƒA‚ÉŠÖ‚µ‚āC“Á’è‚ÌŽg—p–Ú“I
42 * ‚ɑ΂·‚é“K‡«‚àŠÜ‚߂āC‚¢‚©‚È‚é•ÛØ‚às‚í‚È‚¢D‚Ü‚½C–{ƒ\ƒtƒgƒEƒF
43 * ƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚½‚¢‚©‚Ȃ鑹ŠQ‚ÉŠÖ‚µ‚Ä‚àC‚»
44 * ‚̐ӔC‚𕉂í‚È‚¢D
45 *
46 */
47
48/*
49 * ƒ^[ƒQƒbƒgˆË‘¶ƒ‚ƒWƒ…
50[ƒ‹(CQ-FRM-FM3—p)
51 */
52#include "kernel_impl.h"
53#include <sil.h>
54#include "target_serial.h"
55#include "target_syssvc.h"
56
57/*
58 * ƒ^[ƒQƒbƒgƒVƒXƒeƒ€‚̃n[ƒhƒEƒFƒAŽ‘Œ¹‚Ì’è‹`
59 */
60#include "cq_frm_fm3.h"
61
62
63/*
64 * ƒ^[ƒQƒbƒgˆË‘¶•”@‰Šú‰»ˆ—
65 */
66void target_initialize(void)
67{
68 /*
69 * ƒvƒƒZƒbƒTˆË‘¶•”‚̏‰Šú‰»
70 */
71 prc_initialize();
72
73 /*
74 * ƒyƒŠƒtƒFƒ‰ƒ‹‚̐ݒè
75 */
76
77 /*
78 * ƒn[ƒhƒEƒFƒAWDT–³Œø‰»
79 */
80 sil_wrw_mem((void *)WDG_LCK , WDG_UNLOCK_VAL);
81 sil_wrw_mem((void *)WDG_LCK , ~WDG_UNLOCK_VAL);
82 sil_wrw_mem((void *)WDG_CTL , (WDG_RESDIS | WDG_RESINTDIS));
83
84 /*
85 * I/Oƒ|[ƒg‚̏‰Šú‰»
86 */
87#if (SIO_PORTID == 1)
88 /* PFR‚̐ݒè */
89
90 /* MFS(RX,TX) CH0 */
91 sil_andw((void *)EPFR7 , ~(0x03 << 2)); /* SIN0_0 , SOT0_0‚ðŽg—p */
92 sil_orw((void *)EPFR7 , (0x01 << 6)); /* SIN0_0 , SOT0_0‚ðŽg—p */
93
94 /* P21(SIN),P22(SOT) */
95 sil_orw((void *)PFR2 , (1 << 1) | (1 << 2));
96 sil_andw((void *)ADE , ~(1 << 31));
97
98#elif (SIO_PORTID == 2)
99 /* USART2(RX,TX) CH2 */
100 sil_andw((void *)EPFR8 , ~(0x03 << 6)); /* SIN4_2‚ðŽg—p */
101 sil_orw((void *)EPFR8 , (0x03 << 6)); /* SIN4_2 , SOT4_2‚ðŽg—p */
102
103 /* PD2(SIN),PD3(SOT) */
104 sil_orw((void *)PFR0 , (1 << 5) | (1 << 6));
105
106#endif
107
108 /*
109 * ƒoƒi[o—Í—p‚̃VƒŠƒAƒ‹‰Šú‰»
110 */
111
112 target_low_output_init(SIO_PORTID);
113 sil_dly_nse(10 * 1000 * 1000);
114
115 /* LEDƒ|[ƒg */
116 sil_andw((void *)PFRF , ~BITMAP_3);
117 sil_orw((void *)PDDRF , BITMAP_3);
118 sil_andw((void *)PDORF , ~BITMAP_3);
119
120}
121
122/*
123 * ƒ^[ƒQƒbƒgˆË‘¶•” I—¹ˆ—
124 */
125void target_exit(void)
126{
127 /* ƒvƒƒZƒbƒTˆË‘¶•”‚̏I—¹ˆ— */
128 prc_terminate();
129}
130
131/*
132 * ƒVƒXƒeƒ€ƒƒO‚̒჌ƒxƒ‹o—Í‚Ì‚½‚ß‚Ì•¶Žšo—Í
133 */
134void target_fput_log(char c)
135{
136 if (c == '\n') {
137 sio_pol_snd_chr('\r', SIO_PORTID);
138 }
139 sio_pol_snd_chr(c, SIO_PORTID);
140}
141
142
Note: See TracBrowser for help on using the repository browser.