source: ssp_qb_r5f100le_cs/trunk/target/qb_r5f100le_cs/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.7 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) 2003-2004 by Platform Development Center
8 * RICOH COMPANY,LTD. JAPAN
9 * Copyright (C) 2003-2015 by Naoki Saito
10 * Nagoya Municipal Industrial Research Institute, JAPAN
11 *
12 * ã‹L’˜ìŒ ŽÒ‚́CˆÈ‰º‚Ì (1)`(4) ‚ÌðŒ‚ð–ž‚½‚·ê‡‚ÉŒÀ‚èC–{ƒ\ƒtƒgƒEƒF
13 * ƒAi–{ƒ\ƒtƒgƒEƒFƒA‚ð‰ü•Ï‚µ‚½‚à‚Ì‚ðŠÜ‚ށDˆÈ‰º“¯‚¶j‚ðŽg—pE•¡»E‰ü•ÏE
14 * Ä”z•ziˆÈ‰ºC—˜—p‚ƌĂԁj‚·‚邱‚Ƃ𖳏ž‚Å‹–‘ø‚·‚éD
15 * (1) –{ƒ\ƒtƒgƒEƒFƒA‚ðƒ\[ƒXƒR[ƒh‚ÌŒ`‚Å—˜—p‚·‚éê‡‚ɂ́Cã‹L‚Ì’˜ìŒ 
16 * •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’肪C‚»‚Ì‚Ü‚Ü‚ÌŒ`‚Ń\[ƒX
17 * ƒR[ƒh’†‚ÉŠÜ‚Ü‚ê‚Ä‚¢‚邱‚ƁD
18 * (2) –{ƒ\ƒtƒgƒEƒFƒA‚ðCƒ‰ƒCƒuƒ‰ƒŠŒ`Ž®‚ȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg—p
19 * ‚Å‚«‚éŒ`‚ōĔz•z‚·‚éê‡‚ɂ́CÄ”z•z‚É”º‚¤ƒhƒLƒ…
20ƒƒ“ƒgi—˜—pŽÒƒ}
21 * ƒjƒ…
22ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•Û
23 * Ø‹K’è‚ðŒfÚ‚·‚邱‚ƁD
24 * (3) –{ƒ\ƒtƒgƒEƒFƒA‚ðC‹@Ší‚É‘g‚ݍž‚ނȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg—p
25 * ‚Å‚«‚È‚¢Œ`‚ōĔz•z‚·‚éê‡‚ɂ́CŽŸ‚Ì‚¢‚¸‚ê‚©‚ÌðŒ‚ð–ž‚½‚·‚±‚Ɓ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‚ɐ¶‚¶‚é‚¢‚©‚Ȃ鑹ŠQ
33 * ‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð–Ɛӂ·‚邱‚ƁD‚Ü‚½C
34 * –{ƒ\ƒtƒgƒEƒFƒA‚̃†[ƒU‚Ü‚½‚̓Gƒ“ƒhƒ†[ƒU‚©‚ç‚Ì‚¢‚©‚Ȃ闝—R‚ÉŠî‚Ã
35 * ‚­¿‹‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð–Ɛӂ·‚邱‚ƁD
36 *
37 * –{ƒ\ƒtƒgƒEƒFƒA‚́C–³•ÛØ‚Å’ñ‹Ÿ‚³‚ê‚Ä‚¢‚é‚à‚Ì‚Å‚ ‚éDã‹L’˜ìŒ ŽÒ‚¨‚æ
38 * ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚́C–{ƒ\ƒtƒgƒEƒFƒA‚ÉŠÖ‚µ‚āC“Á’è‚ÌŽg—p–Ú“I‚ɑ΂·
39 * ‚é“K‡«‚àŠÜ‚߂āC‚¢‚©‚È‚é•ÛØ‚às‚í‚È‚¢D‚Ü‚½C–{ƒ\ƒtƒgƒEƒFƒA‚Ì—˜—p
40 * ‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚½‚¢‚©‚Ȃ鑹ŠQ‚ÉŠÖ‚µ‚Ä‚àC‚»‚̐ӔC‚ð•‰
41 * ‚í‚È‚¢D
42 *
43 */
44
45/*
46 * ƒ^[ƒQƒbƒgƒVƒXƒeƒ€ˆË‘¶ƒ‚ƒWƒ…
47[ƒ‹iQB-R5F100LE—pj
48 */
49#pragma sfr
50#pragma NOP
51#include "kernel_impl.h"
52
53/*
54 * ƒ^[ƒQƒbƒgƒVƒXƒeƒ€ˆË‘¶ ‰Šú‰»ƒ‹[ƒ`ƒ“
55 */
56
57void
58target_initialize(void)
59{
60 /*
61 * ƒvƒƒZƒbƒTˆË‘¶‚̏‰Šú‰»
62 */
63 prc_initialize();
64
65 /*
66 * ƒNƒƒbƒNÝ’è
67 */
68 // X1”­Mƒ‚[ƒhC’áÁ”ï”­UCAMPH=1(‚‘¬ƒNƒƒbƒN)
69 CMC = UINT8_C(0x51);
70
71 // ƒNƒƒbƒN“®ìƒXƒe[ƒ^ƒX§ŒäƒŒƒWƒXƒ^(X1ŠJŽnCXT1’âŽ~, ƒIƒ“ƒ`ƒbƒvƒIƒVƒŒ[ƒ^“®ì)
72 CSC = UINT8_C(0x40);
73
74 // ”­U‚ªˆÀ’è‚·‚é‚Ü‚Å‚ÌŽžŠÔ‚¾‚¯‘Ò‚Â
75 while((OSTC & UINT8_C(0x01)) == 0){}
76
77 // ƒVƒXƒeƒ€ƒNƒƒbƒN§ŒäƒŒƒWƒXƒ^
78 CKC &= ~UINT8_C(0x40); // CPU/Žü•Óƒn[ƒhƒEƒFƒAƒNƒƒbƒN‚ɃƒCƒ“ƒVƒXƒeƒ€ƒNƒƒbƒN
79 CKC |= UINT8_C(0x10); // ƒƒCƒ“ƒVƒXƒeƒ€ƒNƒƒbƒN‚ɍ‚‘¬ƒVƒXƒeƒ€ƒNƒƒbƒN
80 CKC &= ~UINT8_C(0x0f); // •K‚¸0‚ɐݒè
81
82 // ƒNƒƒbƒN“®ìƒXƒe[ƒ^ƒX§ŒäƒŒƒWƒXƒ^
83 CSC |= UINT8_C(0x01); // ‚‘¬ƒIƒ“ƒ`ƒbƒvƒIƒVƒŒ[ƒ^’âŽ~
84
85 /*
86 * UART—pƒsƒ“Ý’è
87 */
88 // RXDCTXD ‚É P11, P12 ‚ðŽg—p
89 PIOR &= ~TBIT_PIOR_PIOR1;
90
91 // P11(RxD0) ‚ð“ü—͂ɐݒè
92 PM1 |= UINT8_C(0x02);
93
94 // P12(TxD0) ‚ðH‚ɐݒ肵‚Ä‚¨‚­
95 P1 |= UINT8_C(0x04);
96
97 // P12(TxD0) ‚ðo—͂ɐݒè
98 PM1 &= ~UINT8_C(0x04);
99
100 /*
101 * UART‚̐ݒè
102 */
103 target_sau_init(1);
104}
105
106
107/*
108 * ƒ^[ƒQƒbƒgƒVƒXƒeƒ€‚̏I—¹ƒ‹[ƒ`ƒ“
109 */
110
111void
112target_exit(void)
113{
114 /* CPUˆË‘¶‚̏I—¹ƒ‹[ƒ`ƒ“ */
115 prc_terminate();
116
117 while (true)
118 {
119 }
120}
121
122/*
123 * ƒVƒXƒeƒ€ƒƒO‚̒჌ƒxƒ‹o—Í‚Ì‚½‚ß‚Ì•¶Žšo—Í
124 */
125void target_fput_log(char c)
126{
127 if (c == '\n') {
128 sys_putc('\r', LOGTASK_PORTID);
129 }
130 sys_putc(c, LOGTASK_PORTID);
131}
132
133/*
134 * ƒAƒT[ƒVƒ‡ƒ“‚ÌŽ¸”sŽž‚ÌŽÀs’†’fˆ—
135 */
136void
137TOPPERS_assert_abort(void)
138{
139 while(1)
140 {
141 }
142}
Note: See TracBrowser for help on using the repository browser.