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