##// END OF EJS Templates
SD card Library started, SDCARD init and detection OK
jeandet -
r10:75324080a75f default
parent child
Show More
@@ -1,530 +1,530
1 This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6) (format=pdflatex 2011.9.8) 24 DEC 2011 03:00
1 This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6) (format=pdflatex 2011.9.8) 6 JAN 2012 16:08
2 entering extended mode
2 entering extended mode
3 %&-line parsing enabled.
3 %&-line parsing enabled.
4 **PortingGuide.tex
4 **PortingGuide.tex
5 (./PortingGuide.tex
5 (./PortingGuide.tex
6 LaTeX2e <2005/12/01>
6 LaTeX2e <2005/12/01>
7 Babel <v3.8h> and hyphenation patterns for english, usenglishmax, dumylang, noh
7 Babel <v3.8h> and hyphenation patterns for english, usenglishmax, dumylang, noh
8 yphenation, arabic, basque, bulgarian, coptic, welsh, czech, slovak, german, ng
8 yphenation, arabic, basque, bulgarian, coptic, welsh, czech, slovak, german, ng
9 erman, danish, esperanto, spanish, catalan, galician, estonian, farsi, finnish,
9 erman, danish, esperanto, spanish, catalan, galician, estonian, farsi, finnish,
10 french, greek, monogreek, ancientgreek, croatian, hungarian, interlingua, ibyc
10 french, greek, monogreek, ancientgreek, croatian, hungarian, interlingua, ibyc
11 us, indonesian, icelandic, italian, latin, mongolian, dutch, norsk, polish, por
11 us, indonesian, icelandic, italian, latin, mongolian, dutch, norsk, polish, por
12 tuguese, pinyin, romanian, russian, slovenian, uppersorbian, serbian, swedish,
12 tuguese, pinyin, romanian, russian, slovenian, uppersorbian, serbian, swedish,
13 turkish, ukenglish, ukrainian, loaded.
13 turkish, ukenglish, ukrainian, loaded.
14 \@input{../../latex/header.aux}
14 \@input{../../latex/header.aux}
15 ! I can't write on file `../../latex/header.aux'.
15 ! I can't write on file `../../latex/header.aux'.
16 \@include ...\immediate \openout \@partaux #1.aux
16 \@include ...\immediate \openout \@partaux #1.aux
17 \immediate \write \@partau...
17 \immediate \write \@partau...
18 l.1 \include{../../latex/header}
18 l.1 \include{../../latex/header}
19
19
20 Please type another output file name:
20 Please type another output file name:
21 \openout2 = `header.tex'.
21 \openout2 = `header.tex'.
22
22
23 (../../latex/header.tex (/usr/share/texmf/tex/latex/base/book.cls
23 (../../latex/header.tex (/usr/share/texmf/tex/latex/base/book.cls
24 Document Class: book 2005/09/16 v1.4f Standard LaTeX document class
24 Document Class: book 2005/09/16 v1.4f Standard LaTeX document class
25 (/usr/share/texmf/tex/latex/base/bk10.clo
25 (/usr/share/texmf/tex/latex/base/bk10.clo
26 File: bk10.clo 2005/09/16 v1.4f Standard LaTeX file (size option)
26 File: bk10.clo 2005/09/16 v1.4f Standard LaTeX file (size option)
27 )
27 )
28 \c@part=\count79
28 \c@part=\count79
29 \c@chapter=\count80
29 \c@chapter=\count80
30 \c@section=\count81
30 \c@section=\count81
31 \c@subsection=\count82
31 \c@subsection=\count82
32 \c@subsubsection=\count83
32 \c@subsubsection=\count83
33 \c@paragraph=\count84
33 \c@paragraph=\count84
34 \c@subparagraph=\count85
34 \c@subparagraph=\count85
35 \c@figure=\count86
35 \c@figure=\count86
36 \c@table=\count87
36 \c@table=\count87
37 \abovecaptionskip=\skip41
37 \abovecaptionskip=\skip41
38 \belowcaptionskip=\skip42
38 \belowcaptionskip=\skip42
39 \bibindent=\dimen102
39 \bibindent=\dimen102
40 )
40 )
41 (/usr/share/texmf/tex/latex/base/inputenc.sty
41 (/usr/share/texmf/tex/latex/base/inputenc.sty
42 Package: inputenc 2006/05/05 v1.1b Input encoding file
42 Package: inputenc 2006/05/05 v1.1b Input encoding file
43 \inpenc@prehook=\toks14
43 \inpenc@prehook=\toks14
44 \inpenc@posthook=\toks15
44 \inpenc@posthook=\toks15
45
45
46 (/usr/share/texmf/tex/latex/base/utf8.def
46 (/usr/share/texmf/tex/latex/base/utf8.def
47 File: utf8.def 2006/03/30 v1.1i UTF-8 support for inputenc
47 File: utf8.def 2006/03/30 v1.1i UTF-8 support for inputenc
48 Now handling font encoding OML ...
48 Now handling font encoding OML ...
49 ... no UTF-8 mapping file for font encoding OML
49 ... no UTF-8 mapping file for font encoding OML
50 Now handling font encoding T1 ...
50 Now handling font encoding T1 ...
51 ... processing UTF-8 mapping file for font encodingT1
51 ... processing UTF-8 mapping file for font encodingT1
52
52
53 (/usr/share/texmf/tex/latex/base/t1enc.dfu
53 (/usr/share/texmf/tex/latex/base/t1enc.dfu
54 File: t1enc.dfu 2006/03/30 v1.1i UTF-8 support for inputenc
54 File: t1enc.dfu 2006/03/30 v1.1i UTF-8 support for inputenc
55 defining Unicode char U+00A1 (decimal 161)
55 defining Unicode char U+00A1 (decimal 161)
56 defining Unicode char U+00A3 (decimal 163)
56 defining Unicode char U+00A3 (decimal 163)
57 defining Unicode char U+00AB (decimal 171)
57 defining Unicode char U+00AB (decimal 171)
58 defining Unicode char U+00BB (decimal 187)
58 defining Unicode char U+00BB (decimal 187)
59 defining Unicode char U+00BF (decimal 191)
59 defining Unicode char U+00BF (decimal 191)
60 defining Unicode char U+00C0 (decimal 192)
60 defining Unicode char U+00C0 (decimal 192)
61 defining Unicode char U+00C1 (decimal 193)
61 defining Unicode char U+00C1 (decimal 193)
62 defining Unicode char U+00C2 (decimal 194)
62 defining Unicode char U+00C2 (decimal 194)
63 defining Unicode char U+00C3 (decimal 195)
63 defining Unicode char U+00C3 (decimal 195)
64 defining Unicode char U+00C4 (decimal 196)
64 defining Unicode char U+00C4 (decimal 196)
65 defining Unicode char U+00C5 (decimal 197)
65 defining Unicode char U+00C5 (decimal 197)
66 defining Unicode char U+00C6 (decimal 198)
66 defining Unicode char U+00C6 (decimal 198)
67 defining Unicode char U+00C7 (decimal 199)
67 defining Unicode char U+00C7 (decimal 199)
68 defining Unicode char U+00C8 (decimal 200)
68 defining Unicode char U+00C8 (decimal 200)
69 defining Unicode char U+00C9 (decimal 201)
69 defining Unicode char U+00C9 (decimal 201)
70 defining Unicode char U+00CA (decimal 202)
70 defining Unicode char U+00CA (decimal 202)
71 defining Unicode char U+00CB (decimal 203)
71 defining Unicode char U+00CB (decimal 203)
72 defining Unicode char U+00CC (decimal 204)
72 defining Unicode char U+00CC (decimal 204)
73 defining Unicode char U+00CD (decimal 205)
73 defining Unicode char U+00CD (decimal 205)
74 defining Unicode char U+00CE (decimal 206)
74 defining Unicode char U+00CE (decimal 206)
75 defining Unicode char U+00CF (decimal 207)
75 defining Unicode char U+00CF (decimal 207)
76 defining Unicode char U+00D0 (decimal 208)
76 defining Unicode char U+00D0 (decimal 208)
77 defining Unicode char U+00D1 (decimal 209)
77 defining Unicode char U+00D1 (decimal 209)
78 defining Unicode char U+00D2 (decimal 210)
78 defining Unicode char U+00D2 (decimal 210)
79 defining Unicode char U+00D3 (decimal 211)
79 defining Unicode char U+00D3 (decimal 211)
80 defining Unicode char U+00D4 (decimal 212)
80 defining Unicode char U+00D4 (decimal 212)
81 defining Unicode char U+00D5 (decimal 213)
81 defining Unicode char U+00D5 (decimal 213)
82 defining Unicode char U+00D6 (decimal 214)
82 defining Unicode char U+00D6 (decimal 214)
83 defining Unicode char U+00D8 (decimal 216)
83 defining Unicode char U+00D8 (decimal 216)
84 defining Unicode char U+00D9 (decimal 217)
84 defining Unicode char U+00D9 (decimal 217)
85 defining Unicode char U+00DA (decimal 218)
85 defining Unicode char U+00DA (decimal 218)
86 defining Unicode char U+00DB (decimal 219)
86 defining Unicode char U+00DB (decimal 219)
87 defining Unicode char U+00DC (decimal 220)
87 defining Unicode char U+00DC (decimal 220)
88 defining Unicode char U+00DD (decimal 221)
88 defining Unicode char U+00DD (decimal 221)
89 defining Unicode char U+00DE (decimal 222)
89 defining Unicode char U+00DE (decimal 222)
90 defining Unicode char U+00DF (decimal 223)
90 defining Unicode char U+00DF (decimal 223)
91 defining Unicode char U+00E0 (decimal 224)
91 defining Unicode char U+00E0 (decimal 224)
92 defining Unicode char U+00E1 (decimal 225)
92 defining Unicode char U+00E1 (decimal 225)
93 defining Unicode char U+00E2 (decimal 226)
93 defining Unicode char U+00E2 (decimal 226)
94 defining Unicode char U+00E3 (decimal 227)
94 defining Unicode char U+00E3 (decimal 227)
95 defining Unicode char U+00E4 (decimal 228)
95 defining Unicode char U+00E4 (decimal 228)
96 defining Unicode char U+00E5 (decimal 229)
96 defining Unicode char U+00E5 (decimal 229)
97 defining Unicode char U+00E6 (decimal 230)
97 defining Unicode char U+00E6 (decimal 230)
98 defining Unicode char U+00E7 (decimal 231)
98 defining Unicode char U+00E7 (decimal 231)
99 defining Unicode char U+00E8 (decimal 232)
99 defining Unicode char U+00E8 (decimal 232)
100 defining Unicode char U+00E9 (decimal 233)
100 defining Unicode char U+00E9 (decimal 233)
101 defining Unicode char U+00EA (decimal 234)
101 defining Unicode char U+00EA (decimal 234)
102 defining Unicode char U+00EB (decimal 235)
102 defining Unicode char U+00EB (decimal 235)
103 defining Unicode char U+00EC (decimal 236)
103 defining Unicode char U+00EC (decimal 236)
104 defining Unicode char U+00ED (decimal 237)
104 defining Unicode char U+00ED (decimal 237)
105 defining Unicode char U+00EE (decimal 238)
105 defining Unicode char U+00EE (decimal 238)
106 defining Unicode char U+00EF (decimal 239)
106 defining Unicode char U+00EF (decimal 239)
107 defining Unicode char U+00F0 (decimal 240)
107 defining Unicode char U+00F0 (decimal 240)
108 defining Unicode char U+00F1 (decimal 241)
108 defining Unicode char U+00F1 (decimal 241)
109 defining Unicode char U+00F2 (decimal 242)
109 defining Unicode char U+00F2 (decimal 242)
110 defining Unicode char U+00F3 (decimal 243)
110 defining Unicode char U+00F3 (decimal 243)
111 defining Unicode char U+00F4 (decimal 244)
111 defining Unicode char U+00F4 (decimal 244)
112 defining Unicode char U+00F5 (decimal 245)
112 defining Unicode char U+00F5 (decimal 245)
113 defining Unicode char U+00F6 (decimal 246)
113 defining Unicode char U+00F6 (decimal 246)
114 defining Unicode char U+00F8 (decimal 248)
114 defining Unicode char U+00F8 (decimal 248)
115 defining Unicode char U+00F9 (decimal 249)
115 defining Unicode char U+00F9 (decimal 249)
116 defining Unicode char U+00FA (decimal 250)
116 defining Unicode char U+00FA (decimal 250)
117 defining Unicode char U+00FB (decimal 251)
117 defining Unicode char U+00FB (decimal 251)
118 defining Unicode char U+00FC (decimal 252)
118 defining Unicode char U+00FC (decimal 252)
119 defining Unicode char U+00FD (decimal 253)
119 defining Unicode char U+00FD (decimal 253)
120 defining Unicode char U+00FE (decimal 254)
120 defining Unicode char U+00FE (decimal 254)
121 defining Unicode char U+00FF (decimal 255)
121 defining Unicode char U+00FF (decimal 255)
122 defining Unicode char U+0102 (decimal 258)
122 defining Unicode char U+0102 (decimal 258)
123 defining Unicode char U+0103 (decimal 259)
123 defining Unicode char U+0103 (decimal 259)
124 defining Unicode char U+0104 (decimal 260)
124 defining Unicode char U+0104 (decimal 260)
125 defining Unicode char U+0105 (decimal 261)
125 defining Unicode char U+0105 (decimal 261)
126 defining Unicode char U+0106 (decimal 262)
126 defining Unicode char U+0106 (decimal 262)
127 defining Unicode char U+0107 (decimal 263)
127 defining Unicode char U+0107 (decimal 263)
128 defining Unicode char U+010C (decimal 268)
128 defining Unicode char U+010C (decimal 268)
129 defining Unicode char U+010D (decimal 269)
129 defining Unicode char U+010D (decimal 269)
130 defining Unicode char U+010E (decimal 270)
130 defining Unicode char U+010E (decimal 270)
131 defining Unicode char U+010F (decimal 271)
131 defining Unicode char U+010F (decimal 271)
132 defining Unicode char U+0110 (decimal 272)
132 defining Unicode char U+0110 (decimal 272)
133 defining Unicode char U+0111 (decimal 273)
133 defining Unicode char U+0111 (decimal 273)
134 defining Unicode char U+0118 (decimal 280)
134 defining Unicode char U+0118 (decimal 280)
135 defining Unicode char U+0119 (decimal 281)
135 defining Unicode char U+0119 (decimal 281)
136 defining Unicode char U+011A (decimal 282)
136 defining Unicode char U+011A (decimal 282)
137 defining Unicode char U+011B (decimal 283)
137 defining Unicode char U+011B (decimal 283)
138 defining Unicode char U+011E (decimal 286)
138 defining Unicode char U+011E (decimal 286)
139 defining Unicode char U+011F (decimal 287)
139 defining Unicode char U+011F (decimal 287)
140 defining Unicode char U+0130 (decimal 304)
140 defining Unicode char U+0130 (decimal 304)
141 defining Unicode char U+0131 (decimal 305)
141 defining Unicode char U+0131 (decimal 305)
142 defining Unicode char U+0132 (decimal 306)
142 defining Unicode char U+0132 (decimal 306)
143 defining Unicode char U+0133 (decimal 307)
143 defining Unicode char U+0133 (decimal 307)
144 defining Unicode char U+0139 (decimal 313)
144 defining Unicode char U+0139 (decimal 313)
145 defining Unicode char U+013A (decimal 314)
145 defining Unicode char U+013A (decimal 314)
146 defining Unicode char U+013D (decimal 317)
146 defining Unicode char U+013D (decimal 317)
147 defining Unicode char U+013E (decimal 318)
147 defining Unicode char U+013E (decimal 318)
148 defining Unicode char U+0141 (decimal 321)
148 defining Unicode char U+0141 (decimal 321)
149 defining Unicode char U+0142 (decimal 322)
149 defining Unicode char U+0142 (decimal 322)
150 defining Unicode char U+0143 (decimal 323)
150 defining Unicode char U+0143 (decimal 323)
151 defining Unicode char U+0144 (decimal 324)
151 defining Unicode char U+0144 (decimal 324)
152 defining Unicode char U+0147 (decimal 327)
152 defining Unicode char U+0147 (decimal 327)
153 defining Unicode char U+0148 (decimal 328)
153 defining Unicode char U+0148 (decimal 328)
154 defining Unicode char U+014A (decimal 330)
154 defining Unicode char U+014A (decimal 330)
155 defining Unicode char U+014B (decimal 331)
155 defining Unicode char U+014B (decimal 331)
156 defining Unicode char U+0150 (decimal 336)
156 defining Unicode char U+0150 (decimal 336)
157 defining Unicode char U+0151 (decimal 337)
157 defining Unicode char U+0151 (decimal 337)
158 defining Unicode char U+0152 (decimal 338)
158 defining Unicode char U+0152 (decimal 338)
159 defining Unicode char U+0153 (decimal 339)
159 defining Unicode char U+0153 (decimal 339)
160 defining Unicode char U+0154 (decimal 340)
160 defining Unicode char U+0154 (decimal 340)
161 defining Unicode char U+0155 (decimal 341)
161 defining Unicode char U+0155 (decimal 341)
162 defining Unicode char U+0158 (decimal 344)
162 defining Unicode char U+0158 (decimal 344)
163 defining Unicode char U+0159 (decimal 345)
163 defining Unicode char U+0159 (decimal 345)
164 defining Unicode char U+015A (decimal 346)
164 defining Unicode char U+015A (decimal 346)
165 defining Unicode char U+015B (decimal 347)
165 defining Unicode char U+015B (decimal 347)
166 defining Unicode char U+015E (decimal 350)
166 defining Unicode char U+015E (decimal 350)
167 defining Unicode char U+015F (decimal 351)
167 defining Unicode char U+015F (decimal 351)
168 defining Unicode char U+0160 (decimal 352)
168 defining Unicode char U+0160 (decimal 352)
169 defining Unicode char U+0161 (decimal 353)
169 defining Unicode char U+0161 (decimal 353)
170 defining Unicode char U+0162 (decimal 354)
170 defining Unicode char U+0162 (decimal 354)
171 defining Unicode char U+0163 (decimal 355)
171 defining Unicode char U+0163 (decimal 355)
172 defining Unicode char U+0164 (decimal 356)
172 defining Unicode char U+0164 (decimal 356)
173 defining Unicode char U+0165 (decimal 357)
173 defining Unicode char U+0165 (decimal 357)
174 defining Unicode char U+016E (decimal 366)
174 defining Unicode char U+016E (decimal 366)
175 defining Unicode char U+016F (decimal 367)
175 defining Unicode char U+016F (decimal 367)
176 defining Unicode char U+0170 (decimal 368)
176 defining Unicode char U+0170 (decimal 368)
177 defining Unicode char U+0171 (decimal 369)
177 defining Unicode char U+0171 (decimal 369)
178 defining Unicode char U+0178 (decimal 376)
178 defining Unicode char U+0178 (decimal 376)
179 defining Unicode char U+0179 (decimal 377)
179 defining Unicode char U+0179 (decimal 377)
180 defining Unicode char U+017A (decimal 378)
180 defining Unicode char U+017A (decimal 378)
181 defining Unicode char U+017B (decimal 379)
181 defining Unicode char U+017B (decimal 379)
182 defining Unicode char U+017C (decimal 380)
182 defining Unicode char U+017C (decimal 380)
183 defining Unicode char U+017D (decimal 381)
183 defining Unicode char U+017D (decimal 381)
184 defining Unicode char U+017E (decimal 382)
184 defining Unicode char U+017E (decimal 382)
185 defining Unicode char U+200C (decimal 8204)
185 defining Unicode char U+200C (decimal 8204)
186 defining Unicode char U+2013 (decimal 8211)
186 defining Unicode char U+2013 (decimal 8211)
187 defining Unicode char U+2014 (decimal 8212)
187 defining Unicode char U+2014 (decimal 8212)
188 defining Unicode char U+2018 (decimal 8216)
188 defining Unicode char U+2018 (decimal 8216)
189 defining Unicode char U+2019 (decimal 8217)
189 defining Unicode char U+2019 (decimal 8217)
190 defining Unicode char U+201A (decimal 8218)
190 defining Unicode char U+201A (decimal 8218)
191 defining Unicode char U+201C (decimal 8220)
191 defining Unicode char U+201C (decimal 8220)
192 defining Unicode char U+201D (decimal 8221)
192 defining Unicode char U+201D (decimal 8221)
193 defining Unicode char U+201E (decimal 8222)
193 defining Unicode char U+201E (decimal 8222)
194 defining Unicode char U+2030 (decimal 8240)
194 defining Unicode char U+2030 (decimal 8240)
195 defining Unicode char U+2031 (decimal 8241)
195 defining Unicode char U+2031 (decimal 8241)
196 defining Unicode char U+2039 (decimal 8249)
196 defining Unicode char U+2039 (decimal 8249)
197 defining Unicode char U+203A (decimal 8250)
197 defining Unicode char U+203A (decimal 8250)
198 defining Unicode char U+2423 (decimal 9251)
198 defining Unicode char U+2423 (decimal 9251)
199 )
199 )
200 Now handling font encoding OT1 ...
200 Now handling font encoding OT1 ...
201 ... processing UTF-8 mapping file for font encodingOT1
201 ... processing UTF-8 mapping file for font encodingOT1
202
202
203 (/usr/share/texmf/tex/latex/base/ot1enc.dfu
203 (/usr/share/texmf/tex/latex/base/ot1enc.dfu
204 File: ot1enc.dfu 2006/03/30 v1.1i UTF-8 support for inputenc
204 File: ot1enc.dfu 2006/03/30 v1.1i UTF-8 support for inputenc
205 defining Unicode char U+00A1 (decimal 161)
205 defining Unicode char U+00A1 (decimal 161)
206 defining Unicode char U+00A3 (decimal 163)
206 defining Unicode char U+00A3 (decimal 163)
207 defining Unicode char U+00B8 (decimal 184)
207 defining Unicode char U+00B8 (decimal 184)
208 defining Unicode char U+00BF (decimal 191)
208 defining Unicode char U+00BF (decimal 191)
209 defining Unicode char U+00C5 (decimal 197)
209 defining Unicode char U+00C5 (decimal 197)
210 defining Unicode char U+00C6 (decimal 198)
210 defining Unicode char U+00C6 (decimal 198)
211 defining Unicode char U+00D8 (decimal 216)
211 defining Unicode char U+00D8 (decimal 216)
212 defining Unicode char U+00DF (decimal 223)
212 defining Unicode char U+00DF (decimal 223)
213 defining Unicode char U+00E6 (decimal 230)
213 defining Unicode char U+00E6 (decimal 230)
214 defining Unicode char U+00EC (decimal 236)
214 defining Unicode char U+00EC (decimal 236)
215 defining Unicode char U+00ED (decimal 237)
215 defining Unicode char U+00ED (decimal 237)
216 defining Unicode char U+00EE (decimal 238)
216 defining Unicode char U+00EE (decimal 238)
217 defining Unicode char U+00EF (decimal 239)
217 defining Unicode char U+00EF (decimal 239)
218 defining Unicode char U+00F8 (decimal 248)
218 defining Unicode char U+00F8 (decimal 248)
219 defining Unicode char U+0131 (decimal 305)
219 defining Unicode char U+0131 (decimal 305)
220 defining Unicode char U+0141 (decimal 321)
220 defining Unicode char U+0141 (decimal 321)
221 defining Unicode char U+0142 (decimal 322)
221 defining Unicode char U+0142 (decimal 322)
222 defining Unicode char U+0152 (decimal 338)
222 defining Unicode char U+0152 (decimal 338)
223 defining Unicode char U+0153 (decimal 339)
223 defining Unicode char U+0153 (decimal 339)
224 defining Unicode char U+2013 (decimal 8211)
224 defining Unicode char U+2013 (decimal 8211)
225 defining Unicode char U+2014 (decimal 8212)
225 defining Unicode char U+2014 (decimal 8212)
226 defining Unicode char U+2018 (decimal 8216)
226 defining Unicode char U+2018 (decimal 8216)
227 defining Unicode char U+2019 (decimal 8217)
227 defining Unicode char U+2019 (decimal 8217)
228 defining Unicode char U+201C (decimal 8220)
228 defining Unicode char U+201C (decimal 8220)
229 defining Unicode char U+201D (decimal 8221)
229 defining Unicode char U+201D (decimal 8221)
230 )
230 )
231 Now handling font encoding OMS ...
231 Now handling font encoding OMS ...
232 ... processing UTF-8 mapping file for font encodingOMS
232 ... processing UTF-8 mapping file for font encodingOMS
233
233
234 (/usr/share/texmf/tex/latex/base/omsenc.dfu
234 (/usr/share/texmf/tex/latex/base/omsenc.dfu
235 File: omsenc.dfu 2006/03/30 v1.1i UTF-8 support for inputenc
235 File: omsenc.dfu 2006/03/30 v1.1i UTF-8 support for inputenc
236 defining Unicode char U+00A7 (decimal 167)
236 defining Unicode char U+00A7 (decimal 167)
237 defining Unicode char U+00B6 (decimal 182)
237 defining Unicode char U+00B6 (decimal 182)
238 defining Unicode char U+00B7 (decimal 183)
238 defining Unicode char U+00B7 (decimal 183)
239 defining Unicode char U+2020 (decimal 8224)
239 defining Unicode char U+2020 (decimal 8224)
240 defining Unicode char U+2021 (decimal 8225)
240 defining Unicode char U+2021 (decimal 8225)
241 defining Unicode char U+2022 (decimal 8226)
241 defining Unicode char U+2022 (decimal 8226)
242 )
242 )
243 Now handling font encoding OMX ...
243 Now handling font encoding OMX ...
244 ... no UTF-8 mapping file for font encoding OMX
244 ... no UTF-8 mapping file for font encoding OMX
245 Now handling font encoding U ...
245 Now handling font encoding U ...
246 ... no UTF-8 mapping file for font encoding U
246 ... no UTF-8 mapping file for font encoding U
247 defining Unicode char U+00A9 (decimal 169)
247 defining Unicode char U+00A9 (decimal 169)
248 defining Unicode char U+00AA (decimal 170)
248 defining Unicode char U+00AA (decimal 170)
249 defining Unicode char U+00AE (decimal 174)
249 defining Unicode char U+00AE (decimal 174)
250 defining Unicode char U+00BA (decimal 186)
250 defining Unicode char U+00BA (decimal 186)
251 defining Unicode char U+02C6 (decimal 710)
251 defining Unicode char U+02C6 (decimal 710)
252 defining Unicode char U+02DC (decimal 732)
252 defining Unicode char U+02DC (decimal 732)
253 defining Unicode char U+200C (decimal 8204)
253 defining Unicode char U+200C (decimal 8204)
254 defining Unicode char U+2026 (decimal 8230)
254 defining Unicode char U+2026 (decimal 8230)
255 defining Unicode char U+2122 (decimal 8482)
255 defining Unicode char U+2122 (decimal 8482)
256 defining Unicode char U+2423 (decimal 9251)
256 defining Unicode char U+2423 (decimal 9251)
257 ))
257 ))
258 (/usr/share/texmf/tex/latex/base/fontenc.sty
258 (/usr/share/texmf/tex/latex/base/fontenc.sty
259 Package: fontenc 2005/09/27 v1.99g Standard LaTeX package
259 Package: fontenc 2005/09/27 v1.99g Standard LaTeX package
260
260
261 (/usr/share/texmf/tex/latex/base/t1enc.def
261 (/usr/share/texmf/tex/latex/base/t1enc.def
262 File: t1enc.def 2005/09/27 v1.99g Standard LaTeX file
262 File: t1enc.def 2005/09/27 v1.99g Standard LaTeX file
263 LaTeX Font Info: Redeclaring font encoding T1 on input line 43.
263 LaTeX Font Info: Redeclaring font encoding T1 on input line 43.
264 ))
264 ))
265 (/usr/share/texmf/tex/latex/lm/lmodern.sty
265 (/usr/share/texmf/tex/latex/lm/lmodern.sty
266 Package: lmodern 2007/01/14 v1.3 Latin Modern Fonts
266 Package: lmodern 2007/01/14 v1.3 Latin Modern Fonts
267 LaTeX Font Info: Overwriting symbol font `operators' in version `normal'
267 LaTeX Font Info: Overwriting symbol font `operators' in version `normal'
268 (Font) OT1/cmr/m/n --> OT1/lmr/m/n on input line 13.
268 (Font) OT1/cmr/m/n --> OT1/lmr/m/n on input line 13.
269 LaTeX Font Info: Overwriting symbol font `letters' in version `normal'
269 LaTeX Font Info: Overwriting symbol font `letters' in version `normal'
270 (Font) OML/cmm/m/it --> OML/lmm/m/it on input line 14.
270 (Font) OML/cmm/m/it --> OML/lmm/m/it on input line 14.
271 LaTeX Font Info: Overwriting symbol font `symbols' in version `normal'
271 LaTeX Font Info: Overwriting symbol font `symbols' in version `normal'
272 (Font) OMS/cmsy/m/n --> OMS/lmsy/m/n on input line 15.
272 (Font) OMS/cmsy/m/n --> OMS/lmsy/m/n on input line 15.
273 LaTeX Font Info: Overwriting symbol font `largesymbols' in version `normal'
273 LaTeX Font Info: Overwriting symbol font `largesymbols' in version `normal'
274 (Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 16.
274 (Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 16.
275 LaTeX Font Info: Overwriting symbol font `operators' in version `bold'
275 LaTeX Font Info: Overwriting symbol font `operators' in version `bold'
276 (Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 17.
276 (Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 17.
277 LaTeX Font Info: Overwriting symbol font `letters' in version `bold'
277 LaTeX Font Info: Overwriting symbol font `letters' in version `bold'
278 (Font) OML/cmm/b/it --> OML/lmm/b/it on input line 18.
278 (Font) OML/cmm/b/it --> OML/lmm/b/it on input line 18.
279 LaTeX Font Info: Overwriting symbol font `symbols' in version `bold'
279 LaTeX Font Info: Overwriting symbol font `symbols' in version `bold'
280 (Font) OMS/cmsy/b/n --> OMS/lmsy/b/n on input line 19.
280 (Font) OMS/cmsy/b/n --> OMS/lmsy/b/n on input line 19.
281 LaTeX Font Info: Overwriting symbol font `largesymbols' in version `bold'
281 LaTeX Font Info: Overwriting symbol font `largesymbols' in version `bold'
282 (Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 20.
282 (Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 20.
283 LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `normal'
283 LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `normal'
284 (Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 22.
284 (Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 22.
285 LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `normal'
285 LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `normal'
286 (Font) OT1/cmss/m/n --> OT1/lmss/m/n on input line 23.
286 (Font) OT1/cmss/m/n --> OT1/lmss/m/n on input line 23.
287 LaTeX Font Info: Overwriting math alphabet `\mathit' in version `normal'
287 LaTeX Font Info: Overwriting math alphabet `\mathit' in version `normal'
288 (Font) OT1/cmr/m/it --> OT1/lmr/m/it on input line 24.
288 (Font) OT1/cmr/m/it --> OT1/lmr/m/it on input line 24.
289 LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `normal'
289 LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `normal'
290 (Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 25.
290 (Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 25.
291 LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `bold'
291 LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `bold'
292 (Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 26.
292 (Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 26.
293 LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `bold'
293 LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `bold'
294 (Font) OT1/cmss/bx/n --> OT1/lmss/bx/n on input line 27.
294 (Font) OT1/cmss/bx/n --> OT1/lmss/bx/n on input line 27.
295 LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold'
295 LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold'
296 (Font) OT1/cmr/bx/it --> OT1/lmr/bx/it on input line 28.
296 (Font) OT1/cmr/bx/it --> OT1/lmr/bx/it on input line 28.
297 LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `bold'
297 LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `bold'
298 (Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 29.
298 (Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 29.
299 )
299 )
300 (/usr/share/texmf/tex/latex/geometry/geometry.sty
300 (/usr/share/texmf/tex/latex/geometry/geometry.sty
301 Package: geometry 2002/07/08 v3.2 Page Geometry
301 Package: geometry 2002/07/08 v3.2 Page Geometry
302
302
303 (/usr/share/texmf/tex/latex/graphics/keyval.sty
303 (/usr/share/texmf/tex/latex/graphics/keyval.sty
304 Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
304 Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
305 \KV@toks@=\toks16
305 \KV@toks@=\toks16
306 )
306 )
307 \Gm@cnth=\count88
307 \Gm@cnth=\count88
308 \Gm@cntv=\count89
308 \Gm@cntv=\count89
309 \c@Gm@tempcnt=\count90
309 \c@Gm@tempcnt=\count90
310 \Gm@bindingoffset=\dimen103
310 \Gm@bindingoffset=\dimen103
311 \Gm@wd@mp=\dimen104
311 \Gm@wd@mp=\dimen104
312 \Gm@odd@mp=\dimen105
312 \Gm@odd@mp=\dimen105
313 \Gm@even@mp=\dimen106
313 \Gm@even@mp=\dimen106
314 \Gm@dimlist=\toks17
314 \Gm@dimlist=\toks17
315 )
315 )
316 (/usr/share/texmf/tex/generic/babel/babel.sty
316 (/usr/share/texmf/tex/generic/babel/babel.sty
317 Package: babel 2005/11/23 v3.8h The Babel package
317 Package: babel 2005/11/23 v3.8h The Babel package
318
318
319 (/usr/share/texmf/tex/generic/babel/frenchb.ldf
319 (/usr/share/texmf/tex/generic/babel/frenchb.ldf
320 Language: french 2005/02/06 v1.6g French support from the babel system
320 Language: french 2005/02/06 v1.6g French support from the babel system
321
321
322 (/usr/share/texmf/tex/generic/babel/babel.def
322 (/usr/share/texmf/tex/generic/babel/babel.def
323 File: babel.def 2005/11/23 v3.8h Babel common definitions
323 File: babel.def 2005/11/23 v3.8h Babel common definitions
324 \babel@savecnt=\count91
324 \babel@savecnt=\count91
325 \U@D=\dimen107
325 \U@D=\dimen107
326 )
326 )
327 Package babel Info: Making : an active character on input line 219.
327 Package babel Info: Making : an active character on input line 219.
328 Package babel Info: Making ; an active character on input line 220.
328 Package babel Info: Making ; an active character on input line 220.
329 Package babel Info: Making ! an active character on input line 221.
329 Package babel Info: Making ! an active character on input line 221.
330 Package babel Info: Making ? an active character on input line 222.
330 Package babel Info: Making ? an active character on input line 222.
331 LaTeX Font Info: Redeclaring font encoding T1 on input line 299.
331 LaTeX Font Info: Redeclaring font encoding T1 on input line 299.
332 \parindentFFN=\dimen108
332 \parindentFFN=\dimen108
333 \std@mcc=\count92
333 \std@mcc=\count92
334 \dec@mcc=\count93
334 \dec@mcc=\count93
335
335
336 *************************************
336 *************************************
337 * Local config file frenchb.cfg used
337 * Local config file frenchb.cfg used
338 *
338 *
339 (/usr/share/texmf/tex/generic/babel/frenchb.cfg)))
339 (/usr/share/texmf/tex/generic/babel/frenchb.cfg)))
340 (/usr/share/texmf/tex/latex/listings/listings.sty
340 (/usr/share/texmf/tex/latex/listings/listings.sty
341 \lst@mode=\count94
341 \lst@mode=\count94
342 \lst@gtempboxa=\box26
342 \lst@gtempboxa=\box26
343 \lst@token=\toks18
343 \lst@token=\toks18
344 \lst@length=\count95
344 \lst@length=\count95
345 \lst@currlwidth=\dimen109
345 \lst@currlwidth=\dimen109
346 \lst@column=\count96
346 \lst@column=\count96
347 \lst@pos=\count97
347 \lst@pos=\count97
348 \lst@lostspace=\dimen110
348 \lst@lostspace=\dimen110
349 \lst@width=\dimen111
349 \lst@width=\dimen111
350 \lst@newlines=\count98
350 \lst@newlines=\count98
351 \lst@lineno=\count99
351 \lst@lineno=\count99
352 \c@lstlisting=\count100
352 \c@lstlisting=\count100
353 \lst@maxwidth=\dimen112
353 \lst@maxwidth=\dimen112
354
354
355 (/usr/share/texmf/tex/latex/listings/lstpatch.sty
355 (/usr/share/texmf/tex/latex/listings/lstpatch.sty
356 File: lstpatch.sty 2004/10/17 1.3b (Carsten Heinz)
356 File: lstpatch.sty 2004/10/17 1.3b (Carsten Heinz)
357 )
357 )
358 (/usr/share/texmf/tex/latex/listings/lstmisc.sty
358 (/usr/share/texmf/tex/latex/listings/lstmisc.sty
359 File: lstmisc.sty 2004/09/07 1.3 (Carsten Heinz)
359 File: lstmisc.sty 2004/09/07 1.3 (Carsten Heinz)
360 \c@lstnumber=\count101
360 \c@lstnumber=\count101
361 \lst@skipnumbers=\count102
361 \lst@skipnumbers=\count102
362 \lst@framebox=\box27
362 \lst@framebox=\box27
363 )
363 )
364 (/usr/share/texmf/tex/latex/listings/listings.cfg
364 (/usr/share/texmf/tex/latex/listings/listings.cfg
365 File: listings.cfg 2004/09/05 1.3 listings configuration
365 File: listings.cfg 2004/09/05 1.3 listings configuration
366 ))
366 ))
367 Package: listings 2004/10/17 1.3b (Carsten Heinz)
367 Package: listings 2004/10/17 1.3b (Carsten Heinz)
368
368
369 (/usr/share/texmf/tex/latex/listings/lstlang1.sty
369 (/usr/share/texmf/tex/latex/listings/lstlang1.sty
370 File: lstlang1.sty 2004/09/05 1.3 listings language file
370 File: lstlang1.sty 2004/09/05 1.3 listings language file
371 )
371 )
372 (/usr/share/texmf/tex/latex/listings/lstmisc.sty
372 (/usr/share/texmf/tex/latex/listings/lstmisc.sty
373 File: lstmisc.sty 2004/09/07 1.3 (Carsten Heinz)
373 File: lstmisc.sty 2004/09/07 1.3 (Carsten Heinz)
374 )) (./PortingGuide.aux
374 )) (./PortingGuide.aux
375 (./streamdevices.aux) (./uart.aux) (./spi.aux) (./addresseddevices.aux))
375 (./streamdevices.aux) (./uart.aux) (./spi.aux) (./addresseddevices.aux))
376 \openout1 = `PortingGuide.aux'.
376 \openout1 = `PortingGuide.aux'.
377
377
378 LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 2.
378 LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 2.
379 LaTeX Font Info: ... okay on input line 2.
379 LaTeX Font Info: ... okay on input line 2.
380 LaTeX Font Info: Checking defaults for T1/lmr/m/n on input line 2.
380 LaTeX Font Info: Checking defaults for T1/lmr/m/n on input line 2.
381 LaTeX Font Info: Try loading font information for T1+lmr on input line 2.
381 LaTeX Font Info: Try loading font information for T1+lmr on input line 2.
382
382
383 (/usr/share/texmf/tex/latex/lm/t1lmr.fd
383 (/usr/share/texmf/tex/latex/lm/t1lmr.fd
384 File: t1lmr.fd 2007/01/14 v1.3 Font defs for Latin Modern
384 File: t1lmr.fd 2007/01/14 v1.3 Font defs for Latin Modern
385 )
385 )
386 LaTeX Font Info: ... okay on input line 2.
386 LaTeX Font Info: ... okay on input line 2.
387 LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 2.
387 LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 2.
388 LaTeX Font Info: ... okay on input line 2.
388 LaTeX Font Info: ... okay on input line 2.
389 LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 2.
389 LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 2.
390 LaTeX Font Info: ... okay on input line 2.
390 LaTeX Font Info: ... okay on input line 2.
391 LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 2.
391 LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 2.
392 LaTeX Font Info: ... okay on input line 2.
392 LaTeX Font Info: ... okay on input line 2.
393 LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 2.
393 LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 2.
394 LaTeX Font Info: ... okay on input line 2.
394 LaTeX Font Info: ... okay on input line 2.
395 -------------------- Geometry parameters
395 -------------------- Geometry parameters
396 paper: a4paper
396 paper: a4paper
397 landscape: --
397 landscape: --
398 twocolumn: --
398 twocolumn: --
399 twoside: true
399 twoside: true
400 asymmetric: --
400 asymmetric: --
401 h-parts: 71.70166pt, 0.7\paperwidth , 107.55254pt (default)
401 h-parts: 71.70166pt, 0.7\paperwidth , 107.55254pt (default)
402 v-parts: 101.40665pt, 0.7\paperheight , 152.11pt (default)
402 v-parts: 101.40665pt, 0.7\paperheight , 152.11pt (default)
403 hmarginratio: 2:3
403 hmarginratio: 2:3
404 vmarginratio: 2:3
404 vmarginratio: 2:3
405 lines: --
405 lines: --
406 heightrounded: --
406 heightrounded: --
407 bindingoffset: 0.0pt
407 bindingoffset: 0.0pt
408 truedimen: --
408 truedimen: --
409 includehead: --
409 includehead: --
410 includefoot: --
410 includefoot: --
411 includemp: --
411 includemp: --
412 driver: pdftex
412 driver: pdftex
413 -------------------- Page layout dimensions and switches
413 -------------------- Page layout dimensions and switches
414 \paperwidth 597.50787pt
414 \paperwidth 597.50787pt
415 \paperheight 845.04684pt
415 \paperheight 845.04684pt
416 \textwidth 418.25368pt
416 \textwidth 418.25368pt
417 \textheight 591.5302pt
417 \textheight 591.5302pt
418 \oddsidemargin -0.56833pt
418 \oddsidemargin -0.56833pt
419 \evensidemargin 35.28255pt
419 \evensidemargin 35.28255pt
420 \topmargin -0.93083pt
420 \topmargin -0.93083pt
421 \headheight 12.0pt
421 \headheight 12.0pt
422 \headsep 18.06749pt
422 \headsep 18.06749pt
423 \footskip 25.29494pt
423 \footskip 25.29494pt
424 \marginparwidth 125.0pt
424 \marginparwidth 125.0pt
425 \marginparsep 7.0pt
425 \marginparsep 7.0pt
426 \columnsep 10.0pt
426 \columnsep 10.0pt
427 \skip\footins 9.0pt plus 4.0pt minus 2.0pt
427 \skip\footins 9.0pt plus 4.0pt minus 2.0pt
428 \hoffset 0.0pt
428 \hoffset 0.0pt
429 \voffset 0.0pt
429 \voffset 0.0pt
430 \mag 1000
430 \mag 1000
431 \@twosidetrue \@mparswitchtrue
431 \@twosidetrue \@mparswitchtrue
432 (1in=72.27pt, 1cm=28.45pt)
432 (1in=72.27pt, 1cm=28.45pt)
433 -----------------------
433 -----------------------
434 LaTeX Info: Redefining \dots on input line 2.
434 LaTeX Info: Redefining \dots on input line 2.
435 [1
435 [1
436
436
437
437
438
438
439
439
440 {/usr/share/texmf/fonts/map/pdftex/updmap/pdftex.map}] [2
440 {/usr/share/texmf/fonts/map/pdftex/updmap/pdftex.map}] [2
441
441
442 ] (./PortingGuide.toc
442 ] (./PortingGuide.toc
443 LaTeX Font Info: Try loading font information for OT1+lmr on input line 4.
443 LaTeX Font Info: Try loading font information for OT1+lmr on input line 4.
444
444
445 (/usr/share/texmf/tex/latex/lm/ot1lmr.fd
445 (/usr/share/texmf/tex/latex/lm/ot1lmr.fd
446 File: ot1lmr.fd 2007/01/14 v1.3 Font defs for Latin Modern
446 File: ot1lmr.fd 2007/01/14 v1.3 Font defs for Latin Modern
447 )
447 )
448 LaTeX Font Info: Try loading font information for OML+lmm on input line 4.
448 LaTeX Font Info: Try loading font information for OML+lmm on input line 4.
449
449
450 (/usr/share/texmf/tex/latex/lm/omllmm.fd
450 (/usr/share/texmf/tex/latex/lm/omllmm.fd
451 File: omllmm.fd 2007/01/14 v1.3 Font defs for Latin Modern
451 File: omllmm.fd 2007/01/14 v1.3 Font defs for Latin Modern
452 )
452 )
453 LaTeX Font Info: Try loading font information for OMS+lmsy on input line 4.
453 LaTeX Font Info: Try loading font information for OMS+lmsy on input line 4.
454
454
455 (/usr/share/texmf/tex/latex/lm/omslmsy.fd
455 (/usr/share/texmf/tex/latex/lm/omslmsy.fd
456 File: omslmsy.fd 2007/01/14 v1.3 Font defs for Latin Modern
456 File: omslmsy.fd 2007/01/14 v1.3 Font defs for Latin Modern
457 )
457 )
458 LaTeX Font Info: Try loading font information for OMX+lmex on input line 4.
458 LaTeX Font Info: Try loading font information for OMX+lmex on input line 4.
459
459
460 (/usr/share/texmf/tex/latex/lm/omxlmex.fd
460 (/usr/share/texmf/tex/latex/lm/omxlmex.fd
461 File: omxlmex.fd 2007/01/14 v1.3 Font defs for Latin Modern
461 File: omxlmex.fd 2007/01/14 v1.3 Font defs for Latin Modern
462 )
462 )
463 LaTeX Font Info: External font `lmex10' loaded for size
463 LaTeX Font Info: External font `lmex10' loaded for size
464 (Font) <10> on input line 4.
464 (Font) <10> on input line 4.
465 LaTeX Font Info: External font `lmex10' loaded for size
465 LaTeX Font Info: External font `lmex10' loaded for size
466 (Font) <7> on input line 4.
466 (Font) <7> on input line 4.
467 LaTeX Font Info: External font `lmex10' loaded for size
467 LaTeX Font Info: External font `lmex10' loaded for size
468 (Font) <5> on input line 4.
468 (Font) <5> on input line 4.
469 )
469 )
470 \tf@toc=\write3
470 \tf@toc=\write3
471 \openout3 = `PortingGuide.toc'.
471 \openout3 = `PortingGuide.toc'.
472
472
473 [3]
473 [3]
474 \openout2 = `streamdevices.aux'.
474 \openout2 = `streamdevices.aux'.
475
475
476 (./streamdevices.tex [4
476 (./streamdevices.tex [4
477
477
478
478
479 ]
479 ]
480 Chapitre 1.
480 Chapitre 1.
481 LaTeX Font Info: Try loading font information for OMS+lmr on input line 11.
481 LaTeX Font Info: Try loading font information for OMS+lmr on input line 11.
482 (/usr/share/texmf/tex/latex/lm/omslmr.fd
482 (/usr/share/texmf/tex/latex/lm/omslmr.fd
483 File: omslmr.fd 2007/01/14 v1.3 Font defs for Latin Modern
483 File: omslmr.fd 2007/01/14 v1.3 Font defs for Latin Modern
484 )
484 )
485 LaTeX Font Info: Font shape `OMS/lmr/m/n' in size <10> not available
485 LaTeX Font Info: Font shape `OMS/lmr/m/n' in size <10> not available
486 (Font) Font shape `OMS/lmsy/m/n' tried instead on input line 11.
486 (Font) Font shape `OMS/lmsy/m/n' tried instead on input line 11.
487 ) [5]
487 ) [5]
488 \openout2 = `uart.aux'.
488 \openout2 = `uart.aux'.
489
489
490 (./uart.tex) [6
490 (./uart.tex) [6
491
491
492
492
493 ]
493 ]
494 \openout2 = `spi.aux'.
494 \openout2 = `spi.aux'.
495
495
496 (./spi.tex)
496 (./spi.tex)
497 \openout2 = `addresseddevices.aux'.
497 \openout2 = `addresseddevices.aux'.
498
498
499
499
500 (./addresseddevices.tex
500 (./addresseddevices.tex
501 Chapitre 2.
501 Chapitre 2.
502 ) [7
502 ) [7
503
503
504
504
505
505
506
506
507
507
508 ] (./PortingGuide.aux (./streamdevices.aux) (./uart.aux) (./spi.aux)
508 ] (./PortingGuide.aux (./streamdevices.aux) (./uart.aux) (./spi.aux)
509 (./addresseddevices.aux)) )
509 (./addresseddevices.aux)) )
510 Here is how much of TeX's memory you used:
510 Here is how much of TeX's memory you used:
511 3462 strings out of 256216
511 3462 strings out of 256216
512 43395 string characters out of 1917073
512 43395 string characters out of 1917073
513 99152 words of memory out of 1500000
513 99152 words of memory out of 1500000
514 6695 multiletter control sequences out of 10000+200000
514 6695 multiletter control sequences out of 10000+200000
515 59126 words of font info for 39 fonts, out of 1200000 for 2000
515 59126 words of font info for 39 fonts, out of 1200000 for 2000
516 645 hyphenation exceptions out of 8191
516 645 hyphenation exceptions out of 8191
517 30i,4n,51p,264b,1291s stack positions out of 5000i,500n,6000p,200000b,15000s
517 30i,4n,51p,264b,1291s stack positions out of 5000i,500n,6000p,200000b,15000s
518 {/usr/share/texmf/fonts/enc/dvips/lm/lm-ec.enc}{/usr
518 {/usr/share/texmf/fonts/enc/dvips/lm/lm-ec.enc}{/usr
519 /share/texmf/fonts/enc/dvips/lm/lm-mathsy.enc}</usr/share/texmf/fonts/type1/pub
519 /share/texmf/fonts/enc/dvips/lm/lm-mathsy.enc}</usr/share/texmf/fonts/type1/pub
520 lic/lm/lmbx10.pfb></usr/share/texmf/fonts/type1/public/lm/lmbx12.pfb></usr/shar
520 lic/lm/lmbx10.pfb></usr/share/texmf/fonts/type1/public/lm/lmbx12.pfb></usr/shar
521 e/texmf/fonts/type1/public/lm/lmcsc10.pfb></usr/share/texmf/fonts/type1/public/
521 e/texmf/fonts/type1/public/lm/lmcsc10.pfb></usr/share/texmf/fonts/type1/public/
522 lm/lmr10.pfb></usr/share/texmf/fonts/type1/public/lm/lmr7.pfb></usr/share/texmf
522 lm/lmr10.pfb></usr/share/texmf/fonts/type1/public/lm/lmr7.pfb></usr/share/texmf
523 /fonts/type1/public/lm/lmri10.pfb></usr/share/texmf/fonts/type1/public/lm/lmro1
523 /fonts/type1/public/lm/lmri10.pfb></usr/share/texmf/fonts/type1/public/lm/lmro1
524 0.pfb></usr/share/texmf/fonts/type1/public/lm/lmsy10.pfb>
524 0.pfb></usr/share/texmf/fonts/type1/public/lm/lmsy10.pfb>
525 Output written on PortingGuide.pdf (7 pages, 170208 bytes).
525 Output written on PortingGuide.pdf (7 pages, 170208 bytes).
526 PDF statistics:
526 PDF statistics:
527 60 PDF objects out of 1000 (max. 8388607)
527 60 PDF objects out of 1000 (max. 8388607)
528 0 named destinations out of 1000 (max. 131072)
528 0 named destinations out of 1000 (max. 131072)
529 1 words of extra memory for PDF output out of 10000 (max. 10000000)
529 1 words of extra memory for PDF output out of 10000 (max. 10000000)
530
530
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
@@ -1,19 +1,19
1
1
2 PROJECTDIR = `pwd`
2 PROJECTDIR = `pwd`
3 LIBUC = /opt/libuc2
3 LIBUC = /opt/libuc2
4 include $(LIBUC)/rules/common/rules.mk
4 include $(LIBUC)/rules/common/rules.mk
5
5
6 all:subdir
6 all:subdir
7 make -C lib
7 make -C bsp
8 make -C bsp
8 make -C examples
9 make -C examples
9 make -C lib
10 make -C Doc
10 make -C Doc
11 @echo Code compiled
11 @echo Code compiled
12
12
13 clean:
13 clean:
14 make clean -C lib
14 make clean -C bsp
15 make clean -C bsp
15 make clean -C examples
16 make clean -C examples
16 make clean -C lib
17 make clean -C Doc
17 make clean -C Doc
18 @echo Code compiled
18 @echo Code compiled
19
19
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
@@ -1,88 +1,124
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the libuc, microcontroler library
2 -- This file is a part of the libuc, microcontroler library
3 -- Copyright (C) 2011, Alexis Jeandet
3 -- Copyright (C) 2011, Alexis Jeandet
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 3 of the License, or
7 -- the Free Software Foundation; either version 3 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------
18 -------------------------------------------------------------------------------
19 -- Author : Alexis Jeandet
19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@gmail.com
21 -------------------------------------------------------------------------------*/
21 -------------------------------------------------------------------------------*/
22 #ifndef BSP_H
22 #ifndef BSP_H
23 #define BSP_H
23 #define BSP_H
24 #include "LPC17xx.h"
24 #include "LPC17xx.h"
25 #include <uart.h>
25 #include <uart.h>
26 #include <iic.h>
26 #include <iic.h>
27 #include <ssp.h>
28 #include <24LC0X.h>
29 #include <blkdevice.h>
30 #include <sdcard.h>
27
31
28
32
29 extern uartDev* UART0;
33 extern uartDev* UART0;
30 extern uartDev* UART1;
34 extern uartDev* UART1;
31 extern uartDev* UART2;
35 extern uartDev* UART2;
32 extern uartDev* UART3;
36 extern uartDev* UART3;
33
37
34 extern i2cDev* IIC0;
38 extern i2cDev* IIC0;
35 extern i2cDev* IIC1;
39 extern i2cDev* IIC1;
36 extern i2cDev* IIC2;
40 extern i2cDev* IIC2;
37
41
42 extern sspDev* SSP0;
43 extern sspDev* SSP1;
44
45 extern sdcardDev SDCARD0;
46 extern blkdevice BLKDEVSDCARD0;
47
48 extern eeprom24lc0xDev eeprom0;
49
38 extern float VREF0;
50 extern float VREF0;
39
51
52 extern unsigned int currentCpuFreq;
53
40 #define pll0useInternal 0
54 #define pll0useInternal 0
41 #define pll0useMainOsc 1
55 #define pll0useMainOsc 1
42 #define pll0useRTC 2
56 #define pll0useRTC 2
43
57
44
58
45 #define pll0setClksrc(src) if((unsigned int)(src)<3) LPC_SC->CLKSRCSEL=(src)
59 #define pll0setClksrc(src) if((unsigned int)(src)<3) LPC_SC->CLKSRCSEL=(src)
46 #define pll0getClksrc (LPC_SC->CLKSRCSEL & 3)
60 #define pll0getClksrc (LPC_SC->CLKSRCSEL & 3)
47
61
48 #define LEDS_ON LPC_GPIO2->FIOSET = 255
62 #define LEDS_ON LPC_GPIO2->FIOSET = 255
49
63
50 #define LED1_ON LPC_GPIO2->FIOSET = (1<<0)
64 #define LED1_ON LPC_GPIO2->FIOSET = (1<<0)
51 #define LED2_ON LPC_GPIO2->FIOSET = (1<<1)
65 #define LED2_ON LPC_GPIO2->FIOSET = (1<<1)
52 #define LED3_ON LPC_GPIO2->FIOSET = (1<<2)
66 #define LED3_ON LPC_GPIO2->FIOSET = (1<<2)
53 #define LED4_ON LPC_GPIO2->FIOSET = (1<<3)
67 #define LED4_ON LPC_GPIO2->FIOSET = (1<<3)
54 #define LED5_ON LPC_GPIO2->FIOSET = (1<<4)
68 #define LED5_ON LPC_GPIO2->FIOSET = (1<<4)
55 #define LED6_ON LPC_GPIO2->FIOSET = (1<<5)
69 #define LED6_ON LPC_GPIO2->FIOSET = (1<<5)
56 #define LED7_ON LPC_GPIO2->FIOSET = (1<<6)
70 #define LED7_ON LPC_GPIO2->FIOSET = (1<<6)
57 #define LED8_ON LPC_GPIO2->FIOSET = (1<<7)
71 #define LED8_ON LPC_GPIO2->FIOSET = (1<<7)
58
72
59 #define LEDS_OFF LPC_GPIO2->FIOCLR = ~(255)
73 #define LEDS_OFF LPC_GPIO2->FIOCLR = ~(255)
60
74
61 #define LED1_OFF LPC_GPIO2->FIOCLR = (1<<0)
75 #define LED1_OFF LPC_GPIO2->FIOCLR = (1<<0)
62 #define LED2_OFF LPC_GPIO2->FIOCLR = (1<<1)
76 #define LED2_OFF LPC_GPIO2->FIOCLR = (1<<1)
63 #define LED3_OFF LPC_GPIO2->FIOCLR = (1<<2)
77 #define LED3_OFF LPC_GPIO2->FIOCLR = (1<<2)
64 #define LED4_OFF LPC_GPIO2->FIOCLR = (1<<3)
78 #define LED4_OFF LPC_GPIO2->FIOCLR = (1<<3)
65 #define LED5_OFF LPC_GPIO2->FIOCLR = (1<<4)
79 #define LED5_OFF LPC_GPIO2->FIOCLR = (1<<4)
66 #define LED6_OFF LPC_GPIO2->FIOCLR = (1<<5)
80 #define LED6_OFF LPC_GPIO2->FIOCLR = (1<<5)
67 #define LED7_OFF LPC_GPIO2->FIOCLR = (1<<6)
81 #define LED7_OFF LPC_GPIO2->FIOCLR = (1<<6)
68 #define LED8_OFF LPC_GPIO2->FIOCLR = (1<<7)
82 #define LED8_OFF LPC_GPIO2->FIOCLR = (1<<7)
69
83
70 extern int bsp_init();
84 extern int bsp_init();
71
85
72 extern void bsp_GPIO_init();
86 extern void bsp_GPIO_init();
73 extern void bsp_uart_init();
87 extern void bsp_uart_init();
74 extern void bsp_iic_init();
88 extern void bsp_iic_init();
89 extern void bsp_ssp_init();
90 extern void bsp_SD_init();
75 extern void consoleputc(char);
91 extern void consoleputc(char);
76 extern char consolegetc();
92 extern char consolegetc();
77
93
94 /* VS1053 */
95 extern void clearXCS();
96 extern void setXCS();
97 extern int vs10XXDREQ();
98
99 /* SD CARD */
100 void bsppowersdcard(char onoff);
101 char bspsdcardpresent();
102 void bspsdcardselect(char YESNO);
103 char bspsdcardwriteprotected();
104
78 #endif
105 #endif
79
106
80
107
81
108
82
109
83
110
84
111
85
112
86
113
87
114
88
115
116
117
118
119
120
121
122
123
124
@@ -1,20 +1,20
1
1
2 PROJECTDIR = `pwd`
2 PROJECTDIR = `pwd`
3 LIBUC = /opt/libuc2
3 LIBUC = /opt/libuc2
4
4
5 HEADERSINSTALLPATH = $(LIBUC_BSP_INC_DIR)/LandTiger
5 HEADERSINSTALLPATH = $(LIBUC_BSP_INC_DIR)/LandTiger
6 HEADERS += bsp.h
6 HEADERS += bsp.h
7 LIBSOURCES += bsp.c
7 LIBSOURCES += bsp.c
8 OBJECTFILES = $(LIBSOURCES:.c=.o)
8 OBJECTFILES = $(LIBSOURCES:.c=.o)
9 ARCH = lpc17XX-arm-noabi-gcc
9 ARCH = lpc17XX-arm-noabi-gcc
10 ARCHFOLDER = $(LIBUC)/rules/lpc17XX-arm-noabi-gcc
10 ARCHFOLDER = $(LIBUC)/rules/lpc17XX-arm-noabi-gcc
11 TARGET=libbsp
11 TARGET=libbsp
12 LIBUC_INCLUDES=$(LIBUC_INC_DIR_UART_CMD) $(LIBUC_INC_DIR_IIC_CMD) $(LIBUC_INC_DIR_CORE_CMD)
12 LIBUC_INCLUDES=$(LIBUC_INC_DIR_SDCARD_CMD) $(LIBUC_INC_DIR_BLKDEVICE_CMD) $(LIBUC_INC_DIR_UART_CMD) $(LIBUC_INC_DIR_SSP_CMD) $(LIBUC_INC_DIR_24LC0X_CMD) $(LIBUC_INC_DIR_IIC_CMD) $(LIBUC_INC_DIR_CORE_CMD) $(LIBUC_INC_DIR_UCSTRINGS_CMD)
13 LIBUC_LIBRARIES=$(LIBUC_LIBS_DIR_UART_CMD) $(LIBUC_LIBS_UART) $(LIBUC_LIBS_DIR_IIC_CMD) $(LIBUC_LIBS_IIC) $(LIBUC_LIBS_DIR_CORE_CMD) $(LIBUC_LIBS_CORE)
13 LIBUC_LIBRARIES=$(LIBUC_LIBS_DIR_SDCARD_CMD) $(LIBUC_LIBS_SDCARD) $(LIBUC_LIBS_DIR_BLKDEVICE_CMD) $(LIBUC_LIBS_BLKDEVICE) $(LIBUC_LIBS_DIR_UART_CMD) $(LIBUC_LIBS_UART) $(LIBUC_LIBS_DIR_SSP_CMD) $(LIBUC_LIBS_SSP) $(LIBUC_LIBS_DIR_24LC0X_CMD) $(LIBUC_LIBS_24LC0X) $(LIBUC_LIBS_DIR_IIC_CMD) $(LIBUC_LIBS_IIC) $(LIBUC_LIBS_DIR_CORE_CMD) $(LIBUC_LIBS_CORE) $(LIBUC_LIBS_DIR_UCSTRINGS_CMD) $(LIBUC_LIBS_UCSTRINGS)
14 TARGETINSTALLPATH=$(LIBUC_BSP_BIN_DIR)/LandTiger
14 TARGETINSTALLPATH=$(LIBUC_BSP_BIN_DIR)/LandTiger
15 HEADERSINSTALLPATH=$(LIBUC_BSP_INC_DIR)/LandTiger
15 HEADERSINSTALLPATH=$(LIBUC_BSP_INC_DIR)/LandTiger
16 BSP=generic
16 BSP=generic
17 include $(ARCHFOLDER)/rules.mk
17 include $(ARCHFOLDER)/rules.mk
18
18
19 all:lib
19 all:lib
20 @echo Code compiled
20 @echo Code compiled
@@ -1,100 +1,174
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the libuc, microcontroler library
2 -- This file is a part of the libuc, microcontroler library
3 -- Copyright (C) 2011, Alexis Jeandet
3 -- Copyright (C) 2011, Alexis Jeandet
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 3 of the License, or
7 -- the Free Software Foundation; either version 3 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------
18 -------------------------------------------------------------------------------
19 -- Author : Alexis Jeandet
19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@gmail.com
21 -------------------------------------------------------------------------------*/
21 -------------------------------------------------------------------------------*/
22 #include "bsp.h"
22 #include "bsp.h"
23 #include "core.h"
23 #include "core.h"
24
24
25
25
26 unsigned int OSC0 =12000000;
26 unsigned int OSC0 =12000000;
27 unsigned int INTOSC =4000000;
27 unsigned int INTOSC =4000000;
28 unsigned int RTCOSC =32768;
28 unsigned int RTCOSC =32768;
29 unsigned int currentCpuFreq=0;
29 unsigned int currentCpuFreq=0;
30 float VREF0 =(float)3.3;
30 float VREF0 =(float)3.3;
31 uartDev* UART0=(uartDev*)0;
31 uartDev* UART0=(uartDev*)0;
32 uartDev* UART1=(uartDev*)0;
32 uartDev* UART1=(uartDev*)0;
33 uartDev* UART2=(uartDev*)0;
33 uartDev* UART2=(uartDev*)0;
34 uartDev* UART3=(uartDev*)0;
34 uartDev* UART3=(uartDev*)0;
35
35
36 i2cDev* IIC0=(i2cDev*)0;
36 i2cDev* IIC0=(i2cDev*)0;
37 i2cDev* IIC1=(i2cDev*)0;
37 i2cDev* IIC1=(i2cDev*)0;
38 i2cDev* IIC2=(i2cDev*)0;
38 i2cDev* IIC2=(i2cDev*)0;
39
39
40 sspDev* SSP0=(sspDev*)0;
41 sspDev* SSP1=(sspDev*)0;
42
43 sdcardDev SDCARD0;
44 blkdevice BLKDEVSDCARD0;
45
46 eeprom24lc0xDev eeprom0;
47
40 int bsp_init()
48 int bsp_init()
41 {
49 {
42 bsp_GPIO_init();
50 bsp_GPIO_init();
43 coresetCpuFreq(20000000);
51 coresetCpuFreq(20000000);
44 currentCpuFreq=coregetCpuFreq();
52 currentCpuFreq=coregetCpuFreq();
45 coresetCpuFreq(60000000);
53 coresetCpuFreq(60000000);
46 currentCpuFreq=coregetCpuFreq();
54 currentCpuFreq=coregetCpuFreq();
47 bsp_uart_init();
55 bsp_uart_init();
48 bsp_iic_init();
56 bsp_iic_init();
57 bsp_ssp_init();
58 bsp_SD_init();
49 return 0;
59 return 0;
50 }
60 }
51
61
52 void bsp_GPIO_init()
62 void bsp_GPIO_init()
53 {
63 {
54 LPC_SC->PCONP |= ( 1 << 15 ); // power up GPIO
64 LPC_SC->PCONP |= ( 1 << 15 ); // power up GPIO
55 LPC_GPIO2->FIODIR |=255;
65 LPC_GPIO2->FIODIR |=255;
56 LEDS_OFF;
66 LEDS_OFF;
57 }
67 }
58
68
59 void bsp_uart_init()
69 void bsp_uart_init()
60 {
70 {
61 LPC_SC->PCONP |= ( 1 << 24 ); // power up UART3
71 LPC_SC->PCONP |= ( 1 << 24 ); // power up UART3
62 LPC_SC->PCONP |= ( 1 << 4 ); // power up UART1
72 LPC_SC->PCONP |= ( 1 << 4 ); // power up UART1
63 LPC_PINCON->PINSEL0 |= (1<<4);
73 LPC_PINCON->PINSEL0 |= (1<<4);
64 LPC_PINCON->PINSEL0 &= ~(1<<5);
74 LPC_PINCON->PINSEL0 &= ~(1<<5);
65 LPC_PINCON->PINSEL0 |= (1<<6);
75 LPC_PINCON->PINSEL0 |= (1<<6);
66 LPC_PINCON->PINSEL0 &= ~(1<<7);
76 LPC_PINCON->PINSEL0 &= ~(1<<7);
67 LPC_PINCON->PINSEL0 |= (1<<20);
77 LPC_PINCON->PINSEL0 |= (1<<20);
68 LPC_PINCON->PINSEL0 &= ~(1<<21);
78 LPC_PINCON->PINSEL0 &= ~(1<<21);
69 LPC_PINCON->PINSEL0 |= (1<<22);
79 LPC_PINCON->PINSEL0 |= (1<<22);
70 LPC_PINCON->PINSEL0 &= ~(1<<23);
80 LPC_PINCON->PINSEL0 &= ~(1<<23);
71 UART0= uartopen(0);
81 UART0= uartopen(0);
72 uartsetup(UART0,38400,8,1,uartNoParity);
82 uartsetup(UART0,38400,8,1,uartNoParity);
73 UART2= uartopen(2);
83 UART2= uartopen(2);
74 uartsetup(UART2,38400,8,1,uartNoParity);
84 uartsetup(UART2,38400,8,1,uartNoParity);
75 }
85 }
76
86
87 void bsp_ssp_init()
88 {
89 SSP0 = sspopen(0); // power up SSP0
90 ssppowerup(SSP0);
91 sspsetpclkfactor(SSP0,1);
92 sspsetup(SSP0,8,FFSPI|CLKINHLOW|CKfirstEdge,loopbackOFF|MASTERMODE, 350000);
93 enableSSP(SSP0);
94 LPC_PINCON->PINSEL3 |= (3<<14); //MISO0 on P1.23
95 LPC_PINCON->PINSEL3 |= (3<<16); //MOSI0 on P1.24
96 LPC_PINCON->PINSEL3 |= (3<<8); //SCK0 on P1.20
97 LPC_GPIO1->FIODIR |= (1<<24) + (1<<20);
98 LPC_PINCON->PINMODE3 &= ~(1<<14);
99 LPC_PINCON->PINMODE3 &= ~(1<<15);
100 //LPC_PINCON->PINSEL3 |= (3<<10); //SSEL0 on P1.21 disable for SDCARD -> need to send dummy clock
101
102 }
103
104
77 void bsp_iic_init()
105 void bsp_iic_init()
78 {
106 {
79 LPC_SC->PCONP |= ( 1 << 7 ); // power up IIC0
107 LPC_SC->PCONP |= ( 1 << 7 ); // power up IIC0
80 LPC_PINCON->PINSEL1 |= (1<<22);
108 LPC_PINCON->PINSEL1 |= (1<<22);
81 LPC_PINCON->PINSEL1 &= ~(1<<23);
109 LPC_PINCON->PINSEL1 &= ~(1<<23);
82 LPC_PINCON->PINSEL1 |= (1<<24);
110 LPC_PINCON->PINSEL1 |= (1<<24);
83 LPC_PINCON->PINSEL1 &= ~(1<<25);
111 LPC_PINCON->PINSEL1 &= ~(1<<25);
84 IIC0 = i2copen(0);
112 IIC0 = i2copen(0);
85 i2csetdatarate(IIC0,100000);
113 i2csetdatarate(IIC0,100000);
114 eeprom24lc0xopen(&eeprom0,IIC0,0,2048);
115 }
116
117 void bsp_SD_init()
118 {
119 LPC_GPIO1->FIODIR |=1<<21; //SD chip select on P1.21
120 LPC_GPIO1->FIOSET = 1<<21; //unselect SD card
121 LPC_GPIO3->FIODIR |=1<<26;
122 LPC_GPIO3->FIODIR &= ~(1<<25);
123 LPC_GPIO3->FIOCLR |=1<<26;
124 sdcardmake(&SDCARD0,SSP0,&sspgetnc,&sspputnc,&sspsetdatarate);
125 sdcardmakeblkdev(&BLKDEVSDCARD0,&SDCARD0,&bspsdcardselect,&bsppowersdcard,&bspsdcardpresent,&bspsdcardwriteprotected);
126 //BLKDEVSDCARD0.initialize(&BLKDEVSDCARD0,0);
86 }
127 }
87
128
88 void consoleputc(char c)
129 void consoleputc(char c)
89 {
130 {
90 uartputc(UART0,c);
131 uartputc(UART0,c);
91 }
132 }
92
133
93
134
94 char consolegetc()
135 char consolegetc()
95 {
136 {
96 return uartgetc(UART0);
137 return uartgetc(UART0);
97 }
138 }
98
139
99
140
100
141
142 void vs10XXclearXCS(){}
143 void vs10XXsetXCS(){}
144 int vs10XXDREQ()
145 {
146 return 1;
147 }
148
149
150 void bsppowersdcard(char onoff) //always ON
151 {
152
153 }
154
155 char bspsdcardpresent()
156 {
157 return (((LPC_GPIO3->FIOPIN >> 25) & 1) ^1);
158 }
159
160 char bspsdcardwriteprotected()
161 {
162 return 0;
163 }
164
165 void bspsdcardselect(char YESNO)
166 {
167
168 LPC_GPIO1->FIOPIN = ((YESNO & 1)^1)<<21;
169 }
170
171
172
173
174
@@ -1,20 +1,35
1 bsp.o: bsp.c bsp.h /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/LPC17xx.h \
1 bsp.o: bsp.c bsp.h /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/LPC17xx.h \
2 /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/core_cm3.h \
2 /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/core_cm3.h \
3 /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/system_LPC17xx.h \
3 /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/system_LPC17xx.h \
4 /opt/libuc2/lib/includes/lpc17XX/UART/uart.h \
4 /opt/libuc2/lib/includes/lpc17XX/UART/uart.h \
5 /opt/libuc2/lib/includes/lpc17XX/IIC/iic.h \
5 /opt/libuc2/lib/includes/lpc17XX/IIC/iic.h \
6 /opt/libuc2/lib/includes/lpc17XX/SSP/ssp.h \
7 /opt/libuc2/lib/includes/lpc17XX/24LCXX/24LC0X/24LC0X.h \
8 /opt/libuc2/lib/includes/lpc17XX/BLKDEVICE/blkdevice.h \
9 /opt/libuc2/lib/includes/lpc17XX/SDCARD/sdcard.h \
10 /opt/libuc2/lib/includes/lpc17XX/STRINGS/lpc17XX-arm-noabi-gcc/libucstrings.h \
6 /opt/libuc2/lib/includes/lpc17XX/CORE/core.h
11 /opt/libuc2/lib/includes/lpc17XX/CORE/core.h
7
12
8 bsp.h:
13 bsp.h:
9
14
10 /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/LPC17xx.h:
15 /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/LPC17xx.h:
11
16
12 /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/core_cm3.h:
17 /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/core_cm3.h:
13
18
14 /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/system_LPC17xx.h:
19 /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/system_LPC17xx.h:
15
20
16 /opt/libuc2/lib/includes/lpc17XX/UART/uart.h:
21 /opt/libuc2/lib/includes/lpc17XX/UART/uart.h:
17
22
18 /opt/libuc2/lib/includes/lpc17XX/IIC/iic.h:
23 /opt/libuc2/lib/includes/lpc17XX/IIC/iic.h:
19
24
25 /opt/libuc2/lib/includes/lpc17XX/SSP/ssp.h:
26
27 /opt/libuc2/lib/includes/lpc17XX/24LCXX/24LC0X/24LC0X.h:
28
29 /opt/libuc2/lib/includes/lpc17XX/BLKDEVICE/blkdevice.h:
30
31 /opt/libuc2/lib/includes/lpc17XX/SDCARD/sdcard.h:
32
33 /opt/libuc2/lib/includes/lpc17XX/STRINGS/lpc17XX-arm-noabi-gcc/libucstrings.h:
34
20 /opt/libuc2/lib/includes/lpc17XX/CORE/core.h:
35 /opt/libuc2/lib/includes/lpc17XX/CORE/core.h:
@@ -1,88 +1,124
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the libuc, microcontroler library
2 -- This file is a part of the libuc, microcontroler library
3 -- Copyright (C) 2011, Alexis Jeandet
3 -- Copyright (C) 2011, Alexis Jeandet
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 3 of the License, or
7 -- the Free Software Foundation; either version 3 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------
18 -------------------------------------------------------------------------------
19 -- Author : Alexis Jeandet
19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@gmail.com
21 -------------------------------------------------------------------------------*/
21 -------------------------------------------------------------------------------*/
22 #ifndef BSP_H
22 #ifndef BSP_H
23 #define BSP_H
23 #define BSP_H
24 #include "LPC17xx.h"
24 #include "LPC17xx.h"
25 #include <uart.h>
25 #include <uart.h>
26 #include <iic.h>
26 #include <iic.h>
27 #include <ssp.h>
28 #include <24LC0X.h>
29 #include <blkdevice.h>
30 #include <sdcard.h>
27
31
28
32
29 extern uartDev* UART0;
33 extern uartDev* UART0;
30 extern uartDev* UART1;
34 extern uartDev* UART1;
31 extern uartDev* UART2;
35 extern uartDev* UART2;
32 extern uartDev* UART3;
36 extern uartDev* UART3;
33
37
34 extern i2cDev* IIC0;
38 extern i2cDev* IIC0;
35 extern i2cDev* IIC1;
39 extern i2cDev* IIC1;
36 extern i2cDev* IIC2;
40 extern i2cDev* IIC2;
37
41
42 extern sspDev* SSP0;
43 extern sspDev* SSP1;
44
45 extern sdcardDev SDCARD0;
46 extern blkdevice BLKDEVSDCARD0;
47
48 extern eeprom24lc0xDev eeprom0;
49
38 extern float VREF0;
50 extern float VREF0;
39
51
52 extern unsigned int currentCpuFreq;
53
40 #define pll0useInternal 0
54 #define pll0useInternal 0
41 #define pll0useMainOsc 1
55 #define pll0useMainOsc 1
42 #define pll0useRTC 2
56 #define pll0useRTC 2
43
57
44
58
45 #define pll0setClksrc(src) if((unsigned int)(src)<3) LPC_SC->CLKSRCSEL=(src)
59 #define pll0setClksrc(src) if((unsigned int)(src)<3) LPC_SC->CLKSRCSEL=(src)
46 #define pll0getClksrc (LPC_SC->CLKSRCSEL & 3)
60 #define pll0getClksrc (LPC_SC->CLKSRCSEL & 3)
47
61
48 #define LEDS_ON LPC_GPIO2->FIOSET = 255
62 #define LEDS_ON LPC_GPIO2->FIOSET = 255
49
63
50 #define LED1_ON LPC_GPIO2->FIOSET = (1<<0)
64 #define LED1_ON LPC_GPIO2->FIOSET = (1<<0)
51 #define LED2_ON LPC_GPIO2->FIOSET = (1<<1)
65 #define LED2_ON LPC_GPIO2->FIOSET = (1<<1)
52 #define LED3_ON LPC_GPIO2->FIOSET = (1<<2)
66 #define LED3_ON LPC_GPIO2->FIOSET = (1<<2)
53 #define LED4_ON LPC_GPIO2->FIOSET = (1<<3)
67 #define LED4_ON LPC_GPIO2->FIOSET = (1<<3)
54 #define LED5_ON LPC_GPIO2->FIOSET = (1<<4)
68 #define LED5_ON LPC_GPIO2->FIOSET = (1<<4)
55 #define LED6_ON LPC_GPIO2->FIOSET = (1<<5)
69 #define LED6_ON LPC_GPIO2->FIOSET = (1<<5)
56 #define LED7_ON LPC_GPIO2->FIOSET = (1<<6)
70 #define LED7_ON LPC_GPIO2->FIOSET = (1<<6)
57 #define LED8_ON LPC_GPIO2->FIOSET = (1<<7)
71 #define LED8_ON LPC_GPIO2->FIOSET = (1<<7)
58
72
59 #define LEDS_OFF LPC_GPIO2->FIOCLR = ~(255)
73 #define LEDS_OFF LPC_GPIO2->FIOCLR = ~(255)
60
74
61 #define LED1_OFF LPC_GPIO2->FIOCLR = (1<<0)
75 #define LED1_OFF LPC_GPIO2->FIOCLR = (1<<0)
62 #define LED2_OFF LPC_GPIO2->FIOCLR = (1<<1)
76 #define LED2_OFF LPC_GPIO2->FIOCLR = (1<<1)
63 #define LED3_OFF LPC_GPIO2->FIOCLR = (1<<2)
77 #define LED3_OFF LPC_GPIO2->FIOCLR = (1<<2)
64 #define LED4_OFF LPC_GPIO2->FIOCLR = (1<<3)
78 #define LED4_OFF LPC_GPIO2->FIOCLR = (1<<3)
65 #define LED5_OFF LPC_GPIO2->FIOCLR = (1<<4)
79 #define LED5_OFF LPC_GPIO2->FIOCLR = (1<<4)
66 #define LED6_OFF LPC_GPIO2->FIOCLR = (1<<5)
80 #define LED6_OFF LPC_GPIO2->FIOCLR = (1<<5)
67 #define LED7_OFF LPC_GPIO2->FIOCLR = (1<<6)
81 #define LED7_OFF LPC_GPIO2->FIOCLR = (1<<6)
68 #define LED8_OFF LPC_GPIO2->FIOCLR = (1<<7)
82 #define LED8_OFF LPC_GPIO2->FIOCLR = (1<<7)
69
83
70 extern int bsp_init();
84 extern int bsp_init();
71
85
72 extern void bsp_GPIO_init();
86 extern void bsp_GPIO_init();
73 extern void bsp_uart_init();
87 extern void bsp_uart_init();
74 extern void bsp_iic_init();
88 extern void bsp_iic_init();
89 extern void bsp_ssp_init();
90 extern void bsp_SD_init();
75 extern void consoleputc(char);
91 extern void consoleputc(char);
76 extern char consolegetc();
92 extern char consolegetc();
77
93
94 /* VS1053 */
95 extern void clearXCS();
96 extern void setXCS();
97 extern int vs10XXDREQ();
98
99 /* SD CARD */
100 void bsppowersdcard(char onoff);
101 char bspsdcardpresent();
102 void bspsdcardselect(char YESNO);
103 char bspsdcardwriteprotected();
104
78 #endif
105 #endif
79
106
80
107
81
108
82
109
83
110
84
111
85
112
86
113
87
114
88
115
116
117
118
119
120
121
122
123
124
@@ -1,12 +1,12
1 TEMPLATE = lib
1 TEMPLATE = lib
2 ARCH = lpc17XX-arm-noabi-gcc
2 ARCH = lpc17XX-arm-noabi-gcc
3 TARGET = libbsp
3 TARGET = libbsp
4 TARGETINSTALLPATH = $(LIBUC_BSP_BIN_DIR)/LandTiger
4 TARGETINSTALLPATH = $(LIBUC_BSP_BIN_DIR)/LandTiger
5 HEADERSINSTALLPATH = $(LIBUC_BSP_INC_DIR)/LandTiger
5 HEADERSINSTALLPATH = $(LIBUC_BSP_INC_DIR)/LandTiger
6
6
7 LIBS += UART IIC CORE
7 LIBS += SDCARD BLKDEVICE UART SSP 24LC0X IIC CORE UCSTRINGS
8
8
9 SOURCES += bsp.c
9 SOURCES += bsp.c
10
10
11
11
12 HEADERS += bsp.h
12 HEADERS += bsp.h
@@ -1,4 +1,4
1 TEMPLATE = dir
1 TEMPLATE = dir
2 SUBDIRS += generic \
2 SUBDIRS += generic \
3 LandTiger \
3 LandTiger \
4 mbed
4 mbed
@@ -1,19 +1,17
1
1
2 PROJECTDIR = `pwd`
2 PROJECTDIR = `pwd`
3 LIBUC = /opt/libuc2
3 LIBUC = /opt/libuc2
4 include $(LIBUC)/rules/common/rules.mk
4 include $(LIBUC)/rules/common/rules.mk
5
5
6 all:subdir
6 all:subdir
7 make -C lpc1768_led_blink
7 make -C lpc17XX
8 make -C lpc1768_led_blink_Clk_api
8 make -C SDCARD
9 make -C lpc1768_uart
9 make -C SDCARD2
10 make -C lpc1768_uart_LandTiger
11 @echo Code compiled
10 @echo Code compiled
12
11
13 clean:
12 clean:
14 make clean -C lpc1768_led_blink
13 make clean -C lpc17XX
15 make clean -C lpc1768_led_blink_Clk_api
14 make clean -C SDCARD
16 make clean -C lpc1768_uart
15 make clean -C SDCARD2
17 make clean -C lpc1768_uart_LandTiger
18 @echo Code compiled
16 @echo Code compiled
19
17
@@ -1,6 +1,4
1 TEMPLATE = dir
1 TEMPLATE = dir
2 SUBDIRS += lpc1768_led_blink\
2 SUBDIRS += lpc17XX \
3 lpc1768_led_blink_Clk_api \
3 SDCARD \
4 lpc1768_uart \
4 SDCARD2
5 lpc1768_uart_LandTiger
6
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
@@ -1,70 +1,70
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the libuc, microcontroler library
2 -- This file is a part of the libuc, microcontroler library
3 -- Copyright (C) 2011, Alexis Jeandet
3 -- Copyright (C) 2011, Alexis Jeandet
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 3 of the License, or
7 -- the Free Software Foundation; either version 3 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------
18 -------------------------------------------------------------------------------
19 -- Author : Alexis Jeandet
19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@gmail.com
21 -------------------------------------------------------------------------------*/
21 -------------------------------------------------------------------------------*/
22 #ifndef IIC_H
22 #ifndef IIC_H
23 #define IIC_H
23 #define IIC_H
24 #include "LPC17xx.h"
24 #include "LPC17xx.h"
25
25
26 enum iicctrlvals
26 enum iicctrlvals
27 {
27 {
28 i2noerr,
28 i2noerr,
29 i2noack,
29 i2noack,
30 i2arbloss,
30 i2arbloss,
31 i2busy,
31 i2busy,
32 i2timeout
32 i2timeout
33 };
33 };
34
34
35 typedef enum iicctrlvals i2ctrl;
35 typedef enum iicctrlvals i2ctrl;
36
36
37 struct lpc17XXi2cRegs
37 struct lpc17XXi2cRegs
38 {
38 {
39 unsigned long I2CONSET;
39 unsigned long I2CONSET;
40 unsigned long I2STAT;
40 unsigned long I2STAT;
41 unsigned long I2DAT;
41 unsigned long I2DAT;
42 unsigned long I2ADR;
42 unsigned long I2ADR;
43 unsigned long I2SCLH;
43 unsigned long I2SCLH;
44 unsigned long I2SCLL;
44 unsigned long I2SCLL;
45 unsigned long I2CONCLR;
45 unsigned long I2CONCLR;
46 };
46 };
47
47
48 typedef volatile struct lpc17XXi2cRegs i2cDev;
48 typedef volatile struct lpc17XXi2cRegs i2cDev;
49
49
50 extern i2ctrl i2cwrite(i2cDev* dev,char address,char*data,int* cnt);
50 extern i2ctrl i2cwrite(i2cDev* dev,char address,char*data,int* cnt);
51 extern i2ctrl i2cwrite2(i2cDev* dev,char address,char*cmd,int* cmdcnt,char*data,int* datcnt);
51 extern i2ctrl i2cwrite2(i2cDev* dev,char address,char*cmd,int* cmdcnt,char*data,int* datcnt);
52 extern i2ctrl i2cread(i2cDev* dev,char address,char*data,int* cnt);
52 extern i2ctrl i2cread(i2cDev* dev,char address,char*data,int* cnt);
53 extern i2cDev* i2copen(int count);
53 extern i2cDev* i2copen(int count);
54 extern void i2cenable(i2cDev* dev);
54 extern void i2cenable(i2cDev* dev);
55 extern void i2cdisable(i2cDev* dev);
55 extern void i2cdisable(i2cDev* dev);
56 extern void i2csetup(i2cDev* dev,int clkH,int clkL);
56 extern void i2csetup(i2cDev* dev,int clkH,int clkL);
57 extern unsigned char i2cgetpclkfactor(i2cDev* dev);
57 extern unsigned char i2cgetpclkfactor(i2cDev* dev);
58 extern void i2csetpclkfactor(i2cDev* dev,unsigned char pclkfactor);
58 extern void i2csetpclkfactor(i2cDev* dev,unsigned char pclkfactor);
59 extern void i2csetdatarate(i2cDev* dev,unsigned int dataRate);
59 extern void i2csetdatarate(i2cDev* dev,unsigned int dataRate);
60
60 extern int i2cgetdatarate(i2cDev* dev);
61 #endif
61 #endif
62
62
63
63
64
64
65
65
66
66
67
67
68
68
69
69
70
70
@@ -1,28 +1,29
1 #/*------------------------------------------------------------------------------
1 #/*------------------------------------------------------------------------------
2 #-- This file is a part of the libuc, microcontroler library
2 #-- This file is a part of the libuc, microcontroler library
3 #-- Copyright (C) 2011, Alexis Jeandet
3 #-- Copyright (C) 2011, Alexis Jeandet
4 #--
4 #--
5 #-- This program is free software; you can redistribute it and/or modify
5 #-- This program is free software; you can redistribute it and/or modify
6 #-- it under the terms of the GNU General Public License as published by
6 #-- it under the terms of the GNU General Public License as published by
7 #-- the Free Software Foundation; either version 3 of the License, or
7 #-- the Free Software Foundation; either version 3 of the License, or
8 #-- (at your option) any later version.
8 #-- (at your option) any later version.
9 #--
9 #--
10 #-- This program is distributed in the hope that it will be useful,
10 #-- This program is distributed in the hope that it will be useful,
11 #-- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 #-- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 #-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 #-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 #-- GNU General Public License for more details.
13 #-- GNU General Public License for more details.
14 #--
14 #--
15 #-- You should have received a copy of the GNU General Public License
15 #-- You should have received a copy of the GNU General Public License
16 #-- along with this program; if not, write to the Free Software
16 #-- along with this program; if not, write to the Free Software
17 #-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 #-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 #-------------------------------------------------------------------------------
18 #-------------------------------------------------------------------------------
19 #-- Author : Alexis Jeandet
19 #-- Author : Alexis Jeandet
20 #-- Mail : alexis.jeandet@gmail.com
20 #-- Mail : alexis.jeandet@gmail.com
21 #-------------------------------------------------------------------------------*/
21 #-------------------------------------------------------------------------------*/
22
22
23
23
24
24
25 void clearstr(char* a);
25 void clearstr(char* a);
26 void int2hex(unsigned long a,char*b);
26 void int2hex(unsigned long a,char*b);
27 int libucprintf(const char*,...);
27 int libucprintf(const char*,...);
28 int libucscanf(const char*,...);
28 int libucscanf(const char*,...);
29 void libucprintchartable(char* table,int size,const char* format,const char* separator);
@@ -1,13 +1,17
1
1
2 PROJECTDIR = `pwd`
2 PROJECTDIR = `pwd`
3 LIBUC = /opt/libuc2
3 LIBUC = /opt/libuc2
4 include $(LIBUC)/rules/common/rules.mk
4 include $(LIBUC)/rules/common/rules.mk
5
5
6 all:subdir
6 all:subdir
7 make -C lpc21XX
7 make -C lpc17XX
8 make -C lpc17XX
9 make -C common
8 @echo Code compiled
10 @echo Code compiled
9
11
10 clean:
12 clean:
13 make clean -C lpc21XX
11 make clean -C lpc17XX
14 make clean -C lpc17XX
15 make clean -C common
12 @echo Code compiled
16 @echo Code compiled
13
17
@@ -1,19 +1,7
1
1
2 PROJECTDIR = `pwd`
2 PROJECTDIR = `pwd`
3 LIBUC = /opt/libuc2
3 LIBUC = /opt/libuc2
4
4
5 HEADERSINSTALLPATH = $(LIBUC_INC_DIR)/STRINGS
5 all:
6 HEADERS += libucstrings.h
6 make -f lpc17XX.mk
7 LIBSOURCES += libucstrings.c
7 make -f lpc21XX.mk
8 OBJECTFILES = $(LIBSOURCES:.c=.o)
9 ARCH = $(LIBUC)/rules/lpc17XX-arm-noabi-gcc
10 TARGET=libucstrings
11 LIBUC_INCLUDES=
12 LIBUC_LIBRARIES=
13 TARGETINSTALLPATH=$(LIBUC_LIBS_DIR)/STRINGS
14 HEADERSINSTALLPATH=$(LIBUC_INC_DIR)/STRINGS
15 BSP=generic
16 include $(ARCH)/rules.mk
17
18 all:lib
19 @echo Code compiled
@@ -1,318 +1,326
1 #/*------------------------------------------------------------------------------
1 #/*------------------------------------------------------------------------------
2 #-- This file is a part of the libuc, microcontroler library
2 #-- This file is a part of the libuc, microcontroler library
3 #-- Copyright (C) 2011, Alexis Jeandet
3 #-- Copyright (C) 2011, Alexis Jeandet
4 #--
4 #--
5 #-- This program is free software; you can redistribute it and/or modify
5 #-- This program is free software; you can redistribute it and/or modify
6 #-- it under the terms of the GNU General Public License as published by
6 #-- it under the terms of the GNU General Public License as published by
7 #-- the Free Software Foundation; either version 3 of the License, or
7 #-- the Free Software Foundation; either version 3 of the License, or
8 #-- (at your option) any later version.
8 #-- (at your option) any later version.
9 #--
9 #--
10 #-- This program is distributed in the hope that it will be useful,
10 #-- This program is distributed in the hope that it will be useful,
11 #-- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 #-- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 #-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 #-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 #-- GNU General Public License for more details.
13 #-- GNU General Public License for more details.
14 #--
14 #--
15 #-- You should have received a copy of the GNU General Public License
15 #-- You should have received a copy of the GNU General Public License
16 #-- along with this program; if not, write to the Free Software
16 #-- along with this program; if not, write to the Free Software
17 #-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 #-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 #-------------------------------------------------------------------------------
18 #-------------------------------------------------------------------------------
19 #-- Author : Alexis Jeandet
19 #-- Author : Alexis Jeandet
20 #-- Mail : alexis.jeandet@gmail.com
20 #-- Mail : alexis.jeandet@gmail.com
21 #-------------------------------------------------------------------------------*/
21 #-------------------------------------------------------------------------------*/
22 #include <stdarg.h>
22 #include <stdarg.h>
23 #include "libucstrings.h"
23 #include "libucstrings.h"
24 extern void consoleputc(char);
24 extern void consoleputc(char);
25 extern char consolegetc();
25 extern char consolegetc();
26 #define _x_prtconv_(a) printhexfromint((a),39)
26 #define _x_prtconv_(a) printhexfromint((a),39)
27 #define _X_prtconv_(a) printhexfromint((a),7)
27 #define _X_prtconv_(a) printhexfromint((a),7)
28 #define _d_prtconv_(a) printdecfromint((a))
28 #define _d_prtconv_(a) printdecfromint((a))
29
29
30 #define _x_scnconv_() scanintfromhex()
30 #define _x_scnconv_() scanintfromhex()
31 #define _d_scnconv_() scanintfromdec()
31 #define _d_scnconv_() scanintfromdec()
32
32
33 void clearch(char* a)
33 void clearch(char* a)
34 {
34 {
35 while((*a))
35 while((*a))
36 *a++=' ';
36 *a++=' ';
37 a--;
37 a--;
38 *a='\n';
38 *a='\n';
39 }
39 }
40
40
41
41
42 int scanintfromdec()
42 int scanintfromdec()
43 {
43 {
44 char c[8]=" ";
44 char c[8]=" ";
45 int e=0;
45 int e=0;
46 int result=0;
46 int result=0;
47 do
47 do
48 {
48 {
49 c[e] = consolegetc();
49 c[e] = consolegetc();
50 consoleputc(c[e]);
50 consoleputc(c[e]);
51 if(((c[e] & 0xF0) == 0x30))
51 if(((c[e] & 0xF0) == 0x30))
52 e++;
52 e++;
53 }while( (c[e]!='\n') && (e<8));
53 }while( (c[e]!='\n') && (e<8));
54 libucprintf("\n%d number(s) read\n",e);
54 libucprintf("\n%d number(s) read\n",e);
55 int i=0;
55 int i=0;
56 while((i<e))
56 while((i<e))
57 {
57 {
58 c[i]&=0x0F;
58 c[i]&=0x0F;
59 result = (result*10) + c[i];
59 result = (result*10) + c[i];
60 libucprintf("iterration %d c[i]=%d result=%d\n",i,c[i],result);
60 libucprintf("iterration %d c[i]=%d result=%d\n",i,c[i],result);
61 i++;
61 i++;
62 }
62 }
63 return result;
63 return result;
64 }
64 }
65
65
66
66
67 int scanintfromhex()
67 int scanintfromhex()
68 {
68 {
69 char c[8]=" ";
69 char c[8]=" ";
70 int e=0;
70 int e=0;
71 int result=0;
71 int result=0;
72 do
72 do
73 {
73 {
74 c[e] = consolegetc();
74 c[e] = consolegetc();
75 consoleputc(c[e]);
75 consoleputc(c[e]);
76 if(((c[e] & 0xF0) == 0x30)||((c[e]&0xF8)==0x40)||((c[e]&0xF8)==0x60))
76 if(((c[e] & 0xF0) == 0x30)||((c[e]&0xF8)==0x40)||((c[e]&0xF8)==0x60))
77 e++;
77 e++;
78 }while( (c[e]!='\n') && (e<8));
78 }while( (c[e]!='\n') && (e<8));
79 int i=0;
79 int i=0;
80 libucprintf("\n%d number(s) read\n",e);
80 libucprintf("\n%d number(s) read\n",e);
81 while(i<e)
81 while(i<e)
82 {
82 {
83 libucprintf("c[i] = %x\n",c[i]);
83 libucprintf("c[i] = %x\n",c[i]);
84 if((c[i]&0xF8)==0x60)
84 if((c[i]&0xF8)==0x60)
85 {
85 {
86 c[i]-=39;
86 c[i]-=39;
87 }
87 }
88 else
88 else
89 {
89 {
90 if((c[i]&0xF8)==0x40)
90 if((c[i]&0xF8)==0x40)
91 {
91 {
92 c[i]-=7;
92 c[i]-=7;
93 }
93 }
94 else
94 else
95 {
95 {
96 c[i]&=0x0F;
96 c[i]&=0x0F;
97 }
97 }
98 }
98 }
99 result = result*16 + c[i];
99 result = result*16 + c[i];
100 i++;
100 i++;
101 }
101 }
102 return result;
102 return result;
103 }
103 }
104
104
105 void printhexfromint(int a, int caseoffset)
105 void printhexfromint(int a, int caseoffset)
106 {
106 {
107 char c[8]=" ";
107 char c[8]=" ";
108 int e=0;
108 int e=0;
109 while(e<8)
109 while(e<8)
110 {
110 {
111 c[e] = a & 0xF;
111 c[e] = a & 0xF;
112 if(c[e]>9)
112 if(c[e]>9)
113 {
113 {
114 c[e] = c[e]+caseoffset;
114 c[e] = c[e]+caseoffset;
115 }
115 }
116 c[e] = c[e] + 0x30;
116 c[e] = c[e] + 0x30;
117 a=a>>4;
117 a=a>>4;
118 e++;
118 e++;
119 }
119 }
120 while(c[--e]=='0');
120 while(c[--e]=='0');
121 e++;
121 e++;
122 while(e-->0)
122 while(e-->0)
123 consoleputc(c[e]);
123 consoleputc(c[e]);
124 }
124 }
125
125
126
126
127 void printdecfromint(int a)
127 void printdecfromint(int a)
128 {
128 {
129 char c[10]=" ";
129 char c[10]=" ";
130 int e=0;
130 int e=0;
131 int d=a;
131 int d=a;
132 if((d & 0x80000000) == 0x80000000)
132 if((d & 0x80000000) == 0x80000000)
133 {
133 {
134 d ^= -1;
134 d ^= -1;
135 d++;
135 d++;
136 consoleputc('-');
136 consoleputc('-');
137 }
137 }
138 while(d>0 && e<10)
138 while(d>0 && e<10)
139 {
139 {
140 c[e++] = 0x30 + (d % 10);
140 c[e++] = 0x30 + (d % 10);
141 d = d / 10;
141 d = d / 10;
142 }
142 }
143 while(e-->0)
143 while(e-->0)
144 consoleputc(c[e]);
144 consoleputc(c[e]);
145 }
145 }
146
146
147 void int2hex(unsigned long a,char*b)
147 void int2hex(unsigned long a,char*b)
148 {
148 {
149 char*d = b;
149 char*d = b;
150 char c[16]=" ";
150 char c[16]=" ";
151 int e=0;
151 int e=0;
152 while(e<8)
152 while(e<8)
153 {
153 {
154 c[e] = a & 0xF;
154 c[e] = a & 0xF;
155 if(c[e]>9)
155 if(c[e]>9)
156 {
156 {
157 c[e] = c[e]+7;
157 c[e] = c[e]+7;
158 }
158 }
159 c[e] = c[e] + 0x30;
159 c[e] = c[e] + 0x30;
160 a=a>>4;
160 a=a>>4;
161 e++;
161 e++;
162 }
162 }
163 for(e=(e-1);e>=0;e--)
163 for(e=(e-1);e>=0;e--)
164 {
164 {
165 *d=c[e];
165 *d=c[e];
166 d = d +1;
166 d = d +1;
167 }
167 }
168 }
168 }
169
169
170 /// Partialy implemented printf function capable to compute %d,x,X conversions
170 /// Partialy implemented printf function capable to compute %d,x,X conversions
171 int libucprintf(const char* format,...)
171 int libucprintf(const char* format,...)
172 {
172 {
173 int nout=0;
173 int nout=0;
174 va_list ap;
174 va_list ap;
175 va_start(ap,format);
175 va_start(ap,format);
176 while(*format)
176 while(*format)
177 {
177 {
178 if(*format!='%')
178 if(*format!='%')
179 {
179 {
180 consoleputc(*format++);
180 consoleputc(*format++);
181 nout++;
181 nout++;
182 }
182 }
183 else
183 else
184 {
184 {
185 format++;
185 format++;
186 if(*format!='%')
186 if(*format!='%')
187 {
187 {
188 switch(*format)
188 switch(*format)
189 {
189 {
190 case 'c':
190 case 'c':
191 consoleputc((char)va_arg(ap,int));
191 consoleputc((char)va_arg(ap,int));
192 format++;
192 format++;
193 break;
193 break;
194 case 'd':
194 case 'd':
195 _d_prtconv_(va_arg(ap,int)) ;
195 _d_prtconv_(va_arg(ap,int)) ;
196 format++;
196 format++;
197 break;
197 break;
198 case 'e':
198 case 'e':
199 va_arg(ap,int);
199 va_arg(ap,int);
200 format++;
200 format++;
201 break;
201 break;
202 case 'E':
202 case 'E':
203 va_arg(ap,int);
203 va_arg(ap,int);
204 format++;
204 format++;
205 break;
205 break;
206 case 'f':
206 case 'f':
207 va_arg(ap,int);
207 va_arg(ap,int);
208 format++;
208 format++;
209 break;
209 break;
210 case 's':
210 case 's':
211 va_arg(ap,int);
211 va_arg(ap,int);
212 format++;
212 format++;
213 break;
213 break;
214 case 'x':
214 case 'x':
215 _x_prtconv_(va_arg(ap,int)) ;
215 _x_prtconv_(va_arg(ap,int)) ;
216 format++;
216 format++;
217 break;
217 break;
218 case 'X':
218 case 'X':
219 _X_prtconv_(va_arg(ap,int)) ;
219 _X_prtconv_(va_arg(ap,int)) ;
220 format++;
220 format++;
221 break;
221 break;
222 case '%':
222 case '%':
223 consoleputc(*format++);
223 consoleputc(*format++);
224 break;
224 break;
225 default:
225 default:
226 va_arg(ap,int);
226 va_arg(ap,int);
227 format++;
227 format++;
228 break;
228 break;
229 }
229 }
230 }
230 }
231 else
231 else
232 {
232 {
233 consoleputc(*format++);
233 consoleputc(*format++);
234 nout++;
234 nout++;
235 }
235 }
236 }
236 }
237 }
237 }
238 va_end(ap);
238 va_end(ap);
239 return nout;
239 return nout;
240 }
240 }
241
241
242
242
243 int libucscanf(const char* format,...)
243 int libucscanf(const char* format,...)
244 {
244 {
245 int nin=0;
245 int nin=0;
246 int* value;
246 int* value;
247 va_list ap;
247 va_list ap;
248 va_start(ap,format);
248 va_start(ap,format);
249 while(*format)
249 while(*format)
250 {
250 {
251 while(*format!='%')format++;
251 while(*format!='%')format++;
252 format++;
252 format++;
253 libucprintf("find %%%c\n",*format);
253 libucprintf("find %%%c\n",*format);
254 switch(*format)
254 switch(*format)
255 {
255 {
256 case 'c':
256 case 'c':
257 va_arg(ap,int*);
257 va_arg(ap,int*);
258 format++;
258 format++;
259 break;
259 break;
260 case 'd':
260 case 'd':
261 value = (int*)va_arg(ap,int*);
261 value = (int*)va_arg(ap,int*);
262 *value=_d_scnconv_() ;
262 *value=_d_scnconv_() ;
263 format++;
263 format++;
264 break;
264 break;
265 case 'e':
265 case 'e':
266 va_arg(ap,int*);
266 va_arg(ap,int*);
267 format++;
267 format++;
268 break;
268 break;
269 case 'E':
269 case 'E':
270 va_arg(ap,int*);
270 va_arg(ap,int*);
271 format++;
271 format++;
272 break;
272 break;
273 case 'f':
273 case 'f':
274 va_arg(ap,int*);
274 va_arg(ap,int*);
275 format++;
275 format++;
276 break;
276 break;
277 case 's':
277 case 's':
278 va_arg(ap,int*);
278 va_arg(ap,int*);
279 format++;
279 format++;
280 break;
280 break;
281 case 'u':
281 case 'u':
282 va_arg(ap,int*);
282 va_arg(ap,int*);
283 format++;
283 format++;
284 break;
284 break;
285 case 'x':
285 case 'x':
286 value = (int*)va_arg(ap,int*);
286 value = (int*)va_arg(ap,int*);
287 *value = _x_scnconv_();
287 *value = _x_scnconv_();
288 format++;
288 format++;
289 break;
289 break;
290 case 'X':
290 case 'X':
291 value = (int*)va_arg(ap,int*);
291 value = (int*)va_arg(ap,int*);
292 *value = _x_scnconv_();
292 *value = _x_scnconv_();
293 format++;
293 format++;
294 break;
294 break;
295 default:
295 default:
296 va_arg(ap,int*);
296 va_arg(ap,int*);
297 format++;
297 format++;
298 break;
298 break;
299 }
299 }
300
300
301 }
301 }
302 va_end(ap);
302 va_end(ap);
303 return nin;
303 return nin;
304 }
304 }
305
305
306
306
307
307
308
308
309 void libucprintchartable(char* table,int size,const char* format,const char* separator)
310 {
311 int i =0;
312 for(i=0;i<size;i++)
313 {
314 libucprintf(format,table[i]);
315 libucprintf(separator);
316 }
317 }
309
318
310
319
311
320
312
321
313
322
314
323
315
324
316
325
317
326
318
@@ -1,28 +1,29
1 #/*------------------------------------------------------------------------------
1 #/*------------------------------------------------------------------------------
2 #-- This file is a part of the libuc, microcontroler library
2 #-- This file is a part of the libuc, microcontroler library
3 #-- Copyright (C) 2011, Alexis Jeandet
3 #-- Copyright (C) 2011, Alexis Jeandet
4 #--
4 #--
5 #-- This program is free software; you can redistribute it and/or modify
5 #-- This program is free software; you can redistribute it and/or modify
6 #-- it under the terms of the GNU General Public License as published by
6 #-- it under the terms of the GNU General Public License as published by
7 #-- the Free Software Foundation; either version 3 of the License, or
7 #-- the Free Software Foundation; either version 3 of the License, or
8 #-- (at your option) any later version.
8 #-- (at your option) any later version.
9 #--
9 #--
10 #-- This program is distributed in the hope that it will be useful,
10 #-- This program is distributed in the hope that it will be useful,
11 #-- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 #-- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 #-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 #-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 #-- GNU General Public License for more details.
13 #-- GNU General Public License for more details.
14 #--
14 #--
15 #-- You should have received a copy of the GNU General Public License
15 #-- You should have received a copy of the GNU General Public License
16 #-- along with this program; if not, write to the Free Software
16 #-- along with this program; if not, write to the Free Software
17 #-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 #-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 #-------------------------------------------------------------------------------
18 #-------------------------------------------------------------------------------
19 #-- Author : Alexis Jeandet
19 #-- Author : Alexis Jeandet
20 #-- Mail : alexis.jeandet@gmail.com
20 #-- Mail : alexis.jeandet@gmail.com
21 #-------------------------------------------------------------------------------*/
21 #-------------------------------------------------------------------------------*/
22
22
23
23
24
24
25 void clearstr(char* a);
25 void clearstr(char* a);
26 void int2hex(unsigned long a,char*b);
26 void int2hex(unsigned long a,char*b);
27 int libucprintf(const char*,...);
27 int libucprintf(const char*,...);
28 int libucscanf(const char*,...);
28 int libucscanf(const char*,...);
29 void libucprintchartable(char* table,int size,const char* format,const char* separator);
@@ -1,12 +1,26
1 TEMPLATE = lib
1 TEMPLATE = lib
2 ARCH = lpc17XX-arm-noabi-gcc
2 lpc17XX.ARCH = lpc17XX-arm-noabi-gcc
3 TARGET = libucstrings
3 lpc17XX.TARGET = libucstrings
4 TARGETINSTALLPATH = $(LIBUC_LIBS_DIR_UCSTRINGS)
4 lpc17XX.TARGETINSTALLPATH = $(LIBUC_LIBS_DIR_UCSTRINGS)
5 HEADERSINSTALLPATH = $(LIBUC_INC_DIR_UCSTRINGS)
5 lpc17XX.HEADERSINSTALLPATH = $(LIBUC_INC_DIR_UCSTRINGS)
6
6
7 LIBS +=
7 lpc17XX.LIBS +=
8
8
9 SOURCES += libucstrings.c
9 lpc17XX.SOURCES += libucstrings.c
10
10
11
11
12 HEADERS += libucstrings.h
12 lpc17XX.HEADERS += libucstrings.h
13
14
15
16 lpc21XX.ARCH = lpc21XX-arm-noabi-gcc
17 lpc21XX.TARGET = libucstrings
18 lpc21XX.TARGETINSTALLPATH = $(LIBUC_LIBS_DIR_UCSTRINGS)
19 lpc21XX.HEADERSINSTALLPATH = $(LIBUC_INC_DIR_UCSTRINGS)
20
21 lpc21XX.LIBS +=
22
23 lpc21XX.SOURCES += libucstrings.c
24
25
26 lpc21XX.HEADERS += libucstrings.h
@@ -1,5 +1,6
1 TEMPLATE = dir
1 TEMPLATE = dir
2 SUBDIRS += lpc17XX \
2 SUBDIRS += lpc21XX \
3 lpc21XX \
3 lpc17XX \
4 LEON3
4 LEON3 \
5 common
5
6
@@ -1,20 +1,20
1
1
2 PROJECTDIR = `pwd`
2 PROJECTDIR = `pwd`
3 LIBUC = /opt/libuc2
3 LIBUC = /opt/libuc2
4
4
5 HEADERSINSTALLPATH = $(LIBUC_INC_DIR)/IIC
5 HEADERSINSTALLPATH = $(LIBUC_INC_DIR_IIC)
6 HEADERS += iic.h
6 HEADERS += iic.h
7 LIBSOURCES += iic.c
7 LIBSOURCES += iic.c
8 OBJECTFILES = $(LIBSOURCES:.c=.o)
8 OBJECTFILES = $(LIBSOURCES:.c=.o)
9 ARCH = lpc17XX-arm-noabi-gcc
9 ARCH = lpc17XX-arm-noabi-gcc
10 ARCHFOLDER = $(LIBUC)/rules/lpc17XX-arm-noabi-gcc
10 ARCHFOLDER = $(LIBUC)/rules/lpc17XX-arm-noabi-gcc
11 TARGET=libiic
11 TARGET=libiic
12 LIBUC_INCLUDES=$(LIBUC_INC_DIR_CORE_CMD)
12 LIBUC_INCLUDES=$(LIBUC_INC_DIR_CORE_CMD)
13 LIBUC_LIBRARIES=$(LIBUC_LIBS_DIR_CORE_CMD) $(LIBUC_LIBS_CORE)
13 LIBUC_LIBRARIES=$(LIBUC_LIBS_DIR_CORE_CMD) $(LIBUC_LIBS_CORE)
14 TARGETINSTALLPATH=$(LIBUC_LIBS_DIR)/IIC
14 TARGETINSTALLPATH=$(LIBUC_LIBS_DIR_IIC)
15 HEADERSINSTALLPATH=$(LIBUC_INC_DIR)/IIC
15 HEADERSINSTALLPATH=$(LIBUC_INC_DIR_IIC)
16 BSP=generic
16 BSP=generic
17 include $(ARCHFOLDER)/rules.mk
17 include $(ARCHFOLDER)/rules.mk
18
18
19 all:lib
19 all:lib
20 @echo Code compiled
20 @echo Code compiled
@@ -1,319 +1,351
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the libuc, microcontroler library
2 -- This file is a part of the libuc, microcontroler library
3 -- Copyright (C) 2011, Alexis Jeandet
3 -- Copyright (C) 2011, Alexis Jeandet
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 3 of the License, or
7 -- the Free Software Foundation; either version 3 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------
18 -------------------------------------------------------------------------------
19 -- Author : Alexis Jeandet
19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@gmail.com
21 -------------------------------------------------------------------------------*/
21 -------------------------------------------------------------------------------*/
22 #include "iic.h"
22 #include "iic.h"
23 #include "core.h"
23 #include "core.h"
24
24
25 #define iicputdata(iicdev,W,IICONSET,IICONCLR) (iicdev)->I2DAT = (W);\
25 #define iicputdata(iicdev,W,IICONSET,IICONCLR) {(iicdev)->I2DAT = (W);\
26 (iicdev)->I2CONSET = (IICONSET);\
26 (iicdev)->I2CONSET = (IICONSET);\
27 (iicdev)->I2CONCLR = (IICONCLR);
27 (iicdev)->I2CONCLR = (IICONCLR);}
28
28
29 #define iicgetdata(iicdev,W,IICONSET,IICONCLR) (W) = (iicdev)->I2DAT;\
29 #define iicgetdata(iicdev,W,IICONSET,IICONCLR) {(W) = (iicdev)->I2DAT;\
30 (iicdev)->I2CONSET = (IICONSET);\
30 (iicdev)->I2CONSET = (IICONSET);\
31 (iicdev)->I2CONCLR = (IICONCLR);
31 (iicdev)->I2CONCLR = (IICONCLR);}
32
32
33
33
34
34
35 i2ctrl i2cwrite2(i2cDev* dev,char address,char*cmd,int* cmdcnt,char*data,int* datcnt)
35 i2ctrl i2cwrite2(i2cDev* dev,char address,char*cmd,int* cmdcnt,char*data,int* datcnt)
36 {
36 {
37 char iicdat=0;
37 char iicdat=0;
38 dev->I2CONCLR = 0x28;
38 dev->I2CONCLR = 0x28;
39 iicdat = (address<<1) & 0xFE;
39 iicdat = (address<<1) & 0xFE;
40 int count = (*datcnt) + 2;
40 int count = (*datcnt) + 2;
41 *datcnt = 0;
41 (*datcnt) = 0;
42 while(dev->I2STAT != 0xF8); //waiting for device to be ready /!\ should add timeout
42 while(dev->I2STAT != 0xF8); //waiting for device to be ready /!\ should add timeout
43 dev->I2CONSET = (1<<5); //initiate transfert
43 dev->I2CONSET = (1<<5); //initiate transfert
44 while(count>0)
44 while(count>0)
45 {
45 {
46 while((dev->I2CONSET & 0x08)!=0x08);
46 while((dev->I2CONSET & 0x08)!=0x08);
47 switch(dev->I2STAT)
47 switch(dev->I2STAT)
48 {
48 {
49 case 0x08:
49 case 0x08:
50 iicputdata(dev,iicdat,(1<<2),0x28);
50 iicputdata(dev,iicdat,(1<<2),0x28);
51 iicdat = *cmd++;
51 iicdat = *cmd++;
52 break;
52 break;
53 case 0x10:
53 case 0x10:
54 iicputdata(dev,iicdat,(1<<2),0x28);
54 iicputdata(dev,iicdat,(1<<2),0x28);
55 iicdat = *cmd++;
55 iicdat = *cmd++;
56 *cmdcnt = (*cmdcnt) - 1;
56 *cmdcnt = (*cmdcnt) - 1;
57 break;
57 break;
58 case 0x18:
58 case 0x18:
59 iicputdata(dev,iicdat,0,0x08);
59 iicputdata(dev,iicdat,0,0x08);
60 if((*cmdcnt)>1)
60 if((*cmdcnt)>1)
61 {
61 {
62 iicdat = *cmd++;
62 iicdat = *cmd++;
63 *cmdcnt = (*cmdcnt) - 1;
63 *cmdcnt = (*cmdcnt) - 1;
64 }
64 }
65 else
65 else
66 {
66 {
67 count--;
67 count--;
68 iicdat = *data++;
68 iicdat = *data++;
69 }
69 }
70 break;
70 break;
71 case 0x28:
71 case 0x28:
72 iicputdata(dev,iicdat,(1<<2),0x08);
72 iicputdata(dev,iicdat,(1<<2),0x08);
73 if((*cmdcnt)>1)
73 if((*cmdcnt)>1)
74 {
74 {
75 iicdat = *cmd++;
75 iicdat = *cmd++;
76 *cmdcnt = (*cmdcnt) - 1;
76 *cmdcnt = (*cmdcnt) - 1;
77 }
77 }
78 else
78 else
79 {
79 {
80 count--;
80 count--;
81 *datcnt = (*datcnt)+1;
81 *datcnt = (*datcnt)+1;
82 iicdat = *data++;
82 iicdat = *data++;
83 }
83 }
84 break;
84 break;
85 case 0x20:
85 case 0x20:
86 return i2noack;
86 count = 0;
87 count = 0;
87 break;
88 break;
88 case 0x30:
89 case 0x30:
90 return i2noack;
89 count = 0;
91 count = 0;
90 break;
92 break;
91 case 0x38:
93 case 0x38:
94 return i2arbloss;
92 count = 0;
95 count = 0;
93 break;
96 break;
94 default:
97 default:
95 break;
98 break;
96 }
99 }
97
100
98 }
101 }
99 dev->I2CONSET = (1<<4) + (1<<2);
102 dev->I2CONSET = (1<<4) + (1<<2);
100 dev->I2CONCLR = 1<<3;
103 dev->I2CONCLR = 1<<3;
101 return i2noerr;
104 return i2noerr;
102 }
105 }
103
106
104
107
105
108
106 i2ctrl i2cwrite(i2cDev* dev,char address,char*data,int* cnt)
109 i2ctrl i2cwrite(i2cDev* dev,char address,char*data,int* cnt)
107 {
110 {
108 char iicdat=0;
111 char iicdat=0;
109 dev->I2CONCLR = 0x28;
112 dev->I2CONCLR = 0x28;
110 iicdat = (address<<1) & 0xFE;
113 iicdat = (address<<1) & 0xFE;
111 int count = (*cnt) + 1;
114 int count = (*cnt) + 1;
112 *cnt = 0;
115 *cnt = 0;
113 while(dev->I2STAT != 0xF8); //waiting for device to be ready /!\ should add timeout
116 while(dev->I2STAT != 0xF8); //waiting for device to be ready /!\ should add timeout
114 dev->I2CONSET = (1<<5); //initiate transfert
117 dev->I2CONSET = (1<<5); //initiate transfert
115 while(count>0)
118 while(count>0)
116 {
119 {
117 while((dev->I2CONSET & 0x08)!=0x08);
120 while((dev->I2CONSET & 0x08)!=0x08);
118 switch(dev->I2STAT)
121 switch(dev->I2STAT)
119 {
122 {
120 case 0x08:
123 case 0x08:
121 iicputdata(dev,iicdat,(1<<2),0x28);
124 iicputdata(dev,iicdat,(1<<2),0x28);
122 iicdat = *data++;
125 iicdat = *data++;
123 break;
126 break;
124 case 0x10:
127 case 0x10:
125 iicputdata(dev,iicdat,(1<<2),0x28);
128 iicputdata(dev,iicdat,(1<<2),0x28);
126 iicdat = *data++;
129 iicdat = *data++;
127 break;
130 break;
128 case 0x18:
131 case 0x18:
129 iicputdata(dev,iicdat,0,0x08);
132 iicputdata(dev,iicdat,0,0x08);
130 count--;
133 count--;
131 iicdat = *data++;
134 iicdat = *data++;
132 break;
135 break;
133 case 0x28:
136 case 0x28:
134 iicputdata(dev,iicdat,(1<<2),0x08);
137 iicputdata(dev,iicdat,(1<<2),0x08);
135 *cnt = (*cnt)+1;
138 *cnt = (*cnt)+1;
136 count--;
139 count--;
137 iicdat = *data++;
140 iicdat = *data++;
138 break;
141 break;
139 case 0x20:
142 case 0x20:
140 return i2noack;
143 return i2noack;
141 count = 0;
144 count = 0;
142 break;
145 break;
143 case 0x30:
146 case 0x30:
144 return i2noack;
147 return i2noack;
145 count = 0;
148 count = 0;
146 break;
149 break;
147 case 0x38:
150 case 0x38:
148 return i2arbloss;
151 return i2arbloss;
149 count = 0;
152 count = 0;
150 break;
153 break;
151 default:
154 default:
152 break;
155 break;
153 }
156 }
154
157
155 }
158 }
156 dev->I2CONSET = (1<<4) + (1<<2);
159 dev->I2CONSET = (1<<4) + (1<<2);
157 dev->I2CONCLR = 1<<3;
160 dev->I2CONCLR = 1<<3;
158 return i2noerr;
161 return i2noerr;
159 }
162 }
160
163
161
164
162 i2ctrl i2cread(i2cDev* dev,char address,char*data,int* cnt)
165 i2ctrl i2cread(i2cDev* dev,char address,char*data,int* cnt)
163 {
166 {
164 char iicdat=0;
167 char iicdat=0;
165 dev->I2CONCLR = 0x28;
168 dev->I2CONCLR = 0x28;
166 iicdat = (address<<1) + 1;
169 iicdat = (address<<1) + 1;
167 int count = (*cnt) + 1;
170 unsigned int count = (*cnt);
168 *cnt = 0;
171 *cnt = 0;
169 while(dev->I2STAT != 0xF8); //waiting for device to be ready /!\ should add timeout
172 while(dev->I2STAT != 0xF8); //waiting for device to be ready /!\ should add timeout
170 dev->I2CONSET = (1<<5); //initiate transfert
173 dev->I2CONSET = (1<<5); //initiate transfert
171 while(count>0)
174 while(count!=0)
172 {
175 {
173 while((dev->I2CONSET & 0x08)!=0x08);
176 while((dev->I2CONSET & 0x08)!=0x08);
174 switch(dev->I2STAT)
177 switch(dev->I2STAT)
175 {
178 {
179 while((dev->I2CONSET & (1<<3))!=(1<<3));
176 case 0x08:
180 case 0x08:
177 iicputdata(dev,iicdat,(1<<2),0x28);
181 iicputdata(dev,iicdat,(1<<2),0x28);
178 break;
182 break;
179 case 0x10:
183 case 0x10:
180 iicputdata(dev,iicdat,(1<<2),0x28);
184 iicputdata(dev,iicdat,(1<<2),0x28);
181 break;
185 break;
182 case 0x40:
186 case 0x40:
183 dev->I2CONSET = (1<<2);
187 if((count!=1)) dev->I2CONSET = (1<<2);
184 dev->I2CONCLR = (1<<3);
188 else dev->I2CONCLR = (1<<2);
185 count--;
189 dev->I2CONCLR = 1<<3;
186 break;
190 break;
187 case 0x50:
191 case 0x50:
188 iicgetdata(dev,iicdat,(1<<2),(1<<3));
192 if((count==2)) iicgetdata(dev,iicdat,(0),(0x0c))
193 else iicgetdata(dev,iicdat,(4),(8))
189 count--;
194 count--;
190 *cnt = (*cnt) + 1;
195 *cnt = (*cnt) + 1;
191 *data++ = iicdat;
196 *data = iicdat;
197 data++;
192 break;
198 break;
193 case 0x48:
199 case 0x48:
194 return i2noack;
200 dev->I2CONSET = 0x14;
201 dev->I2CONCLR = 8;
202 return i2noerr;
195 break;
203 break;
196 case 0x58:
204 case 0x58:
197 count = 0;
205 iicgetdata(dev,iicdat,(0x14),(8));
198 return i2noack;
206 count--;
207 *cnt = (*cnt) + 1;
208 *data = iicdat;
209 data++;
210 return i2noerr;
199 break;
211 break;
200 default:
212 default:
201 break;
213 break;
202 }
214 }
203
215
204 }
216 }
205 dev->I2CONSET = (1<<4) + (1<<2);
217 dev->I2CONSET = (1<<4); dev->I2CONCLR =(1<<2);
206 dev->I2CONCLR = 1<<3;
218 dev->I2CONCLR = 1<<3;
207 return i2noerr;
219 return i2noerr;
208 }
220 }
209
221
210
222
211 void i2csetup(i2cDev* dev,int clkH,int clkL)
223 void i2csetup(i2cDev* dev,int clkH,int clkL)
212 {
224 {
213 dev->I2CONCLR = 0x6C;
225 dev->I2CONCLR = 0x6C;
214 dev->I2SCLH = clkH;
226 dev->I2SCLH = clkH;
215 dev->I2SCLL = clkL;
227 dev->I2SCLL = clkL;
216 dev->I2CONSET = 1<<6; //enable I2C block
228 dev->I2CONSET = 1<<6; //enable I2C block
217 dev->I2CONCLR = 0x28;
229 dev->I2CONCLR = 0x28;
218 }
230 }
219
231
220
232
221 void i2cenable(i2cDev* dev)
233 void i2cenable(i2cDev* dev)
222 {
234 {
223 dev->I2CONSET = 1<<6;
235 dev->I2CONSET = 1<<6;
224 }
236 }
225
237
226
238
227 void i2cdisable(i2cDev* dev)
239 void i2cdisable(i2cDev* dev)
228 {
240 {
229 dev->I2CONCLR = (1<<6);
241 dev->I2CONCLR = (1<<6);
230 }
242 }
231
243
232
244
233 i2cDev* i2copen(int count){
245 i2cDev* i2copen(int count){
234 i2cDev* dev;
246 i2cDev* dev;
235 switch(count)
247 switch(count)
236 {
248 {
237 case 0:
249 case 0:
238 dev = (i2cDev*)((unsigned long)LPC_I2C0_BASE);
250 dev = (i2cDev*)((unsigned long)LPC_I2C0_BASE);
239 break;
251 break;
240 case 1:
252 case 1:
241 dev = (i2cDev*)((unsigned long)LPC_I2C1_BASE);
253 dev = (i2cDev*)((unsigned long)LPC_I2C1_BASE);
242 break;
254 break;
243 case 2:
255 case 2:
244 dev = (i2cDev*)((unsigned long)LPC_I2C2_BASE);
256 dev = (i2cDev*)((unsigned long)LPC_I2C2_BASE);
245 break;
257 break;
246 default:
258 default:
247 dev = (i2cDev*)0;
259 dev = (i2cDev*)0;
248 break;
260 break;
249 }
261 }
250 return dev;
262 return dev;
251 }
263 }
252
264
253
265
254
266
255 unsigned char i2cgetpclkfactor(i2cDev* dev)
267 unsigned char i2cgetpclkfactor(i2cDev* dev)
256 {
268 {
257 unsigned int clksel=0;
269 unsigned int clksel=0;
258 const char clkselDec[]={4,1,2,8};
270 const char clkselDec[]={4,1,2,8};
259 switch((int)dev)
271 switch((int)dev)
260 {
272 {
261 case (int)LPC_I2C0_BASE:
273 case (int)LPC_I2C0_BASE:
262 clksel = (LPC_SC->PCLKSEL0>>14) & 3;
274 clksel = (LPC_SC->PCLKSEL0>>14) & 3;
263 break;
275 break;
264 case (int)LPC_I2C1_BASE:
276 case (int)LPC_I2C1_BASE:
265 clksel = (LPC_SC->PCLKSEL1>>6) & 3;
277 clksel = (LPC_SC->PCLKSEL1>>6) & 3;
266 break;
278 break;
267 case (int)LPC_I2C2_BASE:
279 case (int)LPC_I2C2_BASE:
268 clksel = (LPC_SC->PCLKSEL1>>20) & 3;
280 clksel = (LPC_SC->PCLKSEL1>>20) & 3;
269 break;
281 break;
270 default:
282 default:
271 break;
283 break;
272 }
284 }
273 return clkselDec[clksel];
285 return clkselDec[clksel];
274 }
286 }
275
287
276
288
277 void i2csetpclkfactor(i2cDev* dev,unsigned char pclkfactor)
289 void i2csetpclkfactor(i2cDev* dev,unsigned char pclkfactor)
278 {
290 {
279 const char clkselDec[]={1,1,2,2,0,0,0,0,3};
291 const char clkselDec[]={1,1,2,2,0,0,0,0,3};
280 unsigned int clksel=0;
292 unsigned int clksel=0;
281 switch((int)dev)
293 switch((int)dev)
282 {
294 {
283 case (int)LPC_I2C0_BASE:
295 case (int)LPC_I2C0_BASE:
284 LPC_SC->PCLKSEL0 |= clkselDec[pclkfactor]<<14;
296 LPC_SC->PCLKSEL0 |= clkselDec[pclkfactor]<<14;
285 LPC_SC->PCLKSEL0 &= clkselDec[pclkfactor]<<14;
297 LPC_SC->PCLKSEL0 &= clkselDec[pclkfactor]<<14;
286 break;
298 break;
287 case (int)LPC_I2C1_BASE:
299 case (int)LPC_I2C1_BASE:
288 LPC_SC->PCLKSEL1 |= clkselDec[pclkfactor]<<6;
300 LPC_SC->PCLKSEL1 |= clkselDec[pclkfactor]<<6;
289 LPC_SC->PCLKSEL1 &= clkselDec[pclkfactor]<<6;
301 LPC_SC->PCLKSEL1 &= clkselDec[pclkfactor]<<6;
290 break;
302 break;
291 case (int)LPC_I2C2_BASE:
303 case (int)LPC_I2C2_BASE:
292 LPC_SC->PCLKSEL1 |= clkselDec[pclkfactor]<<20;
304 LPC_SC->PCLKSEL1 |= clkselDec[pclkfactor]<<20;
293 LPC_SC->PCLKSEL1 &= clkselDec[pclkfactor]<<20;
305 LPC_SC->PCLKSEL1 &= clkselDec[pclkfactor]<<20;
294 break;
306 break;
295 default:
307 default:
296 break;
308 break;
297 }
309 }
298
310
299 }
311 }
300
312
301
313
302 void i2csetdatarate(i2cDev* dev,unsigned int dataRate)
314 void i2csetdatarate(i2cDev* dev,unsigned int dataRate)
303 {
315 {
304 unsigned int pclk = 0;
316 unsigned int pclk = 0;
305 unsigned int cpuclk=0;
317 unsigned int cpuclk=0;
306 unsigned int i2csclkl=0;
318 unsigned int i2csclkl=0;
307 if(dev==0)return;
319 if(dev==0)return;
308 cpuclk = coregetCpuFreq();
320 cpuclk = coregetCpuFreq();
309 pclk = cpuclk / i2cgetpclkfactor(dev);
321 pclk = cpuclk / i2cgetpclkfactor(dev);
310 i2csclkl = (pclk / dataRate)>>1;
322 i2csclkl = (pclk / dataRate)>>1;
311 if(i2csclkl<4) i2csclkl = 4;
323 if(i2csclkl<4) i2csclkl = 4;
312 i2csetup(dev,i2csclkl,i2csclkl);
324 i2csetup(dev,i2csclkl,i2csclkl);
313 }
325 }
314
326
327 int i2cgetdatarate(i2cDev* dev)
328 {
329 unsigned int dataRate=0;
330 unsigned int pclk = 0;
331 unsigned int cpuclk=0;
332 unsigned int i2csclkl=0;
333 if(dev==0)return;
334 cpuclk = coregetCpuFreq();
335 pclk = cpuclk / i2cgetpclkfactor(dev);
336 dataRate = pclk /( dev->I2SCLH + dev->I2SCLL);
337 return dataRate;
338 }
315
339
316
340
317
341
318
342
319
343
344
345
346
347
348
349
350
351
@@ -1,70 +1,70
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the libuc, microcontroler library
2 -- This file is a part of the libuc, microcontroler library
3 -- Copyright (C) 2011, Alexis Jeandet
3 -- Copyright (C) 2011, Alexis Jeandet
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 3 of the License, or
7 -- the Free Software Foundation; either version 3 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------
18 -------------------------------------------------------------------------------
19 -- Author : Alexis Jeandet
19 -- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@gmail.com
20 -- Mail : alexis.jeandet@gmail.com
21 -------------------------------------------------------------------------------*/
21 -------------------------------------------------------------------------------*/
22 #ifndef IIC_H
22 #ifndef IIC_H
23 #define IIC_H
23 #define IIC_H
24 #include "LPC17xx.h"
24 #include "LPC17xx.h"
25
25
26 enum iicctrlvals
26 enum iicctrlvals
27 {
27 {
28 i2noerr,
28 i2noerr,
29 i2noack,
29 i2noack,
30 i2arbloss,
30 i2arbloss,
31 i2busy,
31 i2busy,
32 i2timeout
32 i2timeout
33 };
33 };
34
34
35 typedef enum iicctrlvals i2ctrl;
35 typedef enum iicctrlvals i2ctrl;
36
36
37 struct lpc17XXi2cRegs
37 struct lpc17XXi2cRegs
38 {
38 {
39 unsigned long I2CONSET;
39 unsigned long I2CONSET;
40 unsigned long I2STAT;
40 unsigned long I2STAT;
41 unsigned long I2DAT;
41 unsigned long I2DAT;
42 unsigned long I2ADR;
42 unsigned long I2ADR;
43 unsigned long I2SCLH;
43 unsigned long I2SCLH;
44 unsigned long I2SCLL;
44 unsigned long I2SCLL;
45 unsigned long I2CONCLR;
45 unsigned long I2CONCLR;
46 };
46 };
47
47
48 typedef volatile struct lpc17XXi2cRegs i2cDev;
48 typedef volatile struct lpc17XXi2cRegs i2cDev;
49
49
50 extern i2ctrl i2cwrite(i2cDev* dev,char address,char*data,int* cnt);
50 extern i2ctrl i2cwrite(i2cDev* dev,char address,char*data,int* cnt);
51 extern i2ctrl i2cwrite2(i2cDev* dev,char address,char*cmd,int* cmdcnt,char*data,int* datcnt);
51 extern i2ctrl i2cwrite2(i2cDev* dev,char address,char*cmd,int* cmdcnt,char*data,int* datcnt);
52 extern i2ctrl i2cread(i2cDev* dev,char address,char*data,int* cnt);
52 extern i2ctrl i2cread(i2cDev* dev,char address,char*data,int* cnt);
53 extern i2cDev* i2copen(int count);
53 extern i2cDev* i2copen(int count);
54 extern void i2cenable(i2cDev* dev);
54 extern void i2cenable(i2cDev* dev);
55 extern void i2cdisable(i2cDev* dev);
55 extern void i2cdisable(i2cDev* dev);
56 extern void i2csetup(i2cDev* dev,int clkH,int clkL);
56 extern void i2csetup(i2cDev* dev,int clkH,int clkL);
57 extern unsigned char i2cgetpclkfactor(i2cDev* dev);
57 extern unsigned char i2cgetpclkfactor(i2cDev* dev);
58 extern void i2csetpclkfactor(i2cDev* dev,unsigned char pclkfactor);
58 extern void i2csetpclkfactor(i2cDev* dev,unsigned char pclkfactor);
59 extern void i2csetdatarate(i2cDev* dev,unsigned int dataRate);
59 extern void i2csetdatarate(i2cDev* dev,unsigned int dataRate);
60
60 extern int i2cgetdatarate(i2cDev* dev);
61 #endif
61 #endif
62
62
63
63
64
64
65
65
66
66
67
67
68
68
69
69
70
70
@@ -1,12 +1,12
1 TEMPLATE = lib
1 TEMPLATE = lib
2 ARCH = lpc17XX-arm-noabi-gcc
2 ARCH = lpc17XX-arm-noabi-gcc
3 TARGET = libiic
3 TARGET = libiic
4 TARGETINSTALLPATH = $(LIBUC_LIBS_DIR)/IIC
4 TARGETINSTALLPATH = $(LIBUC_LIBS_DIR_IIC)
5 HEADERSINSTALLPATH = $(LIBUC_INC_DIR)/IIC
5 HEADERSINSTALLPATH = $(LIBUC_INC_DIR_IIC)
6
6
7 LIBS += CORE
7 LIBS += CORE
8
8
9 SOURCES += iic.c
9 SOURCES += iic.c
10
10
11
11
12 HEADERS += iic.h
12 HEADERS += iic.h
@@ -1,19 +1,19
1
1
2 PROJECTDIR = `pwd`
2 PROJECTDIR = `pwd`
3 LIBUC = /opt/libuc2
3 LIBUC = /opt/libuc2
4 include $(LIBUC)/rules/common/rules.mk
4 include $(LIBUC)/rules/common/rules.mk
5
5
6 all:subdir
6 all:subdir
7 make -C CORE
7 make -C UART
8 make -C UART
8 make -C IIC
9 make -C IIC
9 make -C CORE
10 make -C SSP
10 make -C STRINGS
11 @echo Code compiled
11 @echo Code compiled
12
12
13 clean:
13 clean:
14 make clean -C CORE
14 make clean -C UART
15 make clean -C UART
15 make clean -C IIC
16 make clean -C IIC
16 make clean -C CORE
17 make clean -C SSP
17 make clean -C STRINGS
18 @echo Code compiled
18 @echo Code compiled
19
19
@@ -1,9 +1,10
1 TEMPLATE = dir
1 TEMPLATE = dir
2 SUBDIRS += UART\
2 SUBDIRS += CORE \
3 UART\
3 SPI \
4 SPI \
4 ADC \
5 ADC \
5 IIC \
6 IIC \
6 CORE \
7 SSP
7 STRINGS
8
8
9
9
10
@@ -1,6 +1,6
1 TEMPLATE = dir
1 TEMPLATE = dir
2 SUBDIRS += bsp\
2 SUBDIRS += lib \
3 bsp\
3 examples \
4 examples \
4 lib \
5 Doc
5 Doc
6
6
@@ -1,6 +1,6
1 TEMPLATE = dir
1 TEMPLATE = dir
2 SUBDIRS += bsp\
2 SUBDIRS += lib \
3 bsp\
3 examples \
4 examples \
4 lib \
5 Doc
5 Doc
6
6
@@ -1,177 +1,209
1 #/*------------------------------------------------------------------------------
1 #/*------------------------------------------------------------------------------
2 #-- This file is a part of the libuc, microcontroler library
2 #-- This file is a part of the libuc, microcontroler library
3 #-- Copyright (C) 2011, Alexis Jeandet
3 #-- Copyright (C) 2011, Alexis Jeandet
4 #--
4 #--
5 #-- This program is free software; you can redistribute it and/or modify
5 #-- This program is free software; you can redistribute it and/or modify
6 #-- it under the terms of the GNU General Public License as published by
6 #-- it under the terms of the GNU General Public License as published by
7 #-- the Free Software Foundation; either version 3 of the License, or
7 #-- the Free Software Foundation; either version 3 of the License, or
8 #-- (at your option) any later version.
8 #-- (at your option) any later version.
9 #--
9 #--
10 #-- This program is distributed in the hope that it will be useful,
10 #-- This program is distributed in the hope that it will be useful,
11 #-- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 #-- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 #-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 #-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 #-- GNU General Public License for more details.
13 #-- GNU General Public License for more details.
14 #--
14 #--
15 #-- You should have received a copy of the GNU General Public License
15 #-- You should have received a copy of the GNU General Public License
16 #-- along with this program; if not, write to the Free Software
16 #-- along with this program; if not, write to the Free Software
17 #-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 #-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 #-------------------------------------------------------------------------------
18 #-------------------------------------------------------------------------------
19 #-- Author : Alexis Jeandet
19 #-- Author : Alexis Jeandet
20 #-- Mail : alexis.jeandet@gmail.com
20 #-- Mail : alexis.jeandet@gmail.com
21 #-------------------------------------------------------------------------------*/
21 #-------------------------------------------------------------------------------*/
22
22
23 #---------------------------------------------------------------------------------
23 #---------------------------------------------------------------------------------
24 # GCC EXECUTABLES
24 # GCC EXECUTABLES
25 #---------------------------------------------------------------------------------
25 #---------------------------------------------------------------------------------
26 LIBUC_PREFIX = arm-none-eabi-
26 LIBUC_PREFIX = arm-none-eabi-
27 LIBUC_CC = $(LIBUC_PREFIX)gcc
27 LIBUC_CC = $(LIBUC_PREFIX)gcc
28 LIBUC_CXX = $(LIBUC_PREFIX)g++
28 LIBUC_CXX = $(LIBUC_PREFIX)g++
29 LIBUC_AR = $(LIBUC_PREFIX)ar
29 LIBUC_AR = $(LIBUC_PREFIX)ar
30 LIBUC_AS = $(LIBUC_PREFIX)as
30 LIBUC_AS = $(LIBUC_PREFIX)as
31 LIBUC_LD = $(LIBUC_PREFIX)ld
31 LIBUC_LD = $(LIBUC_PREFIX)ld
32 LIBUC_SIZE = $(LIBUC_PREFIX)size
32 LIBUC_SIZE = $(LIBUC_PREFIX)size
33 LIBUC_STRIP = $(LIBUC_PREFIX)strip -s
33 LIBUC_STRIP = $(LIBUC_PREFIX)strip -s
34 LIBUC_READELF = $(LIBUC_PREFIX)readelf
34 LIBUC_READELF = $(LIBUC_PREFIX)readelf
35 LIBUC_OBJCOPY=$(LIBUC_PREFIX)objcopy
35 LIBUC_OBJCOPY=$(LIBUC_PREFIX)objcopy
36 LIBUC_OBJDUMP=$(LIBUC_PREFIX)objdump
36 LIBUC_OBJDUMP=$(LIBUC_PREFIX)objdump
37
37
38
38
39
39
40 #---------------------------------------------------------------------------------
40 #---------------------------------------------------------------------------------
41 # GCC FLAGS
41 # GCC FLAGS
42 #---------------------------------------------------------------------------------
42 #---------------------------------------------------------------------------------
43 LIBUC_FMCU = -mcpu=cortex-m3
43 LIBUC_FMCU = -mcpu=cortex-m3
44 LIBUC_CFLAGS = $(LIBUC_FMCU)
44 LIBUC_CFLAGS = $(LIBUC_FMCU)
45 LIBUC_CFLAGS = --std=gnu99 -fgnu89-inline -mcpu=cortex-m3 -mthumb
45 LIBUC_CFLAGS = --std=gnu99 -fgnu89-inline -mcpu=cortex-m3 -mthumb
46 LIBUC_CFLAGS += -ffunction-sections -fdata-sections
46 LIBUC_CFLAGS += -ffunction-sections -fdata-sections
47 LIBUC_LDFLAGS = --gc-sections
47 LIBUC_LDFLAGS = --gc-sections
48 LIBUC_ODFLAGS = -x --syms
48 LIBUC_ODFLAGS = -x --syms
49 LIBUC_CPFLAGS =
49 LIBUC_CPFLAGS =
50 LIBUC_CFLAGS_WARN_ON = -Wall
50 LIBUC_CFLAGS_WARN_ON = -Wall
51 LIBUC_CFLAGS_WARN_OFF = -w
51 LIBUC_CFLAGS_WARN_OFF = -w
52 LIBUC_CFLAGS_RELEASE = -O2
52 LIBUC_CFLAGS_RELEASE = -O2
53 LIBUC_CFLAGS_DEBUG = -g
53 LIBUC_CFLAGS_DEBUG = -g
54 LIBUC_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -g
54 LIBUC_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -g
55 LIBUC_CFLAGS_STATIC_LIB = -fPIC
55 LIBUC_CFLAGS_STATIC_LIB = -fPIC
56 LIBUC_CFLAGS_SOFT_FPU = -msoft-float
56 LIBUC_CFLAGS_SOFT_FPU = -msoft-float
57 LIBUC_CFLAGS_HARD_FPU =
57 LIBUC_CFLAGS_HARD_FPU =
58
58
59 LIBUC_CXXFLAGS = $(LIBUC_FMCU)
59 LIBUC_CXXFLAGS = $(LIBUC_FMCU)
60 LIBUC_CXXFLAGS += -g -gdwarf-2
60 LIBUC_CXXFLAGS += -g -gdwarf-2
61 LIBUC_CXXFLAGS += -Wextra -Wundef -Wcast-align -mthumb -msoft-float
61 LIBUC_CXXFLAGS += -Wextra -Wundef -Wcast-align -mthumb -msoft-float
62 LIBUC_CXXFLAGS_WARN_ON = -Wall
62 LIBUC_CXXFLAGS_WARN_ON = -Wall
63 LIBUC_CXXFLAGS_WARN_OFF = -w
63 LIBUC_CXXFLAGS_WARN_OFF = -w
64 LIBUC_CXXFLAGS_RELEASE = -O2
64 LIBUC_CXXFLAGS_RELEASE = -O2
65 LIBUC_CXXFLAGS_DEBUG = -g
65 LIBUC_CXXFLAGS_DEBUG = -g
66 LIBUC_CXXFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -g
66 LIBUC_CXXFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -g
67 LIBUC_CXXFLAGS_STATIC_LIB = -fPIC
67 LIBUC_CXXFLAGS_STATIC_LIB = -fPIC
68 LIBUC_CXXFLAGS_SOFT_FPU = -msoft-float
68 LIBUC_CXXFLAGS_SOFT_FPU = -msoft-float
69 LIBUC_CXXFLAGS_HARD_FPU =
69 LIBUC_CXXFLAGS_HARD_FPU =
70
70
71 #---------------------------------------------------------------------------------
72 # LIBRARY DEFINITIONS
73 #---------------------------------------------------------------------------------
74
71 LIBUC_LIBS =
75 LIBUC_LIBS =
72 LIBUC_LIBS_CORE = -static -lcore
76 LIBUC_LIBS_CORE = -static -lcore
73 LIBUC_LIBS_UCSTRINGS = -static -lucstrings
77 LIBUC_LIBS_UCSTRINGS = -static -lucstrings
74 LIBUC_LIBS_UART = -static -luart
78 LIBUC_LIBS_UART = -static -luart
75 LIBUC_LIBS_SPI = -static -lspi
79 LIBUC_LIBS_SPI = -static -lspi
80 LIBUC_LIBS_SSP = -static -lssp
76 LIBUC_LIBS_IIC = -static -liic
81 LIBUC_LIBS_IIC = -static -liic
77 LIBUC_LIBS_ADC = -static -ladc
82 LIBUC_LIBS_ADC = -static -ladc
83 LIBUC_LIBS_24LC0X = -static -l24lc0X
84 LIBUC_LIBS_SDCARD = -static -lsdcard
85 LIBUC_LIBS_BLKDEVICE = -static -lblkdevice
86 LIBUC_LIBS_VS10XX = -static -lvs10XX
78
87
79 LIBUC_LIBS_DIR = $(LIBUC)/lib/bin/lpc17XX
88 LIBUC_LIBS_DIR = $(LIBUC)/lib/bin/lpc17XX
80 LIBUC_LIBS_DIR_CORE = $(LIBUC_LIBS_DIR)/CORE
89 LIBUC_LIBS_DIR_CORE = $(LIBUC_LIBS_DIR)/CORE
81 LIBUC_LIBS_DIR_UCSTRINGS = $(LIBUC_LIBS_DIR)/STRINGS/$(ARCH)
90 LIBUC_LIBS_DIR_UCSTRINGS = $(LIBUC_LIBS_DIR)/STRINGS/$(ARCH)
82 LIBUC_LIBS_DIR_UART = $(LIBUC_LIBS_DIR)/UART
91 LIBUC_LIBS_DIR_UART = $(LIBUC_LIBS_DIR)/UART
83 LIBUC_LIBS_DIR_SPI = $(LIBUC_LIBS_DIR)/SPI
92 LIBUC_LIBS_DIR_SPI = $(LIBUC_LIBS_DIR)/SPI
93 LIBUC_LIBS_DIR_SSP = $(LIBUC_LIBS_DIR)/SSP
84 LIBUC_LIBS_DIR_IIC = $(LIBUC_LIBS_DIR)/IIC
94 LIBUC_LIBS_DIR_IIC = $(LIBUC_LIBS_DIR)/IIC
85 LIBUC_LIBS_DIR_ADC = $(LIBUC_LIBS_DIR)/ADC
95 LIBUC_LIBS_DIR_ADC = $(LIBUC_LIBS_DIR)/ADC
96 LIBUC_LIBS_DIR_24LC0X = $(LIBUC_LIBS_DIR)/24LCXX/24LC0X
97 LIBUC_LIBS_DIR_SDCARD = $(LIBUC_LIBS_DIR)/SDCARD
98 LIBUC_LIBS_DIR_VS10XX = $(LIBUC_LIBS_DIR)/VS10XX
99 LIBUC_LIBS_DIR_BLKDEVICE = $(LIBUC_LIBS_DIR)/BLKDEVICE
86
100
87 LIBUC_LIBS_DIR_CORE_CMD = -L $(LIBUC_LIBS_DIR_CORE)
101 LIBUC_LIBS_DIR_CORE_CMD = -L $(LIBUC_LIBS_DIR_CORE)
88 LIBUC_LIBS_DIR_UCSTRINGS_CMD = -L $(LIBUC_LIBS_DIR_UCSTRINGS)
102 LIBUC_LIBS_DIR_UCSTRINGS_CMD = -L $(LIBUC_LIBS_DIR_UCSTRINGS)
89 LIBUC_LIBS_DIR_UART_CMD = -L $(LIBUC_LIBS_DIR_UART)
103 LIBUC_LIBS_DIR_UART_CMD = -L $(LIBUC_LIBS_DIR_UART)
90 LIBUC_LIBS_DIR_SPI_CMD = -L $(LIBUC_LIBS_DIR_SPI)
104 LIBUC_LIBS_DIR_SPI_CMD = -L $(LIBUC_LIBS_DIR_SPI)
105 LIBUC_LIBS_DIR_SSP_CMD = -L $(LIBUC_LIBS_DIR_SSP)
91 LIBUC_LIBS_DIR_IIC_CMD = -L $(LIBUC_LIBS_DIR_IIC)
106 LIBUC_LIBS_DIR_IIC_CMD = -L $(LIBUC_LIBS_DIR_IIC)
92 LIBUC_LIBS_DIR_ADC_CMD = -L $(LIBUC_LIBS_DIR_ADC)
107 LIBUC_LIBS_DIR_ADC_CMD = -L $(LIBUC_LIBS_DIR_ADC)
108 LIBUC_LIBS_DIR_24LC0X_CMD = -L $(LIBUC_LIBS_DIR_24LC0X)
109 LIBUC_LIBS_DIR_SDCARD_CMD = -L $(LIBUC_LIBS_DIR_SDCARD)
110 LIBUC_LIBS_DIR_VS10XX_CMD = -L $(LIBUC_LIBS_DIR_VS10XX)
111 LIBUC_LIBS_DIR_BLKDEVICE_CMD = -L $(LIBUC_LIBS_DIR_BLKDEVICE)
93
112
94 LIBUC_INC_DIR = $(LIBUC)/lib/includes/lpc17XX
113 LIBUC_INC_DIR = $(LIBUC)/lib/includes/lpc17XX
95 LIBUC_INC_DIR_CORE = $(LIBUC_INC_DIR)/CORE
114 LIBUC_INC_DIR_CORE = $(LIBUC_INC_DIR)/CORE
96 LIBUC_INC_DIR_UCSTRINGS = $(LIBUC_INC_DIR)/STRINGS/$(ARCH)
115 LIBUC_INC_DIR_UCSTRINGS = $(LIBUC_INC_DIR)/STRINGS/$(ARCH)
97 LIBUC_INC_DIR_UART = $(LIBUC_INC_DIR)/UART
116 LIBUC_INC_DIR_UART = $(LIBUC_INC_DIR)/UART
98 LIBUC_INC_DIR_SPI = $(LIBUC_INC_DIR)/SPI
117 LIBUC_INC_DIR_SPI = $(LIBUC_INC_DIR)/SPI
118 LIBUC_INC_DIR_SSP = $(LIBUC_INC_DIR)/SSP
99 LIBUC_INC_DIR_IIC = $(LIBUC_INC_DIR)/IIC
119 LIBUC_INC_DIR_IIC = $(LIBUC_INC_DIR)/IIC
100 LIBUC_INC_DIR_ADC = $(LIBUC_INC_DIR)/ADC
120 LIBUC_INC_DIR_ADC = $(LIBUC_INC_DIR)/ADC
121 LIBUC_INC_DIR_24LC0X = $(LIBUC_INC_DIR)/24LCXX/24LC0X
122 LIBUC_INC_DIR_SDCARD = $(LIBUC_INC_DIR)/SDCARD
123 LIBUC_INC_DIR_VS10XX = $(LIBUC_INC_DIR)/VS10XX
124 LIBUC_INC_DIR_BLKDEVICE = $(LIBUC_INC_DIR)/BLKDEVICE
101
125
102 LIBUC_INC_DIR_CORE_CMD = -I $(LIBUC_INC_DIR_CORE)
126 LIBUC_INC_DIR_CORE_CMD = -I $(LIBUC_INC_DIR_CORE)
103 LIBUC_INC_DIR_UCSTRINGS_CMD = -I $(LIBUC_INC_DIR_UCSTRINGS)
127 LIBUC_INC_DIR_UCSTRINGS_CMD = -I $(LIBUC_INC_DIR_UCSTRINGS)
104 LIBUC_INC_DIR_UART_CMD = -I $(LIBUC_INC_DIR_UART)
128 LIBUC_INC_DIR_UART_CMD = -I $(LIBUC_INC_DIR_UART)
105 LIBUC_INC_DIR_SPI_CMD = -I $(LIBUC_INC_DIR_SPI)
129 LIBUC_INC_DIR_SPI_CMD = -I $(LIBUC_INC_DIR_SPI)
130 LIBUC_INC_DIR_SSP_CMD = -I $(LIBUC_INC_DIR_SSP)
106 LIBUC_INC_DIR_IIC_CMD = -I $(LIBUC_INC_DIR_IIC)
131 LIBUC_INC_DIR_IIC_CMD = -I $(LIBUC_INC_DIR_IIC)
107 LIBUC_INC_DIR_ADC_CMD = -I $(LIBUC_INC_DIR_ADC)
132 LIBUC_INC_DIR_ADC_CMD = -I $(LIBUC_INC_DIR_ADC)
108
133 LIBUC_INC_DIR_24LC0X_CMD = -I $(LIBUC_INC_DIR_24LC0X)
134 LIBUC_INC_DIR_SDCARD_CMD = -I $(LIBUC_INC_DIR_SDCARD)
135 LIBUC_INC_DIR_VS10XX_CMD = -I $(LIBUC_INC_DIR_VS10XX)
136 LIBUC_INC_DIR_BLKDEVICE_CMD = -I $(LIBUC_INC_DIR_BLKDEVICE)
109
137
110 #---------------------------------------------------------------------------------
138 #---------------------------------------------------------------------------------
111 # BOARD SUPORT PACKAGES
139 # BOARD SUPORT PACKAGES
112 #---------------------------------------------------------------------------------
140 #---------------------------------------------------------------------------------
113 LIBUC_BSP_DIR=$(LIBUC)/bsp
141 LIBUC_BSP_DIR=$(LIBUC)/bsp
114 LIBUC_BSP_BIN_DIR= $(LIBUC_BSP_DIR)/bin
142 LIBUC_BSP_BIN_DIR= $(LIBUC_BSP_DIR)/bin
115 LIBUC_BSP_INC_DIR= $(LIBUC_BSP_DIR)/includes
143 LIBUC_BSP_INC_DIR= $(LIBUC_BSP_DIR)/includes
116 LIBUC_BSP = -L $(LIBUC_BSP_BIN_DIR)/$(BSP) -static -lbsp
144 LIBUC_BSP = -L $(LIBUC_BSP_BIN_DIR)/$(BSP) -static -lbsp
117 LIBUC_BSP_INC = -I $(LIBUC_BSP_INC_DIR)/$(BSP)
145 LIBUC_BSP_INC = -I $(LIBUC_BSP_INC_DIR)/$(BSP)
118 #---------------------------------------------------------------------------------
146 #---------------------------------------------------------------------------------
119 # DEVICE SPECIAL FILES
147 # DEVICE SPECIAL FILES
120 #---------------------------------------------------------------------------------
148 #---------------------------------------------------------------------------------
121 LINKER_SCRIPT = $(ARCHFOLDER)/LPC17xx.ld
149 LINKER_SCRIPT = $(ARCHFOLDER)/LPC17xx.ld
122 APPSOURCES += $(ARCHFOLDER)/startup_LPC17xx.c $(ARCHFOLDER)/core_cm3.c $(ARCHFOLDER)/system_LPC17xx.c
150 APPSOURCES += $(ARCHFOLDER)/startup_LPC17xx.c $(ARCHFOLDER)/core_cm3.c $(ARCHFOLDER)/system_LPC17xx.c
123 LPC17XX_INCDIR=$(ARCHFOLDER)
151 LPC17XX_INCDIR=$(ARCHFOLDER)
124
152
125
153
154 #---------------------------------------------------------------------------------
155 # RULES
156 #---------------------------------------------------------------------------------
157
126 all:
158 all:
127 @echo "lpc17XX-arm-noabi-gcc rules"
159 @echo "lpc17XX-arm-noabi-gcc rules"
128
160
129
161
130 bin: $(TARGET).bin $(TARGET).hex
162 bin: $(TARGET).bin $(TARGET).hex
131 @echo "compile bin"
163 @echo "compile bin"
132
164
133
165
134
166
135 lib: $(TARGET).a
167 lib: $(TARGET).a
136 @echo "compile lib"
168 @echo "compile lib"
137
169
138 %.a: $(OBJECTFILES)
170 %.a: $(OBJECTFILES)
139 mkdir -p $(TARGETINSTALLPATH)
171 mkdir -p $(TARGETINSTALLPATH)
140 mkdir -p $(HEADERSINSTALLPATH)
172 mkdir -p $(HEADERSINSTALLPATH)
141 $(LIBUC_AR) rcs $(TARGETINSTALLPATH)/$@ $(OBJECTFILES)
173 $(LIBUC_AR) rcs $(TARGETINSTALLPATH)/$@ $(OBJECTFILES)
142 cp -f $(HEADERS) $(HEADERSINSTALLPATH)/
174 cp -f $(HEADERS) $(HEADERSINSTALLPATH)/
143
175
144
176
145 %.o: %.c
177 %.o: %.c
146 $(LIBUC_CC) -O3 -I $(LPC17XX_INCDIR) $(LIBUC_INCLUDES) $(LIBUC_BSP_INC) -MM $< -MF $*.d -MP
178 $(LIBUC_CC) -O3 -I $(LPC17XX_INCDIR) $(LIBUC_INCLUDES) $(LIBUC_BSP_INC) -MM $< -MF $*.d -MP
147 $(LIBUC_CC) -O3 -I $(LPC17XX_INCDIR) $(LIBUC_INCLUDES) $(LIBUC_BSP_INC) -c $(LIBUC_CFLAGS) $< -o $@
179 $(LIBUC_CC) -O3 -I $(LPC17XX_INCDIR) $(LIBUC_INCLUDES) $(LIBUC_BSP_INC) -c $(LIBUC_CFLAGS) $< -o $@
148
180
149
181
150 %.elf: $(LINKER_SCRIPT) $(OBJECTFILES)
182 %.elf: $(LINKER_SCRIPT) $(OBJECTFILES)
151 $(LIBUC_LD) -Map $(@:.elf=.map) $(LIBUC_LDFLAGS) -T $^ -o $@ $(LIBUC_BSP) $(LIBUC_LIBRARIES)
183 $(LIBUC_LD) -Map $(@:.elf=.map) $(LIBUC_LDFLAGS) -T $^ -o $@ $(LIBUC_BSP) $(LIBUC_LIBRARIES)
152 $(LIBUC_OBJDUMP) $(LIBUC_ODFLAGS) $@ > $(@:.elf=.dump)
184 $(LIBUC_OBJDUMP) $(LIBUC_ODFLAGS) $@ > $(@:.elf=.dump)
153 $(LIBUC_SIZE) $@
185 $(LIBUC_SIZE) $@
154
186
155 %.bin: %.elf
187 %.bin: %.elf
156 $(LIBUC_OBJCOPY) $(LIBUC_CPFLAGS) -O binary $< $*.bin
188 $(LIBUC_OBJCOPY) $(LIBUC_CPFLAGS) -O binary $< $*.bin
157
189
158
190
159 %.hex: %.elf
191 %.hex: %.elf
160 $(LIBUC_OBJCOPY) $(LIBUC_CPFLAGS) -O ihex $< $*.hex
192 $(LIBUC_OBJCOPY) $(LIBUC_CPFLAGS) -O ihex $< $*.hex
161
193
162
194
163 clean:
195 clean:
164 rm -f *.o *.d *.bin *.hex *.dump *.map *.a
196 rm -f *.o *.d *.bin *.hex *.dump *.map *.a
165
197
166 distclean:
198 distclean:
167 rm -f $(TARGETINSTALLPATH)/*.bin
199 rm -f $(TARGETINSTALLPATH)/*.bin
168 rm -f $(TARGETINSTALLPATH)/*.a
200 rm -f $(TARGETINSTALLPATH)/*.a
169
201
170
202
171
203
172
204
173
205
174
206
175
207
176
208
177
209
General Comments 0
You need to be logged in to leave comments. Login now