diff --git a/Doc/PortingGuide/src/*.tex b/Doc/PortingGuide/src/*.tex deleted file mode 100644 --- a/Doc/PortingGuide/src/*.tex +++ /dev/null @@ -1,22 +0,0 @@ -\relax -\@setckpt{../../latex/header}{ -\setcounter{page}{1} -\setcounter{equation}{0} -\setcounter{enumi}{0} -\setcounter{enumii}{0} -\setcounter{enumiii}{0} -\setcounter{enumiv}{0} -\setcounter{footnote}{0} -\setcounter{mpfootnote}{0} -\setcounter{part}{0} -\setcounter{chapter}{0} -\setcounter{section}{0} -\setcounter{subsection}{0} -\setcounter{subsubsection}{0} -\setcounter{paragraph}{0} -\setcounter{subparagraph}{0} -\setcounter{figure}{0} -\setcounter{table}{0} -\setcounter{lstlisting}{0} -\setcounter{lstnumber}{1} -} diff --git a/Doc/PortingGuide/src/7.tex b/Doc/PortingGuide/src/7.tex deleted file mode 100644 --- a/Doc/PortingGuide/src/7.tex +++ /dev/null @@ -1,22 +0,0 @@ -\relax -\@setckpt{../../latex/header}{ -\setcounter{page}{1} -\setcounter{equation}{0} -\setcounter{enumi}{0} -\setcounter{enumii}{0} -\setcounter{enumiii}{0} -\setcounter{enumiv}{0} -\setcounter{footnote}{0} -\setcounter{mpfootnote}{0} -\setcounter{part}{0} -\setcounter{chapter}{0} -\setcounter{section}{0} -\setcounter{subsection}{0} -\setcounter{subsubsection}{0} -\setcounter{paragraph}{0} -\setcounter{subparagraph}{0} -\setcounter{figure}{0} -\setcounter{table}{0} -\setcounter{lstlisting}{0} -\setcounter{lstnumber}{1} -} diff --git a/Doc/PortingGuide/src/PortingGuide.aux b/Doc/PortingGuide/src/PortingGuide.aux deleted file mode 100644 --- a/Doc/PortingGuide/src/PortingGuide.aux +++ /dev/null @@ -1,13 +0,0 @@ -\relax -\catcode`:\active -\catcode`;\active -\catcode`!\active -\catcode`?\active -\select@language{french} -\@writefile{toc}{\select@language{french}} -\@writefile{lof}{\select@language{french}} -\@writefile{lot}{\select@language{french}} -\@input{streamdevices.aux} -\@input{uart.aux} -\@input{spi.aux} -\@input{addresseddevices.aux} diff --git a/Doc/PortingGuide/src/PortingGuide.log b/Doc/PortingGuide/src/PortingGuide.log deleted file mode 100644 --- a/Doc/PortingGuide/src/PortingGuide.log +++ /dev/null @@ -1,530 +0,0 @@ -This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6) (format=pdflatex 2011.9.8) 6 JAN 2012 16:08 -entering extended mode - %&-line parsing enabled. -**PortingGuide.tex -(./PortingGuide.tex -LaTeX2e <2005/12/01> -Babel and hyphenation patterns for english, usenglishmax, dumylang, noh -yphenation, arabic, basque, bulgarian, coptic, welsh, czech, slovak, german, ng -erman, danish, esperanto, spanish, catalan, galician, estonian, farsi, finnish, - french, greek, monogreek, ancientgreek, croatian, hungarian, interlingua, ibyc -us, indonesian, icelandic, italian, latin, mongolian, dutch, norsk, polish, por -tuguese, pinyin, romanian, russian, slovenian, uppersorbian, serbian, swedish, -turkish, ukenglish, ukrainian, loaded. -\@input{../../latex/header.aux} -! I can't write on file `../../latex/header.aux'. -\@include ...\immediate \openout \@partaux #1.aux - \immediate \write \@partau... -l.1 \include{../../latex/header} - -Please type another output file name: -\openout2 = `header.tex'. - -(../../latex/header.tex (/usr/share/texmf/tex/latex/base/book.cls -Document Class: book 2005/09/16 v1.4f Standard LaTeX document class -(/usr/share/texmf/tex/latex/base/bk10.clo -File: bk10.clo 2005/09/16 v1.4f Standard LaTeX file (size option) -) -\c@part=\count79 -\c@chapter=\count80 -\c@section=\count81 -\c@subsection=\count82 -\c@subsubsection=\count83 -\c@paragraph=\count84 -\c@subparagraph=\count85 -\c@figure=\count86 -\c@table=\count87 -\abovecaptionskip=\skip41 -\belowcaptionskip=\skip42 -\bibindent=\dimen102 -) -(/usr/share/texmf/tex/latex/base/inputenc.sty -Package: inputenc 2006/05/05 v1.1b Input encoding file -\inpenc@prehook=\toks14 -\inpenc@posthook=\toks15 - -(/usr/share/texmf/tex/latex/base/utf8.def -File: utf8.def 2006/03/30 v1.1i UTF-8 support for inputenc -Now handling font encoding OML ... -... no UTF-8 mapping file for font encoding OML -Now handling font encoding T1 ... -... processing UTF-8 mapping file for font encodingT1 - -(/usr/share/texmf/tex/latex/base/t1enc.dfu -File: t1enc.dfu 2006/03/30 v1.1i UTF-8 support for inputenc - defining Unicode char U+00A1 (decimal 161) - defining Unicode char U+00A3 (decimal 163) - defining Unicode char U+00AB (decimal 171) - defining Unicode char U+00BB (decimal 187) - defining Unicode char U+00BF (decimal 191) - defining Unicode char U+00C0 (decimal 192) - defining Unicode char U+00C1 (decimal 193) - defining Unicode char U+00C2 (decimal 194) - defining Unicode char U+00C3 (decimal 195) - defining Unicode char U+00C4 (decimal 196) - defining Unicode char U+00C5 (decimal 197) - defining Unicode char U+00C6 (decimal 198) - defining Unicode char U+00C7 (decimal 199) - defining Unicode char U+00C8 (decimal 200) - defining Unicode char U+00C9 (decimal 201) - defining Unicode char U+00CA (decimal 202) - defining Unicode char U+00CB (decimal 203) - defining Unicode char U+00CC (decimal 204) - defining Unicode char U+00CD (decimal 205) - defining Unicode char U+00CE (decimal 206) - defining Unicode char U+00CF (decimal 207) - defining Unicode char U+00D0 (decimal 208) - defining Unicode char U+00D1 (decimal 209) - defining Unicode char U+00D2 (decimal 210) - defining Unicode char U+00D3 (decimal 211) - defining Unicode char U+00D4 (decimal 212) - defining Unicode char U+00D5 (decimal 213) - defining Unicode char U+00D6 (decimal 214) - defining Unicode char U+00D8 (decimal 216) - defining Unicode char U+00D9 (decimal 217) - defining Unicode char U+00DA (decimal 218) - defining Unicode char U+00DB (decimal 219) - defining Unicode char U+00DC (decimal 220) - defining Unicode char U+00DD (decimal 221) - defining Unicode char U+00DE (decimal 222) - defining Unicode char U+00DF (decimal 223) - defining Unicode char U+00E0 (decimal 224) - defining Unicode char U+00E1 (decimal 225) - defining Unicode char U+00E2 (decimal 226) - defining Unicode char U+00E3 (decimal 227) - defining Unicode char U+00E4 (decimal 228) - defining Unicode char U+00E5 (decimal 229) - defining Unicode char U+00E6 (decimal 230) - defining Unicode char U+00E7 (decimal 231) - defining Unicode char U+00E8 (decimal 232) - defining Unicode char U+00E9 (decimal 233) - defining Unicode char U+00EA (decimal 234) - defining Unicode char U+00EB (decimal 235) - defining Unicode char U+00EC (decimal 236) - defining Unicode char U+00ED (decimal 237) - defining Unicode char U+00EE (decimal 238) - defining Unicode char U+00EF (decimal 239) - defining Unicode char U+00F0 (decimal 240) - defining Unicode char U+00F1 (decimal 241) - defining Unicode char U+00F2 (decimal 242) - defining Unicode char U+00F3 (decimal 243) - defining Unicode char U+00F4 (decimal 244) - defining Unicode char U+00F5 (decimal 245) - defining Unicode char U+00F6 (decimal 246) - defining Unicode char U+00F8 (decimal 248) - defining Unicode char U+00F9 (decimal 249) - defining Unicode char U+00FA (decimal 250) - defining Unicode char U+00FB (decimal 251) - defining Unicode char U+00FC (decimal 252) - defining Unicode char U+00FD (decimal 253) - defining Unicode char U+00FE (decimal 254) - defining Unicode char U+00FF (decimal 255) - defining Unicode char U+0102 (decimal 258) - defining Unicode char U+0103 (decimal 259) - defining Unicode char U+0104 (decimal 260) - defining Unicode char U+0105 (decimal 261) - defining Unicode char U+0106 (decimal 262) - defining Unicode char U+0107 (decimal 263) - defining Unicode char U+010C (decimal 268) - defining Unicode char U+010D (decimal 269) - defining Unicode char U+010E (decimal 270) - defining Unicode char U+010F (decimal 271) - defining Unicode char U+0110 (decimal 272) - defining Unicode char U+0111 (decimal 273) - defining Unicode char U+0118 (decimal 280) - defining Unicode char U+0119 (decimal 281) - defining Unicode char U+011A (decimal 282) - defining Unicode char U+011B (decimal 283) - defining Unicode char U+011E (decimal 286) - defining Unicode char U+011F (decimal 287) - defining Unicode char U+0130 (decimal 304) - defining Unicode char U+0131 (decimal 305) - defining Unicode char U+0132 (decimal 306) - defining Unicode char U+0133 (decimal 307) - defining Unicode char U+0139 (decimal 313) - defining Unicode char U+013A (decimal 314) - defining Unicode char U+013D (decimal 317) - defining Unicode char U+013E (decimal 318) - defining Unicode char U+0141 (decimal 321) - defining Unicode char U+0142 (decimal 322) - defining Unicode char U+0143 (decimal 323) - defining Unicode char U+0144 (decimal 324) - defining Unicode char U+0147 (decimal 327) - defining Unicode char U+0148 (decimal 328) - defining Unicode char U+014A (decimal 330) - defining Unicode char U+014B (decimal 331) - defining Unicode char U+0150 (decimal 336) - defining Unicode char U+0151 (decimal 337) - defining Unicode char U+0152 (decimal 338) - defining Unicode char U+0153 (decimal 339) - defining Unicode char U+0154 (decimal 340) - defining Unicode char U+0155 (decimal 341) - defining Unicode char U+0158 (decimal 344) - defining Unicode char U+0159 (decimal 345) - defining Unicode char U+015A (decimal 346) - defining Unicode char U+015B (decimal 347) - defining Unicode char U+015E (decimal 350) - defining Unicode char U+015F (decimal 351) - defining Unicode char U+0160 (decimal 352) - defining Unicode char U+0161 (decimal 353) - defining Unicode char U+0162 (decimal 354) - defining Unicode char U+0163 (decimal 355) - defining Unicode char U+0164 (decimal 356) - defining Unicode char U+0165 (decimal 357) - defining Unicode char U+016E (decimal 366) - defining Unicode char U+016F (decimal 367) - defining Unicode char U+0170 (decimal 368) - defining Unicode char U+0171 (decimal 369) - defining Unicode char U+0178 (decimal 376) - defining Unicode char U+0179 (decimal 377) - defining Unicode char U+017A (decimal 378) - defining Unicode char U+017B (decimal 379) - defining Unicode char U+017C (decimal 380) - defining Unicode char U+017D (decimal 381) - defining Unicode char U+017E (decimal 382) - defining Unicode char U+200C (decimal 8204) - defining Unicode char U+2013 (decimal 8211) - defining Unicode char U+2014 (decimal 8212) - defining Unicode char U+2018 (decimal 8216) - defining Unicode char U+2019 (decimal 8217) - defining Unicode char U+201A (decimal 8218) - defining Unicode char U+201C (decimal 8220) - defining Unicode char U+201D (decimal 8221) - defining Unicode char U+201E (decimal 8222) - defining Unicode char U+2030 (decimal 8240) - defining Unicode char U+2031 (decimal 8241) - defining Unicode char U+2039 (decimal 8249) - defining Unicode char U+203A (decimal 8250) - defining Unicode char U+2423 (decimal 9251) -) -Now handling font encoding OT1 ... -... processing UTF-8 mapping file for font encodingOT1 - -(/usr/share/texmf/tex/latex/base/ot1enc.dfu -File: ot1enc.dfu 2006/03/30 v1.1i UTF-8 support for inputenc - defining Unicode char U+00A1 (decimal 161) - defining Unicode char U+00A3 (decimal 163) - defining Unicode char U+00B8 (decimal 184) - defining Unicode char U+00BF (decimal 191) - defining Unicode char U+00C5 (decimal 197) - defining Unicode char U+00C6 (decimal 198) - defining Unicode char U+00D8 (decimal 216) - defining Unicode char U+00DF (decimal 223) - defining Unicode char U+00E6 (decimal 230) - defining Unicode char U+00EC (decimal 236) - defining Unicode char U+00ED (decimal 237) - defining Unicode char U+00EE (decimal 238) - defining Unicode char U+00EF (decimal 239) - defining Unicode char U+00F8 (decimal 248) - defining Unicode char U+0131 (decimal 305) - defining Unicode char U+0141 (decimal 321) - defining Unicode char U+0142 (decimal 322) - defining Unicode char U+0152 (decimal 338) - defining Unicode char U+0153 (decimal 339) - defining Unicode char U+2013 (decimal 8211) - defining Unicode char U+2014 (decimal 8212) - defining Unicode char U+2018 (decimal 8216) - defining Unicode char U+2019 (decimal 8217) - defining Unicode char U+201C (decimal 8220) - defining Unicode char U+201D (decimal 8221) -) -Now handling font encoding OMS ... -... processing UTF-8 mapping file for font encodingOMS - -(/usr/share/texmf/tex/latex/base/omsenc.dfu -File: omsenc.dfu 2006/03/30 v1.1i UTF-8 support for inputenc - defining Unicode char U+00A7 (decimal 167) - defining Unicode char U+00B6 (decimal 182) - defining Unicode char U+00B7 (decimal 183) - defining Unicode char U+2020 (decimal 8224) - defining Unicode char U+2021 (decimal 8225) - defining Unicode char U+2022 (decimal 8226) -) -Now handling font encoding OMX ... -... no UTF-8 mapping file for font encoding OMX -Now handling font encoding U ... -... no UTF-8 mapping file for font encoding U - defining Unicode char U+00A9 (decimal 169) - defining Unicode char U+00AA (decimal 170) - defining Unicode char U+00AE (decimal 174) - defining Unicode char U+00BA (decimal 186) - defining Unicode char U+02C6 (decimal 710) - defining Unicode char U+02DC (decimal 732) - defining Unicode char U+200C (decimal 8204) - defining Unicode char U+2026 (decimal 8230) - defining Unicode char U+2122 (decimal 8482) - defining Unicode char U+2423 (decimal 9251) -)) -(/usr/share/texmf/tex/latex/base/fontenc.sty -Package: fontenc 2005/09/27 v1.99g Standard LaTeX package - -(/usr/share/texmf/tex/latex/base/t1enc.def -File: t1enc.def 2005/09/27 v1.99g Standard LaTeX file -LaTeX Font Info: Redeclaring font encoding T1 on input line 43. -)) -(/usr/share/texmf/tex/latex/lm/lmodern.sty -Package: lmodern 2007/01/14 v1.3 Latin Modern Fonts -LaTeX Font Info: Overwriting symbol font `operators' in version `normal' -(Font) OT1/cmr/m/n --> OT1/lmr/m/n on input line 13. -LaTeX Font Info: Overwriting symbol font `letters' in version `normal' -(Font) OML/cmm/m/it --> OML/lmm/m/it on input line 14. -LaTeX Font Info: Overwriting symbol font `symbols' in version `normal' -(Font) OMS/cmsy/m/n --> OMS/lmsy/m/n on input line 15. -LaTeX Font Info: Overwriting symbol font `largesymbols' in version `normal' -(Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 16. -LaTeX Font Info: Overwriting symbol font `operators' in version `bold' -(Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 17. -LaTeX Font Info: Overwriting symbol font `letters' in version `bold' -(Font) OML/cmm/b/it --> OML/lmm/b/it on input line 18. -LaTeX Font Info: Overwriting symbol font `symbols' in version `bold' -(Font) OMS/cmsy/b/n --> OMS/lmsy/b/n on input line 19. -LaTeX Font Info: Overwriting symbol font `largesymbols' in version `bold' -(Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 20. -LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `normal' -(Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 22. -LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `normal' -(Font) OT1/cmss/m/n --> OT1/lmss/m/n on input line 23. -LaTeX Font Info: Overwriting math alphabet `\mathit' in version `normal' -(Font) OT1/cmr/m/it --> OT1/lmr/m/it on input line 24. -LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `normal' -(Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 25. -LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `bold' -(Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 26. -LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `bold' -(Font) OT1/cmss/bx/n --> OT1/lmss/bx/n on input line 27. -LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold' -(Font) OT1/cmr/bx/it --> OT1/lmr/bx/it on input line 28. -LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `bold' -(Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 29. -) -(/usr/share/texmf/tex/latex/geometry/geometry.sty -Package: geometry 2002/07/08 v3.2 Page Geometry - -(/usr/share/texmf/tex/latex/graphics/keyval.sty -Package: keyval 1999/03/16 v1.13 key=value parser (DPC) -\KV@toks@=\toks16 -) -\Gm@cnth=\count88 -\Gm@cntv=\count89 -\c@Gm@tempcnt=\count90 -\Gm@bindingoffset=\dimen103 -\Gm@wd@mp=\dimen104 -\Gm@odd@mp=\dimen105 -\Gm@even@mp=\dimen106 -\Gm@dimlist=\toks17 -) -(/usr/share/texmf/tex/generic/babel/babel.sty -Package: babel 2005/11/23 v3.8h The Babel package - -(/usr/share/texmf/tex/generic/babel/frenchb.ldf -Language: french 2005/02/06 v1.6g French support from the babel system - -(/usr/share/texmf/tex/generic/babel/babel.def -File: babel.def 2005/11/23 v3.8h Babel common definitions -\babel@savecnt=\count91 -\U@D=\dimen107 -) -Package babel Info: Making : an active character on input line 219. -Package babel Info: Making ; an active character on input line 220. -Package babel Info: Making ! an active character on input line 221. -Package babel Info: Making ? an active character on input line 222. -LaTeX Font Info: Redeclaring font encoding T1 on input line 299. -\parindentFFN=\dimen108 -\std@mcc=\count92 -\dec@mcc=\count93 - -************************************* -* Local config file frenchb.cfg used -* -(/usr/share/texmf/tex/generic/babel/frenchb.cfg))) -(/usr/share/texmf/tex/latex/listings/listings.sty -\lst@mode=\count94 -\lst@gtempboxa=\box26 -\lst@token=\toks18 -\lst@length=\count95 -\lst@currlwidth=\dimen109 -\lst@column=\count96 -\lst@pos=\count97 -\lst@lostspace=\dimen110 -\lst@width=\dimen111 -\lst@newlines=\count98 -\lst@lineno=\count99 -\c@lstlisting=\count100 -\lst@maxwidth=\dimen112 - -(/usr/share/texmf/tex/latex/listings/lstpatch.sty -File: lstpatch.sty 2004/10/17 1.3b (Carsten Heinz) -) -(/usr/share/texmf/tex/latex/listings/lstmisc.sty -File: lstmisc.sty 2004/09/07 1.3 (Carsten Heinz) -\c@lstnumber=\count101 -\lst@skipnumbers=\count102 -\lst@framebox=\box27 -) -(/usr/share/texmf/tex/latex/listings/listings.cfg -File: listings.cfg 2004/09/05 1.3 listings configuration -)) -Package: listings 2004/10/17 1.3b (Carsten Heinz) - -(/usr/share/texmf/tex/latex/listings/lstlang1.sty -File: lstlang1.sty 2004/09/05 1.3 listings language file -) -(/usr/share/texmf/tex/latex/listings/lstmisc.sty -File: lstmisc.sty 2004/09/07 1.3 (Carsten Heinz) -)) (./PortingGuide.aux -(./streamdevices.aux) (./uart.aux) (./spi.aux) (./addresseddevices.aux)) -\openout1 = `PortingGuide.aux'. - -LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 2. -LaTeX Font Info: ... okay on input line 2. -LaTeX Font Info: Checking defaults for T1/lmr/m/n on input line 2. -LaTeX Font Info: Try loading font information for T1+lmr on input line 2. - -(/usr/share/texmf/tex/latex/lm/t1lmr.fd -File: t1lmr.fd 2007/01/14 v1.3 Font defs for Latin Modern -) -LaTeX Font Info: ... okay on input line 2. -LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 2. -LaTeX Font Info: ... okay on input line 2. -LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 2. -LaTeX Font Info: ... okay on input line 2. -LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 2. -LaTeX Font Info: ... okay on input line 2. -LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 2. -LaTeX Font Info: ... okay on input line 2. --------------------- Geometry parameters -paper: a4paper -landscape: -- -twocolumn: -- -twoside: true -asymmetric: -- -h-parts: 71.70166pt, 0.7\paperwidth , 107.55254pt (default) -v-parts: 101.40665pt, 0.7\paperheight , 152.11pt (default) -hmarginratio: 2:3 -vmarginratio: 2:3 -lines: -- -heightrounded: -- -bindingoffset: 0.0pt -truedimen: -- -includehead: -- -includefoot: -- -includemp: -- -driver: pdftex --------------------- Page layout dimensions and switches -\paperwidth 597.50787pt -\paperheight 845.04684pt -\textwidth 418.25368pt -\textheight 591.5302pt -\oddsidemargin -0.56833pt -\evensidemargin 35.28255pt -\topmargin -0.93083pt -\headheight 12.0pt -\headsep 18.06749pt -\footskip 25.29494pt -\marginparwidth 125.0pt -\marginparsep 7.0pt -\columnsep 10.0pt -\skip\footins 9.0pt plus 4.0pt minus 2.0pt -\hoffset 0.0pt -\voffset 0.0pt -\mag 1000 -\@twosidetrue \@mparswitchtrue -(1in=72.27pt, 1cm=28.45pt) ------------------------ -LaTeX Info: Redefining \dots on input line 2. - [1 - - - - -{/usr/share/texmf/fonts/map/pdftex/updmap/pdftex.map}] [2 - -] (./PortingGuide.toc -LaTeX Font Info: Try loading font information for OT1+lmr on input line 4. - -(/usr/share/texmf/tex/latex/lm/ot1lmr.fd -File: ot1lmr.fd 2007/01/14 v1.3 Font defs for Latin Modern -) -LaTeX Font Info: Try loading font information for OML+lmm on input line 4. - -(/usr/share/texmf/tex/latex/lm/omllmm.fd -File: omllmm.fd 2007/01/14 v1.3 Font defs for Latin Modern -) -LaTeX Font Info: Try loading font information for OMS+lmsy on input line 4. - -(/usr/share/texmf/tex/latex/lm/omslmsy.fd -File: omslmsy.fd 2007/01/14 v1.3 Font defs for Latin Modern -) -LaTeX Font Info: Try loading font information for OMX+lmex on input line 4. - -(/usr/share/texmf/tex/latex/lm/omxlmex.fd -File: omxlmex.fd 2007/01/14 v1.3 Font defs for Latin Modern -) -LaTeX Font Info: External font `lmex10' loaded for size -(Font) <10> on input line 4. -LaTeX Font Info: External font `lmex10' loaded for size -(Font) <7> on input line 4. -LaTeX Font Info: External font `lmex10' loaded for size -(Font) <5> on input line 4. -) -\tf@toc=\write3 -\openout3 = `PortingGuide.toc'. - - [3] -\openout2 = `streamdevices.aux'. - - (./streamdevices.tex [4 - - -] -Chapitre 1. -LaTeX Font Info: Try loading font information for OMS+lmr on input line 11. -(/usr/share/texmf/tex/latex/lm/omslmr.fd -File: omslmr.fd 2007/01/14 v1.3 Font defs for Latin Modern -) -LaTeX Font Info: Font shape `OMS/lmr/m/n' in size <10> not available -(Font) Font shape `OMS/lmsy/m/n' tried instead on input line 11. -) [5] -\openout2 = `uart.aux'. - - (./uart.tex) [6 - - -] -\openout2 = `spi.aux'. - - (./spi.tex) -\openout2 = `addresseddevices.aux'. - - -(./addresseddevices.tex -Chapitre 2. -) [7 - - - - - -] (./PortingGuide.aux (./streamdevices.aux) (./uart.aux) (./spi.aux) -(./addresseddevices.aux)) ) -Here is how much of TeX's memory you used: - 3462 strings out of 256216 - 43395 string characters out of 1917073 - 99152 words of memory out of 1500000 - 6695 multiletter control sequences out of 10000+200000 - 59126 words of font info for 39 fonts, out of 1200000 for 2000 - 645 hyphenation exceptions out of 8191 - 30i,4n,51p,264b,1291s stack positions out of 5000i,500n,6000p,200000b,15000s -{/usr/share/texmf/fonts/enc/dvips/lm/lm-ec.enc}{/usr -/share/texmf/fonts/enc/dvips/lm/lm-mathsy.enc} -Output written on PortingGuide.pdf (7 pages, 170208 bytes). -PDF statistics: - 60 PDF objects out of 1000 (max. 8388607) - 0 named destinations out of 1000 (max. 131072) - 1 words of extra memory for PDF output out of 10000 (max. 10000000) - diff --git a/Doc/PortingGuide/src/PortingGuide.pdf b/Doc/PortingGuide/src/PortingGuide.pdf deleted file mode 100644 index f032978b12eabca531ece7d13498b08d751f73d8..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 GIT binary patch literal 0 Hc$@ -#include -#include -#include <24LC0X.h> -#include -#include - - -extern uartDev* UART0; -extern uartDev* UART1; -extern uartDev* UART2; -extern uartDev* UART3; - -extern i2cDev* IIC0; -extern i2cDev* IIC1; -extern i2cDev* IIC2; - -extern sspDev* SSP0; -extern sspDev* SSP1; - -extern sdcardDev SDCARD0; -extern blkdevice BLKDEVSDCARD0; - -extern eeprom24lc0xDev eeprom0; - -extern float VREF0; - -extern unsigned int currentCpuFreq; - -#define pll0useInternal 0 -#define pll0useMainOsc 1 -#define pll0useRTC 2 - - -#define pll0setClksrc(src) if((unsigned int)(src)<3) LPC_SC->CLKSRCSEL=(src) -#define pll0getClksrc (LPC_SC->CLKSRCSEL & 3) - -#define LEDS_ON LPC_GPIO2->FIOSET = 255 - -#define LED1_ON LPC_GPIO2->FIOSET = (1<<0) -#define LED2_ON LPC_GPIO2->FIOSET = (1<<1) -#define LED3_ON LPC_GPIO2->FIOSET = (1<<2) -#define LED4_ON LPC_GPIO2->FIOSET = (1<<3) -#define LED5_ON LPC_GPIO2->FIOSET = (1<<4) -#define LED6_ON LPC_GPIO2->FIOSET = (1<<5) -#define LED7_ON LPC_GPIO2->FIOSET = (1<<6) -#define LED8_ON LPC_GPIO2->FIOSET = (1<<7) - -#define LEDS_OFF LPC_GPIO2->FIOCLR = ~(255) - -#define LED1_OFF LPC_GPIO2->FIOCLR = (1<<0) -#define LED2_OFF LPC_GPIO2->FIOCLR = (1<<1) -#define LED3_OFF LPC_GPIO2->FIOCLR = (1<<2) -#define LED4_OFF LPC_GPIO2->FIOCLR = (1<<3) -#define LED5_OFF LPC_GPIO2->FIOCLR = (1<<4) -#define LED6_OFF LPC_GPIO2->FIOCLR = (1<<5) -#define LED7_OFF LPC_GPIO2->FIOCLR = (1<<6) -#define LED8_OFF LPC_GPIO2->FIOCLR = (1<<7) - -extern int bsp_init(); - -extern void bsp_GPIO_init(); -extern void bsp_uart_init(); -extern void bsp_iic_init(); -extern void bsp_ssp_init(); -extern void bsp_SD_init(); -extern void consoleputc(char); -extern char consolegetc(); - -/* VS1053 */ -extern void clearXCS(); -extern void setXCS(); -extern int vs10XXDREQ(); - -/* SD CARD */ -void bsppowersdcard(char onoff); -char bspsdcardpresent(); -void bspsdcardselect(char YESNO); -char bspsdcardwriteprotected(); - -#endif - - - - - - - - - - - - - - - - - - - diff --git a/bsp/includes/generic/bsp.h b/bsp/includes/generic/bsp.h deleted file mode 100644 diff --git a/bsp/includes/mbed/bsp.h b/bsp/includes/mbed/bsp.h deleted file mode 100644 --- a/bsp/includes/mbed/bsp.h +++ /dev/null @@ -1,71 +0,0 @@ -/*------------------------------------------------------------------------------ --- This file is a part of the libuc, microcontroler library --- Copyright (C) 2011, Alexis Jeandet --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -------------------------------------------------------------------------------- --- Author : Alexis Jeandet --- Mail : alexis.jeandet@gmail.com --------------------------------------------------------------------------------*/ -#ifndef BSP_H -#define BSP_H -#include "LPC17xx.h" -#include - -extern uartDev* UART0; -extern uartDev* UART1; -extern uartDev* UART2; -extern uartDev* UART3; - -#define VREF0 (float)3.3 - -#define pll0useInternal 0 -#define pll0useMainOsc 1 -#define pll0useRTC 2 - - -#define pll0setClksrc(src) if((unsigned int)(src)<3) LPC_SC->CLKSRCSEL=(src) -#define pll0getClksrc (LPC_SC->CLKSRCSEL & 3) - - -#define LED1_ON LPC_GPIO1->FIOPIN |= (1<<18) -#define LED2_ON LPC_GPIO1->FIOPIN |= (1<<20) -#define LED3_ON LPC_GPIO1->FIOPIN |= (1<<21) -#define LED4_ON LPC_GPIO1->FIOPIN |= (1<<23) - -#define LED1_OFF LPC_GPIO1->FIOPIN &= ~(1<<18) -#define LED2_OFF LPC_GPIO1->FIOPIN &= ~(1<<20) -#define LED3_OFF LPC_GPIO1->FIOPIN &= ~(1<<21) -#define LED4_OFF LPC_GPIO1->FIOPIN &= ~(1<<23) - - -extern int bsp_init(); - -extern void bsp_GPIO_init(); -extern void bsp_uart_init(); -extern void consoleputc(char); -extern char consolegetc(); - -#endif - - - - - - - - - - diff --git a/bsp/src/LFR-142200/bsp.c b/bsp/src/LFR-142200/bsp.c new file mode 100644 --- /dev/null +++ b/bsp/src/LFR-142200/bsp.c @@ -0,0 +1,4 @@ +int bsp_init() +{ + return 1; +} diff --git a/bsp/src/LFR-142200/bsp.h b/bsp/src/LFR-142200/bsp.h new file mode 100644 --- /dev/null +++ b/bsp/src/LFR-142200/bsp.h @@ -0,0 +1,1 @@ +extern int bsp_init(); diff --git a/bsp/src/LFR-142200/generic.pro b/bsp/src/LFR-142200/generic.pro new file mode 100644 --- /dev/null +++ b/bsp/src/LFR-142200/generic.pro @@ -0,0 +1,14 @@ +TEMPLATE = lib + +lpc17XX.ARCH = sparc-elf-gcc +lpc17XX.TARGET = libbsp +lpc17XX.TARGETINSTALLPATH = $(LIBUC_BSP_BIN_DIR)/LFR-142200 +lpc17XX.HEADERSINSTALLPATH = $(LIBUC_BSP_INC_DIR)/LFR-142200 +lpc17XX.LIBS += +lpc17XX.SOURCES += bsp.c +lpc17XX.HEADERS += bsp.h + + + + + diff --git a/bsp/src/LandTiger/bsp.d b/bsp/src/LandTiger/bsp.d deleted file mode 100644 --- a/bsp/src/LandTiger/bsp.d +++ /dev/null @@ -1,35 +0,0 @@ -bsp.o: bsp.c bsp.h /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/LPC17xx.h \ - /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/core_cm3.h \ - /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/system_LPC17xx.h \ - /opt/libuc2/lib/includes/lpc17XX/UART/uart.h \ - /opt/libuc2/lib/includes/lpc17XX/IIC/iic.h \ - /opt/libuc2/lib/includes/lpc17XX/SSP/ssp.h \ - /opt/libuc2/lib/includes/lpc17XX/24LCXX/24LC0X/24LC0X.h \ - /opt/libuc2/lib/includes/lpc17XX/BLKDEVICE/blkdevice.h \ - /opt/libuc2/lib/includes/lpc17XX/SDCARD/sdcard.h \ - /opt/libuc2/lib/includes/lpc17XX/STRINGS/lpc17XX-arm-noabi-gcc/libucstrings.h \ - /opt/libuc2/lib/includes/lpc17XX/CORE/core.h - -bsp.h: - -/opt/libuc2/rules/lpc17XX-arm-noabi-gcc/LPC17xx.h: - -/opt/libuc2/rules/lpc17XX-arm-noabi-gcc/core_cm3.h: - -/opt/libuc2/rules/lpc17XX-arm-noabi-gcc/system_LPC17xx.h: - -/opt/libuc2/lib/includes/lpc17XX/UART/uart.h: - -/opt/libuc2/lib/includes/lpc17XX/IIC/iic.h: - -/opt/libuc2/lib/includes/lpc17XX/SSP/ssp.h: - -/opt/libuc2/lib/includes/lpc17XX/24LCXX/24LC0X/24LC0X.h: - -/opt/libuc2/lib/includes/lpc17XX/BLKDEVICE/blkdevice.h: - -/opt/libuc2/lib/includes/lpc17XX/SDCARD/sdcard.h: - -/opt/libuc2/lib/includes/lpc17XX/STRINGS/lpc17XX-arm-noabi-gcc/libucstrings.h: - -/opt/libuc2/lib/includes/lpc17XX/CORE/core.h: diff --git a/bsp/src/Makefile b/bsp/src/Makefile --- a/bsp/src/Makefile +++ b/bsp/src/Makefile @@ -8,6 +8,7 @@ all:subdir make -C LandTiger make -C LandTigerdualssp make -C mbed + make -C LFR-142200 @echo Code compiled clean: @@ -15,5 +16,6 @@ clean: make clean -C LandTiger make clean -C LandTigerdualssp make clean -C mbed + make clean -C LFR-142200 @echo Code compiled diff --git a/bsp/src/bsp.pro b/bsp/src/bsp.pro --- a/bsp/src/bsp.pro +++ b/bsp/src/bsp.pro @@ -2,4 +2,12 @@ TEMPLATE = dir SUBDIRS += generic \ LandTiger \ LandTigerdualssp \ - mbed + mbed \ + LFR-142200 + + + + + + + diff --git a/bsp/src/generic/Makefile b/bsp/src/generic/Makefile --- a/bsp/src/generic/Makefile +++ b/bsp/src/generic/Makefile @@ -2,29 +2,8 @@ PROJECTDIR = `pwd` LIBUC = /opt/libuc2 -HEADERSINSTALLPATH = $(LIBUC_BSP_INC_DIR)/generic -HEADERS += bsp.h -LIBSOURCES += bsp.c -OBJDIR = obj -BINDIR = bin -OBJECTFILES = $(LIBSOURCES:.c=.o) -OBJECTFILES := $(addprefix $(OBJDIR)/,$(OBJECTFILES)) -ARCH = lpc17XX-arm-noabi-gcc -ARCHFOLDER = $(LIBUC)/rules/lpc17XX-arm-noabi-gcc -TARGET=libbsp -LIBUC_INCLUDES= -LIBUC_LIBRARIES= -TARGETINSTALLPATH=$(LIBUC_BSP_BIN_DIR)/generic -HEADERSINSTALLPATH=$(LIBUC_BSP_INC_DIR)/generic -BSP=generic -include $(ARCHFOLDER)/rules.mk - -all:lib - @echo Code compiled +all: + make -f lpc17XX.mk clean: - rm -f $(OBJDIR)/*.o - rm -f $(TARGETINSTALLPATH)/*.a - rm -f $(HEADERSINSTALLPATH)/*.h - rm -f $(DEVSOURCESND) - rm -f *.d + make clean -f lpc17XX.mk diff --git a/bsp/src/generic/bsp.c b/bsp/src/generic/bsp.c --- a/bsp/src/generic/bsp.c +++ b/bsp/src/generic/bsp.c @@ -0,0 +1,4 @@ +int bsp_init() +{ + return 1; +} diff --git a/bsp/src/generic/bsp.d b/bsp/src/generic/bsp.d deleted file mode 100644 --- a/bsp/src/generic/bsp.d +++ /dev/null @@ -1,1 +0,0 @@ -bsp.o: bsp.c diff --git a/bsp/src/generic/bsp.h b/bsp/src/generic/bsp.h --- a/bsp/src/generic/bsp.h +++ b/bsp/src/generic/bsp.h @@ -0,0 +1,1 @@ +extern int bsp_init(); diff --git a/bsp/src/generic/generic.pro b/bsp/src/generic/generic.pro --- a/bsp/src/generic/generic.pro +++ b/bsp/src/generic/generic.pro @@ -1,12 +1,14 @@ TEMPLATE = lib -ARCH = lpc17XX-arm-noabi-gcc -TARGET = libbsp -TARGETINSTALLPATH = $(LIBUC_BSP_BIN_DIR)/generic -HEADERSINSTALLPATH = $(LIBUC_BSP_INC_DIR)/generic -LIBS += - -SOURCES += bsp.c +lpc17XX.ARCH = lpc17XX-arm-noabi-gcc +lpc17XX.TARGET = libbsp +lpc17XX.TARGETINSTALLPATH = $(LIBUC_BSP_BIN_DIR)/generic +lpc17XX.HEADERSINSTALLPATH = $(LIBUC_BSP_INC_DIR)/generic +lpc17XX.LIBS += +lpc17XX.SOURCES += bsp.c +lpc17XX.HEADERS += bsp.h -HEADERS += bsp.h + + + diff --git a/bsp/src/mbed/bsp.d b/bsp/src/mbed/bsp.d deleted file mode 100644 --- a/bsp/src/mbed/bsp.d +++ /dev/null @@ -1,17 +0,0 @@ -bsp.o: bsp.c bsp.h /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/LPC17xx.h \ - /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/core_cm3.h \ - /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/system_LPC17xx.h \ - /opt/libuc2/lib/includes/lpc17XX/UART/uart.h \ - /opt/libuc2/lib/includes/lpc17XX/CORE/core.h - -bsp.h: - -/opt/libuc2/rules/lpc17XX-arm-noabi-gcc/LPC17xx.h: - -/opt/libuc2/rules/lpc17XX-arm-noabi-gcc/core_cm3.h: - -/opt/libuc2/rules/lpc17XX-arm-noabi-gcc/system_LPC17xx.h: - -/opt/libuc2/lib/includes/lpc17XX/UART/uart.h: - -/opt/libuc2/lib/includes/lpc17XX/CORE/core.h: diff --git a/examples/LFR/LFR.pro b/examples/LFR/LFR.pro new file mode 100644 --- /dev/null +++ b/examples/LFR/LFR.pro @@ -0,0 +1,9 @@ +TEMPLATE = dir +SUBDIRS += helloWorld \ + IIRFilter + + + + + + diff --git a/examples/LFR/helloWorld/helloWorld.pro b/examples/LFR/helloWorld/helloWorld.pro new file mode 100644 --- /dev/null +++ b/examples/LFR/helloWorld/helloWorld.pro @@ -0,0 +1,12 @@ +TEMPLATE = app +ARCH = sparc-elf-gcc +TARGET = helloWorld +BSP = LFR-142200 + +LIBS += APB + +SOURCES += main.c + + +HEADERS += + diff --git a/examples/LFR/helloWorld/main.c b/examples/LFR/helloWorld/main.c new file mode 100644 --- /dev/null +++ b/examples/LFR/helloWorld/main.c @@ -0,0 +1,15 @@ +#include +#include + + +int main(void) +{ + bsp_init(); + printf("hello world"); + return 0; +} + + + + + diff --git a/examples/Makefile b/examples/Makefile --- a/examples/Makefile +++ b/examples/Makefile @@ -8,6 +8,7 @@ all:subdir make -C SDCARD make -C SDCARD2 make -C MP3Player + make -C LFR @echo Code compiled clean: @@ -15,5 +16,6 @@ clean: make clean -C SDCARD make clean -C SDCARD2 make clean -C MP3Player + make clean -C LFR @echo Code compiled diff --git a/examples/examples.pro b/examples/examples.pro --- a/examples/examples.pro +++ b/examples/examples.pro @@ -2,4 +2,11 @@ TEMPLATE = dir SUBDIRS += lpc17XX \ SDCARD \ SDCARD2 \ - MP3Player + MP3Player \ + LFR + + + + + + diff --git a/examples/lpc1768_iic_LandTiger/Makefile b/examples/lpc1768_iic_LandTiger/Makefile deleted file mode 100644 --- a/examples/lpc1768_iic_LandTiger/Makefile +++ /dev/null @@ -1,19 +0,0 @@ - -PROJECTDIR = `pwd` -LIBUC = /opt/libuc2 - -HEADERS += -APPSOURCES += main.c -OBJECTFILES = $(APPSOURCES:.c=.o) -ARCH = $(LIBUC)/rules/lpc17XX-arm-noabi-gcc -TARGET=lpc1768_iic -LIBUC_INCLUDES=$(LIBUC_INC_DIR_UART) $(LIBUC_INC_DIR_IIC) $(LIBUC_INC_DIR_CORE) $(LIBUC_INC_DIR_UCSTRINGS) -LIBUC_LIBRARIES=$(LIBUC_LIBS_DIR_UART) $(LIBUC_LIBS_UART) $(LIBUC_LIBS_DIR_IIC) $(LIBUC_LIBS_IIC) $(LIBUC_LIBS_DIR_CORE) $(LIBUC_LIBS_CORE) $(LIBUC_LIBS_DIR_UCSTRINGS) $(LIBUC_LIBS_UCSTRINGS) -TARGETINSTALLPATH= -HEADERSINSTALLPATH= -BSP=LandTiger -include $(ARCH)/rules.mk - -all:bin - @echo Code compiled - diff --git a/examples/lpc1768_iic_LandTiger/lpc1768_iic.bin b/examples/lpc1768_iic_LandTiger/lpc1768_iic.bin deleted file mode 100755 index 40d520b2d01be3d4411c1a9337fc5fafcbc54a33..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 GIT binary patch literal 0 Hc$@PCONP |= ( 1 << 15 ); // power up GPIO - LPC_GPIO1->FIODIR |= (1<<18); // puts P1.29 into output mode. - while(1) - { - LPC_GPIO1->FIOPIN |= (1<<18); // make P1.29 high - _delay( 1 << 24 ); - LPC_GPIO1->FIOPIN &= ~(1<<18); // make P1.29 low - _delay( 1 << 24 ); - } - return 0; - -} -void _delay(uint32_t del) -{ - uint32_t i; - for(i=0;i= 1024)) */ -#define GET_BLOCK_SIZE 3 /* Get erase block size (for only f_mkfs()) */ -#define CTRL_ERASE_SECTOR 4 /* Force erased a block of sectors (for only _USE_ERASE) */ - -/* Generic ioctl command */ -#define CTRL_POWER 5 /* Get/Set power status */ -#define CTRL_LOCK 6 /* Lock/Unlock media removal */ -#define CTRL_EJECT 7 /* Eject media */ - -/* MMC/SDC specific ioctl command */ -#define MMC_GET_TYPE 10 /* Get card type */ -#define MMC_GET_CSD 11 /* Get CSD */ -#define MMC_GET_CID 12 /* Get CID */ -#define MMC_GET_OCR 13 /* Get OCR */ -#define MMC_GET_SDSTAT 14 /* Get SD status */ - -/* ATA/CF specific ioctl command */ -#define ATA_GET_REV 20 /* Get F/W revision */ -#define ATA_GET_MODEL 21 /* Get model name */ -#define ATA_GET_SN 22 /* Get serial number */ - -/* NAND specific ioctl command */ -#define NAND_FORMAT 30 /* Create physical format */ - -/* Status of Disk Functions */ -typedef unsigned char DSTATUS; - -/* Results of Disk Functions */ -typedef enum { - RES_OK = 0, /* 0: Successful */ - RES_ERROR, /* 1: R/W Error */ - RES_WRPRT, /* 2: Write Protected */ - RES_NOTRDY, /* 3: Not Ready */ - RES_PARERR /* 4: Invalid Parameter */ -} DRESULT; - -typedef volatile struct blkdevice_str blkdevice; - -typedef void (*blkdevselect_t)(char); -typedef void (*blkdevpower_t)(char) ; -typedef char (*blkdevdetect_t)() ; -typedef char (*blkdevwriteprotected_t)() ; -typedef DRESULT (*blkdevwrite_t)(blkdevice* _this,char drv,const char *buff,unsigned long sector,char count) ; -typedef DRESULT (*blkdevread_t)(blkdevice* _this,char drv,char *buff,unsigned long sector,char count) ; -typedef DRESULT (*blkdevioctl_t)(blkdevice* _this,char drv,char ctrl,void *buff) ; -typedef DSTATUS (*blkdevinitialize_t)(blkdevice* _this,char drv) ; -typedef DSTATUS (*blkdevstatus_t) (blkdevice* _this,char drv) ; - -struct blkdevice_str -{ - void* phy; - unsigned int size; - unsigned int MaxSpeed; - unsigned char Version; - blkdevselect_t select; - blkdevpower_t power; - blkdevdetect_t detect; - blkdevwriteprotected_t writeprotected; - blkdevwrite_t write; - blkdevread_t read; - blkdevioctl_t ioctl; - blkdevinitialize_t initialize; - blkdevstatus_t status; -}; - - - - - - -#endif - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/includes/lpc17XX/CORE/core.h b/lib/includes/lpc17XX/CORE/core.h deleted file mode 100644 --- a/lib/includes/lpc17XX/CORE/core.h +++ /dev/null @@ -1,48 +0,0 @@ -/*------------------------------------------------------------------------------ --- This file is a part of the libuc, microcontroler library --- Copyright (C) 2011, Alexis Jeandet --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -------------------------------------------------------------------------------- --- Author : Alexis Jeandet --- Mail : alexis.jeandet@gmail.com --------------------------------------------------------------------------------*/ -#include "LPC17xx.h" - - -#define pll0useInternal 0 -#define pll0useMainOsc 1 -#define pll0useRTC 2 - - -#define pll0setClksrc(src) if((unsigned int)(src)<3) LPC_SC->CLKSRCSEL=(src) -#define pll0getClksrc (LPC_SC->CLKSRCSEL & 3) - - -extern void coresetCpuFreq(unsigned int freq); -extern unsigned int coregetCpuFreq(); - - - - - - - - - - - - - diff --git a/lib/includes/lpc17XX/IIC/iic.h b/lib/includes/lpc17XX/IIC/iic.h deleted file mode 100644 --- a/lib/includes/lpc17XX/IIC/iic.h +++ /dev/null @@ -1,70 +0,0 @@ -/*------------------------------------------------------------------------------ --- This file is a part of the libuc, microcontroler library --- Copyright (C) 2011, Alexis Jeandet --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -------------------------------------------------------------------------------- --- Author : Alexis Jeandet --- Mail : alexis.jeandet@gmail.com --------------------------------------------------------------------------------*/ -#ifndef IIC_H -#define IIC_H -#include "LPC17xx.h" - -enum iicctrlvals -{ - i2noerr, - i2noack, - i2arbloss, - i2busy, - i2timeout -}; - -typedef enum iicctrlvals i2ctrl; - -struct lpc17XXi2cRegs -{ - unsigned long I2CONSET; - unsigned long I2STAT; - unsigned long I2DAT; - unsigned long I2ADR; - unsigned long I2SCLH; - unsigned long I2SCLL; - unsigned long I2CONCLR; -}; - -typedef volatile struct lpc17XXi2cRegs i2cDev; - -extern i2ctrl i2cwrite(i2cDev* dev,char address,char*data,int* cnt); -extern i2ctrl i2cwrite2(i2cDev* dev,char address,char*cmd,int* cmdcnt,char*data,int* datcnt); -extern i2ctrl i2cread(i2cDev* dev,char address,char*data,int* cnt); -extern i2cDev* i2copen(int count); -extern void i2cenable(i2cDev* dev); -extern void i2cdisable(i2cDev* dev); -extern void i2csetup(i2cDev* dev,int clkH,int clkL); -extern unsigned char i2cgetpclkfactor(i2cDev* dev); -extern void i2csetpclkfactor(i2cDev* dev,unsigned char pclkfactor); -extern void i2csetdatarate(i2cDev* dev,unsigned int dataRate); -extern int i2cgetdatarate(i2cDev* dev); -#endif - - - - - - - - - diff --git a/lib/includes/lpc17XX/SDCARD/sdcard.h b/lib/includes/lpc17XX/SDCARD/sdcard.h deleted file mode 100644 --- a/lib/includes/lpc17XX/SDCARD/sdcard.h +++ /dev/null @@ -1,116 +0,0 @@ -/*------------------------------------------------------------------------------ --- This file is a part of the libuc, microcontroler library --- Copyright (C) 2012, Alexis Jeandet --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -------------------------------------------------------------------------------- --- Author : Alexis Jeandet --- Mail : alexis.jeandet@gmail.com --------------------------------------------------------------------------------*/ -#ifndef SDCARD_H -#define SDCARD_H -#include "blkdevice.h" -#include - -/* MMC/SD command */ -#define CMD0 (0) /* GO_IDLE_STATE */ -#define CMD1 (1) /* SEND_OP_COND (MMC) */ -#define ACMD41 (0x80+41) /* SEND_OP_COND (SDC) */ -#define CMD8 (8) /* SEND_IF_COND */ -#define CMD9 (9) /* SEND_CSD */ -#define CMD10 (10) /* SEND_CID */ -#define CMD12 (12) /* STOP_TRANSMISSION */ -#define ACMD13 (0x80+13) /* SD_STATUS (SDC) */ -#define CMD16 (16) /* SET_BLOCKLEN */ -#define CMD17 (17) /* READ_SINGLE_BLOCK */ -#define CMD18 (18) /* READ_MULTIPLE_BLOCK */ -#define CMD23 (23) /* SET_BLOCK_COUNT (MMC) */ -#define ACMD23 (0x80+23) /* SET_WR_BLK_ERASE_COUNT (SDC) */ -#define CMD24 (24) /* WRITE_BLOCK */ -#define CMD25 (25) /* WRITE_MULTIPLE_BLOCK */ -#define CMD32 (32) /* ERASE_ER_BLK_START */ -#define CMD33 (33) /* ERASE_ER_BLK_END */ -#define CMD38 (38) /* ERASE */ -#define CMD55 (55) /* APP_CMD */ -#define CMD58 (58) /* READ_OCR */ - -/* Card type flags (CardType) */ -#define CT_MMC 0x01 /* MMC ver 3 */ -#define CT_SD1 0x02 /* SD ver 1 */ -#define CT_SD2 0x04 /* SD ver 2 */ -#define CT_SDC (CT_SD1|CT_SD2) /* SD */ -#define CT_BLOCK 0x08 /* Block addressing */ - -struct sdcard_str -{ - void* phy; - void (*rcvr_mmc) (void* phy,char *buff,unsigned int bc); - void (*xmit_mmc) (void* phy,const char *buff,unsigned int bc); - void (*setspeed) (void* phy,unsigned int speed); - DSTATUS Stat; - char CardType; -}; - -typedef volatile struct sdcard_str sdcardDev; - -extern void sdcardmake(sdcardDev* sdcard,void* phy,void (*rcvr_mmc) (void*,char *,unsigned int ),void (*xmit_mmc) (void*,const char *,unsigned int ),void (*setspeed) (void* phy,unsigned int speed)); -extern void sdcardmakeblkdev(blkdevice* dev,sdcardDev* sdcard, blkdevselect_t select,blkdevpower_t power,blkdevdetect_t detect,blkdevwriteprotected_t writeprotected); - -extern int sdcardselect (blkdevice* _this); -extern void sdcarddeselect (blkdevice* _this); -extern int sdcardwait_ready (sdcardDev* sdcard); -extern int sdcardxmit_datablock (sdcardDev* sdcard,const char *buff,char token); -extern int sdcardrcvr_datablock (sdcardDev* sdcard,char *buff,unsigned int btr); -extern char sdcardsend_cmd (blkdevice* _this,char cmd,unsigned int arg); - -extern DSTATUS sdcarddisk_status (blkdevice* _this,char drv); -extern DSTATUS sdcarddisk_initialize (blkdevice* _this,char drv); -extern DRESULT sdcarddisk_read (blkdevice* _this,char drv,char *buff,unsigned int sector,char count); -extern DRESULT sdcarddisk_write (blkdevice* _this,char drv,const char *buff,unsigned int sector,char count); -extern DRESULT sdcarddisk_ioctl (blkdevice* _this,char drv,char ctrl,void *buff); - -#endif - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/includes/lpc17XX/SSP/ssp.h b/lib/includes/lpc17XX/SSP/ssp.h deleted file mode 100644 --- a/lib/includes/lpc17XX/SSP/ssp.h +++ /dev/null @@ -1,96 +0,0 @@ -/*------------------------------------------------------------------------------ --- This file is a part of the libuc, microcontroler library --- Copyright (C) 2011, Alexis Jeandet --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -------------------------------------------------------------------------------- --- Author : Alexis Jeandet --- Mail : alexis.jeandet@gmail.com --------------------------------------------------------------------------------*/ -#include "LPC17xx.h" -#ifndef SSP_H -#define SSP_H - -#define l4bits ((1<<1)+(1)) //0011 4 bit transfer -#define l5bits ((1<<2)) //0100 5 bit transfer -#define l6bits ((1<<2)+(1)) //0101 6 bit transfer -#define l7bits ((1<<1)+(1<<1)) //0110 7 bit transfer -#define l8bits ((1<<2)+(1<<1)+(1)) //0111 8 bit transfer -#define l9bits ((1<<3)) //1000 9 bit transfer -#define l10bits ((1<<3)+(1)) //1001 10 bit transfer -#define l11bits ((1<<3)+(1<<1)) //1010 11 bit transfer -#define l12bits ((1<<3)+(1<<1)+1) //1011 12 bit transfer -#define l13bits ((1<<3)+(1<<2)) //1100 13 bit transfer -#define l14bits ((1<<3)+(1<<2)+1) //1101 14 bit transfer -#define l15bits ((1<<3)+(1<<2)+(1<<1)) //1110 15 bit transfer -#define l16bits ((1<<3)+(1<<2)+(1<<1)+1) //1111 16 bit transfer - -#define FFSPI 0 -#define FFTI (1<<4) -#define FFMICROWIRE (1<<5) - -#define CLKINHLOW 0 -#define CLKINHHIGH (1<<6) - -#define CKfirstEdge 0 -#define CKsecondEdge (1<<7) - - - -#define loopbackOFF 0 -#define loopbackON 1 - -#define MASTERMODE 0 -#define SLAVEMODE (1<<2) - -#define SLAVEOUTPUTDISABLEMODE (1<<3) - -#define sspisslave(dev) ((((dev)->SSPCtrlReg1>>2) & 1)==1) - -struct sspRegs -{ - unsigned long SSPCtrlReg0; - unsigned long SSPCtrlReg1; - unsigned long SSPDataReg; - unsigned long SSPStatReg; - unsigned long SSPClkPrescReg; - unsigned long SSPIntMaskReg; - unsigned long SSPRawIntStatReg; - unsigned long SSPMaskedIntStatReg; - unsigned long SSPIntClearReg; - unsigned long SSPDMACtrlReg; -}; - -typedef volatile struct sspRegs sspDev; - -extern sspDev* sspopen(int count); -extern void sspputc(sspDev* dev,char c); -extern void sspputnc(sspDev* dev,const char *c,unsigned int n); -extern void sspputw(sspDev* dev,int c); -extern void sspputs(sspDev* dev,char *s); -extern void sspgets(sspDev* dev,char *s); -extern char sspgetc(sspDev* dev); -extern void sspgetnc(sspDev* dev,char *c,unsigned int n); -extern int sspgetw(sspDev* dev); -extern void enableSSP(sspDev* dev); -extern void disableSSP(sspDev* dev); -extern void sspsetup(sspDev* dev,unsigned char bitscount,int sspCtrlRegValue0,int sspCtrlRegValue1, unsigned int dataRate); -extern void sspsetupTRsize(sspDev* dev,unsigned char value); -extern unsigned char sspgetpclkfactor(sspDev* dev); -extern void sspsetpclkfactor(sspDev* dev,unsigned char pclkfactor); -extern void sspsetdatarate(sspDev* dev,unsigned int dataRate); - -#endif - diff --git a/lib/includes/lpc17XX/STRINGS/libucstrings.h b/lib/includes/lpc17XX/STRINGS/libucstrings.h deleted file mode 100644 --- a/lib/includes/lpc17XX/STRINGS/libucstrings.h +++ /dev/null @@ -1,28 +0,0 @@ -#/*------------------------------------------------------------------------------ -#-- This file is a part of the libuc, microcontroler library -#-- Copyright (C) 2011, Alexis Jeandet -#-- -#-- This program is free software; you can redistribute it and/or modify -#-- it under the terms of the GNU General Public License as published by -#-- the Free Software Foundation; either version 3 of the License, or -#-- (at your option) any later version. -#-- -#-- This program is distributed in the hope that it will be useful, -#-- but WITHOUT ANY WARRANTY; without even the implied warranty of -#-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#-- GNU General Public License for more details. -#-- -#-- You should have received a copy of the GNU General Public License -#-- along with this program; if not, write to the Free Software -#-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -#------------------------------------------------------------------------------- -#-- Author : Alexis Jeandet -#-- Mail : alexis.jeandet@gmail.com -#-------------------------------------------------------------------------------*/ - - - -void clearstr(char* a); -void int2hex(unsigned long a,char*b); -int libucprintf(const char*,...); -int libucscanf(const char*,...); diff --git a/lib/includes/lpc17XX/STRINGS/lpc17XX-arm-noabi-gcc/libucstrings.h b/lib/includes/lpc17XX/STRINGS/lpc17XX-arm-noabi-gcc/libucstrings.h deleted file mode 100644 --- a/lib/includes/lpc17XX/STRINGS/lpc17XX-arm-noabi-gcc/libucstrings.h +++ /dev/null @@ -1,29 +0,0 @@ -#/*------------------------------------------------------------------------------ -#-- This file is a part of the libuc, microcontroler library -#-- Copyright (C) 2011, Alexis Jeandet -#-- -#-- This program is free software; you can redistribute it and/or modify -#-- it under the terms of the GNU General Public License as published by -#-- the Free Software Foundation; either version 3 of the License, or -#-- (at your option) any later version. -#-- -#-- This program is distributed in the hope that it will be useful, -#-- but WITHOUT ANY WARRANTY; without even the implied warranty of -#-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#-- GNU General Public License for more details. -#-- -#-- You should have received a copy of the GNU General Public License -#-- along with this program; if not, write to the Free Software -#-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -#------------------------------------------------------------------------------- -#-- Author : Alexis Jeandet -#-- Mail : alexis.jeandet@gmail.com -#-------------------------------------------------------------------------------*/ - - - -void clearstr(char* a); -void int2hex(unsigned long a,char*b); -int libucprintf(const char*,...); -int libucscanf(const char*,...); -void libucprintchartable(char* table,int size,const char* format,const char* separator); diff --git a/lib/includes/lpc17XX/UART/uart.h b/lib/includes/lpc17XX/UART/uart.h deleted file mode 100644 --- a/lib/includes/lpc17XX/UART/uart.h +++ /dev/null @@ -1,66 +0,0 @@ -/*------------------------------------------------------------------------------ --- This file is a part of the libuc, microcontroler library --- Copyright (C) 2011, Alexis Jeandet --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -------------------------------------------------------------------------------- --- Author : Alexis Jeandet --- Mail : alexis.jeandet@gmail.com --------------------------------------------------------------------------------*/ -#ifndef UART_H -#define UART_H -#include "LPC17xx.h" - - -#define uartNoParity 0 -#define uartOddParity 1 -#define uartEvenParity 3 -#define uartTrueParity 5 -#define uartFalseParity 7 - -struct LPC17XXuartRegs -{ - unsigned long RWreg; - unsigned long IntEN; - unsigned long IntIdFIFOctrlr; - unsigned long LineCtrl; - unsigned long dummy; - unsigned long LineStat; - unsigned long ScratchPad; -}; - -typedef volatile struct LPC17XXuartRegs uartDev; - -extern uartDev* uartopen(int count); -extern void uarton(int count); -extern void uartoff(int count); -extern void uartputc(uartDev* dev,char c); -extern void uartputs(uartDev* dev,char *s); -extern void uartgets(uartDev* dev,char *s); -extern char uartgetc(uartDev* dev); -extern void uartsetbaudrate(uartDev* dev,unsigned int baudRate); -extern unsigned char uartgetpclkfactor(uartDev* dev); -extern void uartsetpclkfactor(uartDev* dev,unsigned char pclkfactor); -extern void uartsetup(uartDev* dev,unsigned int baudRate,unsigned char WordLength,unsigned char StopBitCnt,unsigned char Parity); - -#endif - - - - - - - - diff --git a/lib/includes/lpc17XX/VS10XX/vs1053.h b/lib/includes/lpc17XX/VS10XX/vs1053.h deleted file mode 100644 --- a/lib/includes/lpc17XX/VS10XX/vs1053.h +++ /dev/null @@ -1,58 +0,0 @@ -#/*------------------------------------------------------------------------------ -#-- This file is a part of the libuc, microcontroler library -#-- Copyright (C) 2011, Alexis Jeandet -#-- -#-- This program is free software; you can redistribute it and/or modify -#-- it under the terms of the GNU General Public License as published by -#-- the Free Software Foundation; either version 3 of the License, or -#-- (at your option) any later version. -#-- -#-- This program is distributed in the hope that it will be useful, -#-- but WITHOUT ANY WARRANTY; without even the implied warranty of -#-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#-- GNU General Public License for more details. -#-- -#-- You should have received a copy of the GNU General Public License -#-- along with this program; if not, write to the Free Software -#-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -#------------------------------------------------------------------------------- -#-- Author : Alexis Jeandet -#-- Mail : alexis.jeandet@gmail.com -#-------------------------------------------------------------------------------*/ - - -#define VSMODE 0 -#define VSSTATUS 1 -#define VSBASS 2 -#define VSCLOCKF 3 -#define VSDECODE_TIME 4 -#define VSAUDATA 5 -#define VSWRAM 6 -#define VSWRAMADDR 7 -#define VSHDAT0 8 -#define VSHDAT1 9 -#define VSAIADDR 0xA -#define VSVOL 0xB -#define VSAICTRL0 0xC -#define VSAICTRL1 0xD -#define VSAICTRL2 0xE -#define VSAICTRL3 0xF - -struct vs1053Regs -{ - sspDev* SSP_device; - int a; -}; - -typedef struct vs1053Regs vs1053Dev; - -void vs1053open(vs1053Dev* codec,sspDev* dev); -void vs1053softreset(vs1053Dev* dev); -int vs1053cmdread(vs1053Dev* dev,char address); -void vs1053cmdwrite(vs1053Dev* dev,char address,int value); - -extern void vs10XXclearXCS(); -extern void vs10XXsetXCS(); -extern int vs10XXDREQ(); - - diff --git a/lib/includes/lpc21XX/BLKDEVICE/blkdevice.h b/lib/includes/lpc21XX/BLKDEVICE/blkdevice.h deleted file mode 100644 --- a/lib/includes/lpc21XX/BLKDEVICE/blkdevice.h +++ /dev/null @@ -1,127 +0,0 @@ -/*------------------------------------------------------------------------------ --- This file is a part of the libuc, microcontroler library --- Copyright (C) 2012, Alexis Jeandet --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -------------------------------------------------------------------------------- --- Author : Alexis Jeandet --- Mail : alexis.jeandet@gmail.com --------------------------------------------------------------------------------*/ -#ifndef BLKDEVICE_H -#define BLKDEVICE_H -/* Disk Status Bits (DSTATUS) */ - -#define STA_NOINIT 0x01 /* Drive not initialized */ -#define STA_NODISK 0x02 /* No medium in the drive */ -#define STA_PROTECT 0x04 /* Write protected */ - - -/* Command code for disk_ioctrl fucntion */ -/* Generic ioctl command (defined for FatFs) */ -#define CTRL_SYNC 0 /* Flush disk cache (for write functions) */ -#define GET_SECTOR_COUNT 1 /* Get media size (for only f_mkfs()) */ -#define GET_SECTOR_SIZE 2 /* Get sector size (for multiple sector size (_MAX_SS >= 1024)) */ -#define GET_BLOCK_SIZE 3 /* Get erase block size (for only f_mkfs()) */ -#define CTRL_ERASE_SECTOR 4 /* Force erased a block of sectors (for only _USE_ERASE) */ - -/* Generic ioctl command */ -#define CTRL_POWER 5 /* Get/Set power status */ -#define CTRL_LOCK 6 /* Lock/Unlock media removal */ -#define CTRL_EJECT 7 /* Eject media */ - -/* MMC/SDC specific ioctl command */ -#define MMC_GET_TYPE 10 /* Get card type */ -#define MMC_GET_CSD 11 /* Get CSD */ -#define MMC_GET_CID 12 /* Get CID */ -#define MMC_GET_OCR 13 /* Get OCR */ -#define MMC_GET_SDSTAT 14 /* Get SD status */ - -/* ATA/CF specific ioctl command */ -#define ATA_GET_REV 20 /* Get F/W revision */ -#define ATA_GET_MODEL 21 /* Get model name */ -#define ATA_GET_SN 22 /* Get serial number */ - -/* NAND specific ioctl command */ -#define NAND_FORMAT 30 /* Create physical format */ - -/* Status of Disk Functions */ -typedef unsigned char DSTATUS; - -/* Results of Disk Functions */ -typedef enum { - RES_OK = 0, /* 0: Successful */ - RES_ERROR, /* 1: R/W Error */ - RES_WRPRT, /* 2: Write Protected */ - RES_NOTRDY, /* 3: Not Ready */ - RES_PARERR /* 4: Invalid Parameter */ -} DRESULT; - -typedef volatile struct blkdevice_str blkdevice; - -typedef void (*blkdevselect_t)(char); -typedef void (*blkdevpower_t)(char) ; -typedef char (*blkdevdetect_t)() ; -typedef char (*blkdevwriteprotected_t)() ; -typedef DRESULT (*blkdevwrite_t)(blkdevice* _this,char drv,const char *buff,unsigned long sector,char count) ; -typedef DRESULT (*blkdevread_t)(blkdevice* _this,char drv,char *buff,unsigned long sector,char count) ; -typedef DRESULT (*blkdevioctl_t)(blkdevice* _this,char drv,char ctrl,void *buff) ; -typedef DSTATUS (*blkdevinitialize_t)(blkdevice* _this,char drv) ; -typedef DSTATUS (*blkdevstatus_t) (blkdevice* _this,char drv) ; - -struct blkdevice_str -{ - void* phy; - unsigned int size; - unsigned int MaxSpeed; - unsigned char Version; - blkdevselect_t select; - blkdevpower_t power; - blkdevdetect_t detect; - blkdevwriteprotected_t writeprotected; - blkdevwrite_t write; - blkdevread_t read; - blkdevioctl_t ioctl; - blkdevinitialize_t initialize; - blkdevstatus_t status; -}; - - - - - - -#endif - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/includes/lpc21XX/CORE/core.h b/lib/includes/lpc21XX/CORE/core.h deleted file mode 100644 --- a/lib/includes/lpc21XX/CORE/core.h +++ /dev/null @@ -1,48 +0,0 @@ -/*------------------------------------------------------------------------------ --- This file is a part of the libuc, microcontroler library --- Copyright (C) 2011, Alexis Jeandet --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -------------------------------------------------------------------------------- --- Author : Alexis Jeandet --- Mail : alexis.jeandet@gmail.com --------------------------------------------------------------------------------*/ -#include "LPC23xx.h" - - -#define pll0useInternal 0 -#define pll0useMainOsc 1 -#define pll0useRTC 2 - - -#define pll0setClksrc(src) if((unsigned int)(src)<3) CLKSRCSEL=(src) -#define pll0getClksrc (CLKSRCSEL & 3) - - -extern void coresetCpuFreq(unsigned int freq); -extern unsigned int coregetCpuFreq(); - - - - - - - - - - - - - diff --git a/lib/includes/lpc21XX/SDCARD/sdcard.h b/lib/includes/lpc21XX/SDCARD/sdcard.h deleted file mode 100644 --- a/lib/includes/lpc21XX/SDCARD/sdcard.h +++ /dev/null @@ -1,116 +0,0 @@ -/*------------------------------------------------------------------------------ --- This file is a part of the libuc, microcontroler library --- Copyright (C) 2012, Alexis Jeandet --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -------------------------------------------------------------------------------- --- Author : Alexis Jeandet --- Mail : alexis.jeandet@gmail.com --------------------------------------------------------------------------------*/ -#ifndef SDCARD_H -#define SDCARD_H -#include "blkdevice.h" -#include - -/* MMC/SD command */ -#define CMD0 (0) /* GO_IDLE_STATE */ -#define CMD1 (1) /* SEND_OP_COND (MMC) */ -#define ACMD41 (0x80+41) /* SEND_OP_COND (SDC) */ -#define CMD8 (8) /* SEND_IF_COND */ -#define CMD9 (9) /* SEND_CSD */ -#define CMD10 (10) /* SEND_CID */ -#define CMD12 (12) /* STOP_TRANSMISSION */ -#define ACMD13 (0x80+13) /* SD_STATUS (SDC) */ -#define CMD16 (16) /* SET_BLOCKLEN */ -#define CMD17 (17) /* READ_SINGLE_BLOCK */ -#define CMD18 (18) /* READ_MULTIPLE_BLOCK */ -#define CMD23 (23) /* SET_BLOCK_COUNT (MMC) */ -#define ACMD23 (0x80+23) /* SET_WR_BLK_ERASE_COUNT (SDC) */ -#define CMD24 (24) /* WRITE_BLOCK */ -#define CMD25 (25) /* WRITE_MULTIPLE_BLOCK */ -#define CMD32 (32) /* ERASE_ER_BLK_START */ -#define CMD33 (33) /* ERASE_ER_BLK_END */ -#define CMD38 (38) /* ERASE */ -#define CMD55 (55) /* APP_CMD */ -#define CMD58 (58) /* READ_OCR */ - -/* Card type flags (CardType) */ -#define CT_MMC 0x01 /* MMC ver 3 */ -#define CT_SD1 0x02 /* SD ver 1 */ -#define CT_SD2 0x04 /* SD ver 2 */ -#define CT_SDC (CT_SD1|CT_SD2) /* SD */ -#define CT_BLOCK 0x08 /* Block addressing */ - -struct sdcard_str -{ - void* phy; - void (*rcvr_mmc) (void* phy,char *buff,unsigned int bc); - void (*xmit_mmc) (void* phy,const char *buff,unsigned int bc); - void (*setspeed) (void* phy,unsigned int speed); - DSTATUS Stat; - char CardType; -}; - -typedef volatile struct sdcard_str sdcardDev; - -extern void sdcardmake(sdcardDev* sdcard,void* phy,void (*rcvr_mmc) (void*,char *,unsigned int ),void (*xmit_mmc) (void*,const char *,unsigned int ),void (*setspeed) (void* phy,unsigned int speed)); -extern void sdcardmakeblkdev(blkdevice* dev,sdcardDev* sdcard, blkdevselect_t select,blkdevpower_t power,blkdevdetect_t detect,blkdevwriteprotected_t writeprotected); - -extern int sdcardselect (blkdevice* _this); -extern void sdcarddeselect (blkdevice* _this); -extern int sdcardwait_ready (sdcardDev* sdcard); -extern int sdcardxmit_datablock (sdcardDev* sdcard,const char *buff,char token); -extern int sdcardrcvr_datablock (sdcardDev* sdcard,char *buff,unsigned int btr); -extern char sdcardsend_cmd (blkdevice* _this,char cmd,unsigned int arg); - -extern DSTATUS sdcarddisk_status (blkdevice* _this,char drv); -extern DSTATUS sdcarddisk_initialize (blkdevice* _this,char drv); -extern DRESULT sdcarddisk_read (blkdevice* _this,char drv,char *buff,unsigned int sector,char count); -extern DRESULT sdcarddisk_write (blkdevice* _this,char drv,const char *buff,unsigned int sector,char count); -extern DRESULT sdcarddisk_ioctl (blkdevice* _this,char drv,char ctrl,void *buff); - -#endif - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/includes/lpc21XX/STRINGS/lpc21XX-arm-noabi-gcc/libucstrings.h b/lib/includes/lpc21XX/STRINGS/lpc21XX-arm-noabi-gcc/libucstrings.h deleted file mode 100644 --- a/lib/includes/lpc21XX/STRINGS/lpc21XX-arm-noabi-gcc/libucstrings.h +++ /dev/null @@ -1,29 +0,0 @@ -#/*------------------------------------------------------------------------------ -#-- This file is a part of the libuc, microcontroler library -#-- Copyright (C) 2011, Alexis Jeandet -#-- -#-- This program is free software; you can redistribute it and/or modify -#-- it under the terms of the GNU General Public License as published by -#-- the Free Software Foundation; either version 3 of the License, or -#-- (at your option) any later version. -#-- -#-- This program is distributed in the hope that it will be useful, -#-- but WITHOUT ANY WARRANTY; without even the implied warranty of -#-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#-- GNU General Public License for more details. -#-- -#-- You should have received a copy of the GNU General Public License -#-- along with this program; if not, write to the Free Software -#-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -#------------------------------------------------------------------------------- -#-- Author : Alexis Jeandet -#-- Mail : alexis.jeandet@gmail.com -#-------------------------------------------------------------------------------*/ - - - -void clearstr(char* a); -void int2hex(unsigned long a,char*b); -int libucprintf(const char*,...); -int libucscanf(const char*,...); -void libucprintchartable(char* table,int size,const char* format,const char* separator); diff --git a/lib/includes/lpc21XX/UART/uart.h b/lib/includes/lpc21XX/UART/uart.h deleted file mode 100644 --- a/lib/includes/lpc21XX/UART/uart.h +++ /dev/null @@ -1,66 +0,0 @@ -/*------------------------------------------------------------------------------ --- This file is a part of the libuc, microcontroler library --- Copyright (C) 2011, Alexis Jeandet --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -------------------------------------------------------------------------------- --- Author : Alexis Jeandet --- Mail : alexis.jeandet@gmail.com --------------------------------------------------------------------------------*/ -#ifndef UART_H -#define UART_H -#include "LPC23xx.h" - - -#define uartNoParity 0 -#define uartOddParity 1 -#define uartEvenParity 3 -#define uartTrueParity 5 -#define uartFalseParity 7 - -struct uartRegs -{ - unsigned long RWreg; - unsigned long IntEN; - unsigned long IntIdFIFOctrlr; - unsigned long LineCtrl; - unsigned long dummy; - unsigned long LineStat; - unsigned long ScratchPad; -}; - -typedef volatile struct uartRegs uartDev; - -extern uartDev* uartopen(int count); -extern void uarton(int count); -extern void uartoff(int count); -extern void uartputc(uartDev* dev,char c); -extern void uartputs(uartDev* dev,char *s); -extern void uartgets(uartDev* dev,char *s); -extern char uartgetc(uartDev* dev); -extern void uartsetbaudrate(uartDev* dev,unsigned int baudRate); -extern unsigned char uartgetpclkfactor(uartDev* dev); -extern void uartsetpclkfactor(uartDev* dev,unsigned char pclkfactor); -extern void uartsetup(uartDev* dev,unsigned int baudRate,unsigned char WordLength,unsigned char StopBitCnt,unsigned char Parity); - -#endif - - - - - - - - diff --git a/lib/src/LEON3/APB/apb.c b/lib/src/LEON3/APB/apb.c new file mode 100644 --- /dev/null +++ b/lib/src/LEON3/APB/apb.c @@ -0,0 +1,122 @@ +/*------------------------------------------------------------------------------ +-- This file is a part of the LPP VHDL IP LIBRARY +-- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-------------------------------------------------------------------------------*/ +/*-- Author : Alexis Jeandet +-- Mail : alexis.jeandet@lpp.polytechnique.fr +----------------------------------------------------------------------------*/ +#include "apb.h" +#include + + + +int* apbgetdevice(int PID,int VID,int count) +{ + struct apbPnPreg* dev = (struct apbPnPreg*)(APB_TBL_HEAD + sizeof(struct apbPnPreg)); + int id; + id = (PID<<12) | (VID<<24); + while(dev != (struct apbPnPreg*)(APB_TBL_HEAD|0xFFF)) + { + if((dev->idReg & 0xFFFFF000) == id) + { + if(count == 0) + { + return (int*) (APB_BASE_ADDRS | (dev->bar&0xFFF00000)>>12); + } + count-=1; + } + dev += 1; + } + return NULL; +} + + +void apbgetdeviceinfofromdevptr(const struct apbPnPreg* dev,struct apbdevinfo* devinfo) +{ + + devinfo->productID = (dev->idReg>>12) & 0xFFF; + devinfo->vendorID = (dev->idReg>>24) & 0xFF; + devinfo->address = ((dev->bar>>12) & 0xFFF00)|APB_BASE_ADDRS; + devinfo->irq = dev->idReg & 0x1F; + devinfo->mask = (dev->bar>>4)&0xFFF; + devinfo->version = (dev->idReg>>5)&0x1F; +} + +void apbgetdeviceinfofromid(int PID,int VID,int count,struct apbdevinfo* devinfo) +{ + struct apbPnPreg* dev = (struct apbPnPreg*)(APB_TBL_HEAD + sizeof(struct apbPnPreg)); + int id; + id = (PID<<12) | (VID<<24); + while(dev != (struct apbPnPreg*)(APB_TBL_HEAD|0xFFF)) + { + if((dev->idReg & 0xFFFFF000) == id) + { + if(count == 0) + { + devinfo->productID = PID; + devinfo->vendorID = VID; + devinfo->address = ((dev->bar>>12) & 0xFFF00)|APB_BASE_ADDRS; + devinfo->irq = dev->idReg & 0x1F; + devinfo->mask = (dev->bar>>4)&0xFFF; + devinfo->version = (dev->idReg>>5)&0x1F; + return; + } + count-=1; + } + dev += 1; + } +} + + + +void apbprintdeviceinfo(struct apbdevinfo devinfo) +{ + printf("Vendor ID = 0x%x\n",devinfo.vendorID); + printf("Product ID = 0x%x\n",devinfo.productID); + printf("Device address = 0x%x\n",devinfo.address); + printf("Device Irq = %d\n",devinfo.irq); + printf("Device mask = 0x%x\n",devinfo.mask); + printf("Device Version = %d\n",devinfo.version); +} + + +void apbprintdeviceslist() +{ + struct apbdevinfo devinfo; + struct apbPnPreg* dev = (struct apbPnPreg*)(APB_TBL_HEAD );//+ sizeof(struct apbPnPreg)); + int i =0; + int fisrtBAR; + while((dev->idReg == 0) && (ibar; + for(i=i;iidReg != 0 )) + { + apbgetdeviceinfofromdevptr(dev,&devinfo); + printf("\n\n======= new device found========\n"); + apbprintdeviceinfo(devinfo); + } + dev += 1; + if(dev->bar == fisrtBAR) + break; + } +} + diff --git a/lib/src/LEON3/APB/apb.h b/lib/src/LEON3/APB/apb.h new file mode 100644 --- /dev/null +++ b/lib/src/LEON3/APB/apb.h @@ -0,0 +1,135 @@ +/*------------------------------------------------------------------------------ +-- This file is a part of the LPP VHDL IP LIBRARY +-- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-------------------------------------------------------------------------------*/ +/*-- Author : Alexis Jeandet +-- Mail : alexis.jeandet@lpp.polytechnique.fr +----------------------------------------------------------------------------*/ +#ifndef LPP_APB_FUNCTIONS_H +#define LPP_APB_FUNCTIONS_H + +#define APB_TBL_HEAD 0x800FF000 /**< Start address of APB devices list on AHB2APB bridge*/ +#define APB_BASE_ADDRS 0x80000000 /**< Start address of APB bus*/ +#define APB_MAX_DEVICES 256 /**< Maximun device count on APB bus*/ + +#include "apb_devices_list.h" + + +/*! \file lpp_apb_functions.h + \brief General purpose APB functions. + + This library is written to work with AHB2APB VHDL module from Gaisler's GRLIB. It help you to find your device + on the APB bus by providing scan functions, it extract information such as device Version, IRQ value, Address mask. + You can use it to print the APB devices list on your SOC. + + \author Alexis Jeandet alexis.jeandet@lpp.polytechnique.fr + \todo implemente a descriptor structure for any APB device + +*/ + + +/*! \struct apbPnPreg + \brief Structure representing a device descriptor register on Grlib's AHB2APB brige with plug and play feature +*/ +struct apbPnPreg +{ + int idReg; /**< \brief id register composed of Vendor ID [31:24], Device ID [23:12], CT [11:10], Version [9:5], IRQ [4:0] */ + int bar; /**< \brief Bank Address Register composed of Device's ADDRESS [31:20], MASK [14:4], TYPE [3:0] */ +}; + + +/*! \struct apbdevinfo + \brief Structure holding an APB device informations + + This information are extracted from the descriptor registers on Grlib's AHB2APB brige with plug and play feature +*/ +struct apbdevinfo +{ + int vendorID; /**< \brief Stores the Vendor ID of the current device */ + int productID; /**< \brief Stores the Product ID of the current device */ + int version; /**< \brief Stores the Version of the current device */ + int irq; /**< \brief Stores the interrupt Number of the current device */ + int address; /**< \brief Stores the base address of the current device */ + int mask; /**< \brief Stores the address mask of the current device, it gives the address space of this device */ +}; + + + + +/*! \fn int* apbgetdevice(int PID,int VID,int count); + \brief Find device with given VID/PID + + This Function scans APB devices table and returns counth device according to VID and PID + + \param PID The PID of the device you whant to get. + \param VID The VID of the device you whant to get. + \param count The number of the device you whant to get. For example if you have 3 UARTS on your SOC you whant + to use UART1 so count = 2. + + \return The pointer to the device. +*/ +int* apbgetdevice(int PID,int VID,int count); + +/*! \fn void apbgetdeviceinfofromid(int PID,int VID,int count,struct apbdevinfo* devinfo); + \brief Record device informations with given VID/PID + + This Function scans APB devices table and returns counth device informations according VID and PID. + + \param PID The PID of the device you whant to get. + \param VID The VID of the device you whant to get. + \param count The number of the device you whant to get. For example if you have 3 UARTS on your SOC you whant + to use UART1 so count = 2. + \param devinfo The device information structure to be populated. + \example scanAPB.c +*/ +void apbgetdeviceinfofromid(int PID,int VID,int count,struct apbdevinfo* devinfo); + + +/*! \fn void apbgetdeviceinfofromdevptr(const struct apbPnPreg* dev,struct apbdevinfo* devinfo); + \brief Record device informations with given AHB2APB Plugn'Play register. + + This Function extract device informations from the given AHB2APB Plugn'Play register end write them in devinfo. + + \param dev AHB2APB Plugn'Play register corresponding to the device. + \param devinfo The device information structure to be populated. +*/ +void apbgetdeviceinfofromdevptr(const struct apbPnPreg* dev,struct apbdevinfo* devinfo); + + + +/*! \fn void apbprintdeviceinfo(struct apbdevinfo devinfo); + \brief Print given device informations in stdout. + + \param devinfo The device information structure to be printed. +*/ +void apbprintdeviceinfo(struct apbdevinfo devinfo); + + + +/*! \fn void apbprintdeviceslist(); + \brief Print APB devices informations in stdout. + + This function list all devices on APB bus and print theirs informations. + + \example scanAPB.c +*/ +void apbprintdeviceslist(); + + + +#endif // LPP_APB_FUNCTIONS_H + diff --git a/lib/src/LEON3/APB/apb.pro b/lib/src/LEON3/APB/apb.pro new file mode 100644 --- /dev/null +++ b/lib/src/LEON3/APB/apb.pro @@ -0,0 +1,16 @@ +TEMPLATE = lib +ARCH = sparc-elf-gcc +TARGET = libapb +TARGETINSTALLPATH = $(LIBUC_LIBS_DIR_APB) +HEADERSINSTALLPATH = $(LIBUC_INC_DIR_APB) + +LIBS += + +SOURCES += apb.c + + +HEADERS += apb.h \ + apb_devices_list.h + + + diff --git a/lib/src/LEON3/APB/apb_devices_list.h b/lib/src/LEON3/APB/apb_devices_list.h new file mode 100644 --- /dev/null +++ b/lib/src/LEON3/APB/apb_devices_list.h @@ -0,0 +1,25 @@ + + +/*=============================================================================== + +THIS FILE IS GENERATED BY A SCRIPT, DON'T TRY TO EDIT + +TAKE A LOOK AT VHD_LIB/APB_DEVICES FOLDER TO ADD A DEVICE ID OR VENDOR ID + +===============================================================================*/ +#define VENDOR_LPP 0x19 + +#define ROCKET_TM 0x1 +#define otherCore 0x2 +#define LPP_SIMPLE_DIODE 0x3 +#define LPP_MULTI_DIODE 0x4 +#define LPP_LCD_CTRLR 0x5 +#define LPP_UART 0x6 +#define LPP_CNA 0x7 +#define LPP_APB_ADC 0x8 +#define LPP_CHENILLARD 0x9 +#define LPP_IIR_CEL_FILTER 0x10 +#define LPP_FIFO_PID 0x11 +#define LPP_FFT 0x12 +#define LPP_MATRIX 0x13 +#define LPP_BALISE 0x14 diff --git a/lib/src/LEON3/leon3.pro b/lib/src/LEON3/leon3.pro new file mode 100644 --- /dev/null +++ b/lib/src/LEON3/leon3.pro @@ -0,0 +1,5 @@ +TEMPLATE = dir +SUBDIRS += APB + + + diff --git a/lib/src/Makefile b/lib/src/Makefile --- a/lib/src/Makefile +++ b/lib/src/Makefile @@ -7,6 +7,7 @@ all:subdir make -C common/UHANDLE make -C lpc21XX make -C lpc17XX + make -C LEON3 make -C common make -C apps @echo Code compiled @@ -15,6 +16,7 @@ clean: make clean -C common/UHANDLE make clean -C lpc21XX make clean -C lpc17XX + make clean -C LEON3 make clean -C common make clean -C apps @echo Code compiled diff --git a/lib/src/common/BLOCKDEVICES/Makefile b/lib/src/common/BLOCKDEVICES/Makefile deleted file mode 100644 --- a/lib/src/common/BLOCKDEVICES/Makefile +++ /dev/null @@ -1,7 +0,0 @@ - -PROJECTDIR = `pwd` -LIBUC = /opt/libuc2 - -all: - make -f lpc17XX.mk - make -f lpc21XX.mk diff --git a/lib/src/common/BLOCKDEVICES/blkdevice.c b/lib/src/common/BLOCKDEVICES/blkdevice.c deleted file mode 100644 --- a/lib/src/common/BLOCKDEVICES/blkdevice.c +++ /dev/null @@ -1,23 +0,0 @@ -/*------------------------------------------------------------------------------ --- This file is a part of the libuc, microcontroler library --- Copyright (C) 2012, Alexis Jeandet --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -------------------------------------------------------------------------------- --- Author : Alexis Jeandet --- Mail : alexis.jeandet@gmail.com --------------------------------------------------------------------------------*/ - -#include "blkdevice.h" diff --git a/lib/src/common/BLOCKDEVICES/blkdevice.h b/lib/src/common/BLOCKDEVICES/blkdevice.h deleted file mode 100644 --- a/lib/src/common/BLOCKDEVICES/blkdevice.h +++ /dev/null @@ -1,127 +0,0 @@ -/*------------------------------------------------------------------------------ --- This file is a part of the libuc, microcontroler library --- Copyright (C) 2012, Alexis Jeandet --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -------------------------------------------------------------------------------- --- Author : Alexis Jeandet --- Mail : alexis.jeandet@gmail.com --------------------------------------------------------------------------------*/ -#ifndef BLKDEVICE_H -#define BLKDEVICE_H -/* Disk Status Bits (DSTATUS) */ - -#define STA_NOINIT 0x01 /* Drive not initialized */ -#define STA_NODISK 0x02 /* No medium in the drive */ -#define STA_PROTECT 0x04 /* Write protected */ - - -/* Command code for disk_ioctrl fucntion */ -/* Generic ioctl command (defined for FatFs) */ -#define CTRL_SYNC 0 /* Flush disk cache (for write functions) */ -#define GET_SECTOR_COUNT 1 /* Get media size (for only f_mkfs()) */ -#define GET_SECTOR_SIZE 2 /* Get sector size (for multiple sector size (_MAX_SS >= 1024)) */ -#define GET_BLOCK_SIZE 3 /* Get erase block size (for only f_mkfs()) */ -#define CTRL_ERASE_SECTOR 4 /* Force erased a block of sectors (for only _USE_ERASE) */ - -/* Generic ioctl command */ -#define CTRL_POWER 5 /* Get/Set power status */ -#define CTRL_LOCK 6 /* Lock/Unlock media removal */ -#define CTRL_EJECT 7 /* Eject media */ - -/* MMC/SDC specific ioctl command */ -#define MMC_GET_TYPE 10 /* Get card type */ -#define MMC_GET_CSD 11 /* Get CSD */ -#define MMC_GET_CID 12 /* Get CID */ -#define MMC_GET_OCR 13 /* Get OCR */ -#define MMC_GET_SDSTAT 14 /* Get SD status */ - -/* ATA/CF specific ioctl command */ -#define ATA_GET_REV 20 /* Get F/W revision */ -#define ATA_GET_MODEL 21 /* Get model name */ -#define ATA_GET_SN 22 /* Get serial number */ - -/* NAND specific ioctl command */ -#define NAND_FORMAT 30 /* Create physical format */ - -/* Status of Disk Functions */ -typedef unsigned char DSTATUS; - -/* Results of Disk Functions */ -typedef enum { - RES_OK = 0, /* 0: Successful */ - RES_ERROR, /* 1: R/W Error */ - RES_WRPRT, /* 2: Write Protected */ - RES_NOTRDY, /* 3: Not Ready */ - RES_PARERR /* 4: Invalid Parameter */ -} DRESULT; - -typedef volatile struct blkdevice_str blkdevice; - -typedef void (*blkdevselect_t)(char); -typedef void (*blkdevpower_t)(char) ; -typedef char (*blkdevdetect_t)() ; -typedef char (*blkdevwriteprotected_t)() ; -typedef DRESULT (*blkdevwrite_t)(blkdevice* _this,char drv,const char *buff,unsigned long sector,char count) ; -typedef DRESULT (*blkdevread_t)(blkdevice* _this,char drv,char *buff,unsigned long sector,char count) ; -typedef DRESULT (*blkdevioctl_t)(blkdevice* _this,char drv,char ctrl,void *buff) ; -typedef DSTATUS (*blkdevinitialize_t)(blkdevice* _this,char drv) ; -typedef DSTATUS (*blkdevstatus_t) (blkdevice* _this,char drv) ; - -struct blkdevice_str -{ - void* phy; - unsigned int size; - unsigned int MaxSpeed; - unsigned char Version; - blkdevselect_t select; - blkdevpower_t power; - blkdevdetect_t detect; - blkdevwriteprotected_t writeprotected; - blkdevwrite_t write; - blkdevread_t read; - blkdevioctl_t ioctl; - blkdevinitialize_t initialize; - blkdevstatus_t status; -}; - - - - - - -#endif - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/src/common/BLOCKDEVICES/blkdevice.pro b/lib/src/common/BLOCKDEVICES/blkdevice.pro deleted file mode 100644 --- a/lib/src/common/BLOCKDEVICES/blkdevice.pro +++ /dev/null @@ -1,26 +0,0 @@ -TEMPLATE = lib -lpc17XX.ARCH = lpc17XX-arm-noabi-gcc -lpc17XX.TARGET = libblkdevice -lpc17XX.TARGETINSTALLPATH = $(LIBUC_LIBS_DIR_BLKDEVICE) -lpc17XX.HEADERSINSTALLPATH = $(LIBUC_INC_DIR_BLKDEVICE) - -lpc17XX.LIBS += - -lpc17XX.SOURCES += blkdevice.c - - -lpc17XX.HEADERS += blkdevice.h - - - -lpc21XX.ARCH = lpc21XX-arm-noabi-gcc -lpc21XX.TARGET = libblkdevice -lpc21XX.TARGETINSTALLPATH = $(LIBUC_LIBS_DIR_BLKDEVICE) -lpc21XX.HEADERSINSTALLPATH = $(LIBUC_INC_DIR_BLKDEVICE) - -lpc21XX.LIBS += - -lpc21XX.SOURCES += blkdevice.c - - -lpc21XX.HEADERS += blkdevice.h diff --git a/lib/src/common/BLOCKDEVICES/lpc17XX.mk b/lib/src/common/BLOCKDEVICES/lpc17XX.mk deleted file mode 100644 --- a/lib/src/common/BLOCKDEVICES/lpc17XX.mk +++ /dev/null @@ -1,19 +0,0 @@ -PROJECTDIR = `pwd` -LIBUC = /opt/libuc2 - -HEADERSINSTALLPATH = $(LIBUC_INC_DIR_BLKDEVICE) -HEADERS += blkdevice.h -LIBSOURCES += blkdevice.c -OBJECTFILES = $(LIBSOURCES:.c=.o) -ARCH = lpc17XX-arm-noabi-gcc -ARCHFOLDER = $(LIBUC)/rules/lpc17XX-arm-noabi-gcc -TARGET=libblkdevice -LIBUC_INCLUDES= -LIBUC_LIBRARIES= -TARGETINSTALLPATH=$(LIBUC_LIBS_DIR_BLKDEVICE) -HEADERSINSTALLPATH=$(LIBUC_INC_DIR_BLKDEVICE) -BSP=generic -include $(ARCHFOLDER)/rules.mk - -all:lib - @echo Code compiled diff --git a/lib/src/common/BLOCKDEVICES/lpc21XX.mk b/lib/src/common/BLOCKDEVICES/lpc21XX.mk deleted file mode 100644 --- a/lib/src/common/BLOCKDEVICES/lpc21XX.mk +++ /dev/null @@ -1,19 +0,0 @@ -PROJECTDIR = `pwd` -LIBUC = /opt/libuc2 - -HEADERSINSTALLPATH = $(LIBUC_INC_DIR_BLKDEVICE) -HEADERS += blkdevice.h -LIBSOURCES += blkdevice.c -OBJECTFILES = $(LIBSOURCES:.c=.o) -ARCH = lpc21XX-arm-noabi-gcc -ARCHFOLDER = $(LIBUC)/rules/lpc21XX-arm-noabi-gcc -TARGET=libblkdevice -LIBUC_INCLUDES= -LIBUC_LIBRARIES= -TARGETINSTALLPATH=$(LIBUC_LIBS_DIR_BLKDEVICE) -HEADERSINSTALLPATH=$(LIBUC_INC_DIR_BLKDEVICE) -BSP=generic -include $(ARCHFOLDER)/rules.mk - -all:lib - @echo Code compiled diff --git a/lib/src/common/SDCARD/Makefile b/lib/src/common/SDCARD/Makefile deleted file mode 100644 --- a/lib/src/common/SDCARD/Makefile +++ /dev/null @@ -1,7 +0,0 @@ - -PROJECTDIR = `pwd` -LIBUC = /opt/libuc2 - -all: - make -f lpc17XX.mk - make -f lpc21XX.mk diff --git a/lib/src/common/SDCARD/lpc17XX.mk b/lib/src/common/SDCARD/lpc17XX.mk deleted file mode 100644 --- a/lib/src/common/SDCARD/lpc17XX.mk +++ /dev/null @@ -1,19 +0,0 @@ -PROJECTDIR = `pwd` -LIBUC = /opt/libuc2 - -HEADERSINSTALLPATH = $(LIBUC_INC_DIR_SDCARD) -HEADERS += sdcard.h -LIBSOURCES += sdcard.c -OBJECTFILES = $(LIBSOURCES:.c=.o) -ARCH = lpc17XX-arm-noabi-gcc -ARCHFOLDER = $(LIBUC)/rules/lpc17XX-arm-noabi-gcc -TARGET=libsdcard -LIBUC_INCLUDES=$(LIBUC_INC_DIR_SSP_CMD) $(LIBUC_INC_DIR_BLKDEVICE_CMD) $(LIBUC_INC_DIR_UCSTRINGS_CMD) -LIBUC_LIBRARIES=$(LIBUC_LIBS_DIR_SSP_CMD) $(LIBUC_LIBS_SSP) $(LIBUC_LIBS_DIR_BLKDEVICE_CMD) $(LIBUC_LIBS_BLKDEVICE) $(LIBUC_LIBS_DIR_UCSTRINGS_CMD) $(LIBUC_LIBS_UCSTRINGS) -TARGETINSTALLPATH=$(LIBUC_LIBS_DIR_SDCARD) -HEADERSINSTALLPATH=$(LIBUC_INC_DIR_SDCARD) -BSP=generic -include $(ARCHFOLDER)/rules.mk - -all:lib - @echo Code compiled diff --git a/lib/src/common/SDCARD/lpc21XX.mk b/lib/src/common/SDCARD/lpc21XX.mk deleted file mode 100644 --- a/lib/src/common/SDCARD/lpc21XX.mk +++ /dev/null @@ -1,19 +0,0 @@ -PROJECTDIR = `pwd` -LIBUC = /opt/libuc2 - -HEADERSINSTALLPATH = $(LIBUC_INC_DIR_SDCARD) -HEADERS += sdcard.h -LIBSOURCES += sdcard.c -OBJECTFILES = $(LIBSOURCES:.c=.o) -ARCH = lpc21XX-arm-noabi-gcc -ARCHFOLDER = $(LIBUC)/rules/lpc21XX-arm-noabi-gcc -TARGET=libsdcard -LIBUC_INCLUDES=$(LIBUC_INC_DIR_SSP_CMD) $(LIBUC_INC_DIR_BLKDEVICE_CMD) $(LIBUC_INC_DIR_UCSTRINGS_CMD) $(LIBUC_INC_DIR_SSP_CMD) $(LIBUC_INC_DIR_BLKDEVICE_CMD) -LIBUC_LIBRARIES=$(LIBUC_LIBS_DIR_SSP_CMD) $(LIBUC_LIBS_SSP) $(LIBUC_LIBS_DIR_BLKDEVICE_CMD) $(LIBUC_LIBS_BLKDEVICE) $(LIBUC_LIBS_DIR_UCSTRINGS_CMD) $(LIBUC_LIBS_UCSTRINGS) $(LIBUC_LIBS_DIR_SSP_CMD) $(LIBUC_LIBS_SSP) $(LIBUC_LIBS_DIR_BLKDEVICE_CMD) $(LIBUC_LIBS_BLKDEVICE) -TARGETINSTALLPATH=$(LIBUC_LIBS_DIR_SDCARD) -HEADERSINSTALLPATH=$(LIBUC_INC_DIR_SDCARD) -BSP=generic -include $(ARCHFOLDER)/rules.mk - -all:lib - @echo Code compiled diff --git a/lib/src/common/SDCARD/sdcard.c b/lib/src/common/SDCARD/sdcard.c deleted file mode 100644 --- a/lib/src/common/SDCARD/sdcard.c +++ /dev/null @@ -1,455 +0,0 @@ -/*------------------------------------------------------------------------------ --- This file is a part of the libuc, microcontroler library --- Copyright (C) 2012, Alexis Jeandet --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -------------------------------------------------------------------------------- --- Author : Alexis Jeandet --- Mail : alexis.jeandet@gmail.com --------------------------------------------------------------------------------*/ -#include "sdcard.h" -static volatile -unsigned int Timer1, Timer2; /* 1kHz decrement timer stopped at zero (disk_timerproc()) */ - -void sdcarddeselect (blkdevice* _this) -{ - char d; - _this->select(0); - ((sdcardDev*)_this->phy)->rcvr_mmc(((sdcardDev*)_this->phy)->phy,&d, 1); /* Dummy clock (force DO hi-z for multiple slave SPI) */ -} - -int sdcardselect (blkdevice* _this) /* 1:OK, 0:Timeout */ -{ - char d; - _this->select(1); - ((sdcardDev*)_this->phy)->rcvr_mmc(((sdcardDev*)_this->phy)->phy,&d, 1); /* Dummy clock (force DO enabled) */ - - if (sdcardwait_ready(((sdcardDev*)_this->phy))) return 1; /* OK */ - _this->select(0); - return 0; /* Timeout */ -} - -int sdcardwait_ready (sdcardDev* sdcard) /* 1:OK, 0:Timeout */ -{ - char d; - unsigned int tmr; - volatile unsigned int i=0; - - for (tmr = 5000; tmr; tmr--) { /* Wait for ready in timeout of 500ms */ - sdcard->rcvr_mmc(sdcard->phy,&d, 1); - if (d == 0xFF) break; - for(i=0;i<1024*128;i++); - } - - return tmr ? 1 : 0; -} - -int sdcardrcvr_datablock (sdcardDev* sdcard,char *buff,unsigned int btr) -{ - char d[2]; - unsigned int tmr; - volatile unsigned int i=0; - for (tmr = 1000; tmr; tmr--) { /* Wait for data packet in timeout of 100ms */ - sdcard->rcvr_mmc(sdcard->phy,d, 1); - if (d[0] != 0xFF) break; - for(i=0;i<1024*128;i++); - } - if (d[0] != 0xFE) return 0; /* If not valid data token, return with error */ - - sdcard->rcvr_mmc(sdcard->phy,buff, btr); /* Receive the data block into buffer */ - sdcard->rcvr_mmc(sdcard->phy,d, 2); /* Discard CRC */ - - return 1; /* Return with success */ -} - - -int sdcardxmit_datablock (sdcardDev* sdcard,const char *buff,char token) -{ - char d[2]; - - - if (!sdcardwait_ready(sdcard)) return 0; - - d[0] = token; - sdcard->xmit_mmc(sdcard->phy,d, 1); /* Xmit a token */ - if (token != 0xFD) { /* Is it data token? */ - sdcard->xmit_mmc(sdcard->phy,buff, 512); /* Xmit the 512 byte data block to MMC */ - sdcard->rcvr_mmc(sdcard->phy,d, 2); /* Xmit dummy CRC (0xFF,0xFF) */ - sdcard->rcvr_mmc(sdcard->phy,d, 1); /* Receive data response */ - if ((d[0] & 0x1F) != 0x05) /* If not accepted, return with error */ - return 0; - } - - return 1; -} - - -char sdcardsend_cmd (blkdevice* _this,char cmd,unsigned int arg) -{ - char n, d, buf[6]; - - - if (cmd & 0x80) { /* ACMD is the command sequense of CMD55-CMD */ - cmd &= 0x7F; - n = sdcardsend_cmd(_this,CMD55, 0); - if (n > 1) return n; - } - /* Select the card and wait for ready */ - sdcarddeselect(_this); - if (!sdcardselect(_this)) return 0xFF; - /* Send a command packet */ - buf[0] = 0x40 | cmd; /* Start + Command index */ - buf[1] = (char)(arg >> 24); /* Argument[31..24] */ - buf[2] = (char)(arg >> 16); /* Argument[23..16] */ - buf[3] = (char)(arg >> 8); /* Argument[15..8] */ - buf[4] = (char)arg; /* Argument[7..0] */ - n = 0x01; /* Dummy CRC + Stop */ - if (cmd == CMD0) n = 0x95; /* (valid CRC for CMD0(0)) */ - if (cmd == CMD8) n = 0x87; /* (valid CRC for CMD8(0x1AA)) */ - if (cmd == CMD55) n = 0x63; - buf[5] = n; - ((sdcardDev*)_this->phy)->xmit_mmc(((sdcardDev*)_this->phy)->phy,buf, 6); - /* Receive command response */ - if (cmd == CMD12) {((sdcardDev*)_this->phy)->rcvr_mmc(((sdcardDev*)_this->phy)->phy,&d, 1);} /* Skip a stuff byte when stop reading */ - n = 10; /* Wait for a valid response in timeout of 10 attempts */ - do - { - ((sdcardDev*)_this->phy)->rcvr_mmc(((sdcardDev*)_this->phy)->phy,&d, 1); - //libucprintf("resp=%d\n\r",d); - } - while ((d & 0x80) && --n); - - return d; /* Return with the response value */ -} - - - - -DSTATUS sdcarddisk_status (blkdevice* _this,char drv) -{ - DSTATUS s = ((sdcardDev*)_this->phy)->Stat; - char ocr[4]; - - - if (drv || !_this->detect()) { - s = STA_NODISK | STA_NOINIT; - } else { - s &= ~STA_NODISK; - if (_this->writeprotected()) /* Check card write protection */ - s |= STA_PROTECT; - else - s &= ~STA_PROTECT; - if (!(s & STA_NOINIT)) { - if (sdcardsend_cmd(_this,CMD58, 0)) /* Check if the card is kept initialized */ - s |= STA_NOINIT; - ((sdcardDev*)_this->phy)->rcvr_mmc(((sdcardDev*)_this->phy)->phy,ocr, 4); - _this->select(0); - } - } - ((sdcardDev*)_this->phy)->Stat = s; - - return s; -} - - - - -DSTATUS sdcarddisk_initialize (blkdevice* _this,char drv) -{ - char n, cmd, ty, ocr[4]; - const unsigned char dummy=0xff; - - ((sdcardDev*)_this->phy)->setspeed(((sdcardDev*)_this->phy)->phy,350000); - if (drv) return STA_NOINIT; /* Supports only drive 0 */ - if (((sdcardDev*)_this->phy)->Stat & STA_NODISK) return ((sdcardDev*)_this->phy)->Stat; /* Is card existing in the soket? */ - - for (n = 10; n; n--) ((sdcardDev*)_this->phy)->xmit_mmc(((sdcardDev*)_this->phy)->phy,&dummy, 1); /* Send 80 dummy clocks */ - - ty = 0; - if (sdcardsend_cmd(_this,CMD0, 0) == 1) { /* Put the card SPI/Idle state */ - Timer1 = 1000; /* Initialization timeout = 1 sec */ - if (sdcardsend_cmd(_this,CMD8, 0x1AA) == 1) { /* SDv2? */ - ((sdcardDev*)_this->phy)->rcvr_mmc(((sdcardDev*)_this->phy)->phy,ocr, 4); - //for (n = 0; n < 4; n++) ocr[n] = xchg_spi(0xFF); /* Get 32 bit return value of R7 resp */ - if (ocr[2] == 0x01 && ocr[3] == 0xAA) { /* Is the card supports vcc of 2.7-3.6V? */ - while (Timer1 && sdcardsend_cmd(_this,ACMD41, 1UL << 30)) ; /* Wait for end of initialization with ACMD41(HCS) */ - if (Timer1 && sdcardsend_cmd(_this,CMD58, 0) == 0) { /* Check CCS bit in the OCR */ - //for (n = 0; n < 4; n++) ocr[n] = xchg_spi(0xFF); - ((sdcardDev*)_this->phy)->rcvr_mmc(((sdcardDev*)_this->phy)->phy,ocr, 4); - ty = (ocr[0] & 0x40) ? CT_SD2 | CT_BLOCK : CT_SD2; /* Card id SDv2 */ - } - } - } else { /* Not SDv2 card */ - if (sdcardsend_cmd(_this,ACMD41, 0) <= 1) { /* SDv1 or MMC? */ - ty = CT_SD1; cmd = ACMD41; /* SDv1 (ACMD41(0)) */ - } else { - ty = CT_MMC; cmd = CMD1; /* MMCv3 (CMD1(0)) */ - } - while (Timer1 && sdcardsend_cmd(_this,cmd, 0)) ; /* Wait for end of initialization */ - if (!Timer1 || sdcardsend_cmd(_this,CMD16, 512) != 0) /* Set block length: 512 */ - ty = 0; - } - } - ((sdcardDev*)_this->phy)->CardType = ty; /* Card type */ - sdcarddeselect (_this); - - if (ty) { /* OK */ - ((sdcardDev*)_this->phy)->setspeed(((sdcardDev*)_this->phy)->phy,10000000); - ((sdcardDev*)_this->phy)->Stat &= ~STA_NOINIT; /* Clear STA_NOINIT flag */ - } else { /* Failed */ - //power_off(); - ((sdcardDev*)_this->phy)->Stat = STA_NOINIT; - } - - return ((sdcardDev*)_this->phy)->Stat; -} - - - - - - - - - - -DRESULT sdcarddisk_read (blkdevice* _this,char drv,char *buff,unsigned int sector,char count) -{ - DSTATUS s; - - - s = sdcarddisk_status(_this,drv); - if (s & STA_NOINIT) return RES_NOTRDY; - if (!count) return RES_PARERR; - if (!(((sdcardDev*)_this->phy)->CardType & CT_BLOCK)) sector *= 512; /* Convert LBA to byte address if needed */ - - if (count == 1) { /* Single block read */ - if ((sdcardsend_cmd(_this,CMD17, sector) == 0) && sdcardrcvr_datablock((sdcardDev*)(_this->phy),buff, 512)) - count = 0; - } - else { /* Multiple block read */ - if (sdcardsend_cmd(_this,CMD18, sector) == 0) { /* READ_MULTIPLE_BLOCK */ - do { - if (!sdcardrcvr_datablock (((sdcardDev*)_this->phy),buff, 512)) break; - buff += 512; - } while (--count); - sdcardsend_cmd(_this,CMD12, 0); /* STOP_TRANSMISSION */ - } - } - sdcarddeselect (_this); - - return count ? RES_ERROR : RES_OK; -} - - - - - -DRESULT sdcarddisk_write (blkdevice* _this,char drv,const char *buff,unsigned int sector,char count) -{ - DSTATUS s; - - - s = sdcarddisk_status(_this,drv); - if (s & STA_NOINIT) return RES_NOTRDY; - if (s & STA_PROTECT) return RES_WRPRT; - if (!count) return RES_PARERR; - if (!(((sdcardDev*)_this->phy)->CardType & CT_BLOCK)) sector *= 512; /* Convert LBA to byte address if needed */ - - if (count == 1) { /* Single block write */ - if ((sdcardsend_cmd(_this,CMD24, sector) == 0) /* WRITE_BLOCK */ - && sdcardxmit_datablock (((sdcardDev*)_this->phy),buff, 0xFE)) - count = 0; - } - else { /* Multiple block write */ - if (((sdcardDev*)_this->phy)->CardType & CT_SDC) sdcardsend_cmd(_this,ACMD23, count); - if (sdcardsend_cmd(_this,CMD25, sector) == 0) { /* WRITE_MULTIPLE_BLOCK */ - do { - if (!sdcardxmit_datablock (((sdcardDev*)_this->phy),buff, 0xFC)) break; - buff += 512; - } while (--count); - if (!sdcardxmit_datablock (((sdcardDev*)_this->phy),0, 0xFD)) /* STOP_TRAN token */ - count = 1; - } - } - sdcarddeselect (_this); - - return count ? RES_ERROR : RES_OK; -} - - -DRESULT sdcarddisk_ioctl (blkdevice* _this,char drv,char ctrl,void *buff) -{ - DRESULT res; - const unsigned char dummy=0xff; - char n, csd[16], *ptr = buff; - unsigned short csize; - unsigned long *dp, st, ed; - - - if (drv) return RES_PARERR; /* Check parameter */ - if (((sdcardDev*)_this->phy)->Stat & STA_NOINIT) return RES_NOTRDY; /* Check if drive is ready */ - - res = RES_ERROR; - - switch (ctrl) { - case CTRL_SYNC : /* Wait for end of internal write process of the drive */ - if (sdcardselect (_this)) { - sdcarddeselect (_this); - res = RES_OK; - } - break; - - case GET_SECTOR_COUNT : /* Get drive capacity in unit of sector (DWORD) */ - if ((sdcardsend_cmd(_this,CMD9, 0) == 0) && sdcardrcvr_datablock (((sdcardDev*)_this->phy),csd, 16)) { - if ((csd[0] >> 6) == 1) { /* SDC ver 2.00 */ - csize = csd[9] + ((unsigned short)csd[8] << 8) + 1; - *(unsigned long*)buff = (unsigned long)csize << 10; - } else { /* SDC ver 1.XX or MMC ver 3 */ - n = (csd[5] & 15) + ((csd[10] & 128) >> 7) + ((csd[9] & 3) << 1) + 2; - csize = (csd[8] >> 6) + ((unsigned short)csd[7] << 2) + ((unsigned short)(csd[6] & 3) << 10) + 1; - *(unsigned long*)buff = (unsigned long)csize << (n - 9); - } - res = RES_OK; - } - break; - - case GET_SECTOR_SIZE : /* Get sector size in unit of byte (WORD) */ - *(unsigned short*)buff = 512; - res = RES_OK; - break; - - case GET_BLOCK_SIZE : /* Get erase block size in unit of sector (DWORD) */ - if (((sdcardDev*)_this->phy)->CardType & CT_SD2) { /* SDC ver 2.00 */ - if (sdcardsend_cmd(_this,ACMD13, 0) == 0) { /* Read SD status */ - ((sdcardDev*)_this->phy)->xmit_mmc(((sdcardDev*)_this->phy)->phy,&dummy, 1); - if (sdcardrcvr_datablock (((sdcardDev*)_this->phy),csd, 16)) { /* Read partial block */ - for (n = 64 - 16; n; n--) ((sdcardDev*)_this->phy)->xmit_mmc(((sdcardDev*)_this->phy)->phy,&dummy, 1); /* Purge trailing data */ - *(unsigned long*)buff = 16UL << (csd[10] >> 4); - res = RES_OK; - ((sdcardDev*)_this->phy)->xmit_mmc(((sdcardDev*)_this->phy)->phy,&dummy, 1); - } - } - } else { /* SDC ver 1.XX or MMC */ - if ((sdcardsend_cmd(_this,CMD9, 0) == 0) && sdcardrcvr_datablock (((sdcardDev*)_this->phy),csd, 16)) { /* Read CSD */ - if (((sdcardDev*)_this->phy)->CardType & CT_SD1) { /* SDC ver 1.XX */ - *(unsigned long*)buff = (((csd[10] & 63) << 1) + ((unsigned short)(csd[11] & 128) >> 7) + 1) << ((csd[13] >> 6) - 1); - } else { /* MMC */ - *(unsigned long*)buff = ((unsigned short)((csd[10] & 124) >> 2) + 1) * (((csd[11] & 3) << 3) + ((csd[11] & 224) >> 5) + 1); - } - res = RES_OK; - } - } - break; - - case CTRL_ERASE_SECTOR : /* Erase a block of sectors (used when _USE_ERASE == 1) */ - if (!(((sdcardDev*)_this->phy)->CardType & CT_SDC)) break; /* Check if the card is SDC */ - if (sdcarddisk_ioctl(_this,drv, MMC_GET_CSD, csd)) break; /* Get CSD */ - if (!(csd[0] >> 6) && !(csd[10] & 0x40)) break; /* Check if sector erase can be applied to the card */ - dp = buff; st = dp[0]; ed = dp[1]; /* Load sector block */ - if (!(((sdcardDev*)_this->phy)->CardType & CT_BLOCK)) { - st *= 512; ed *= 512; - } - if (sdcardsend_cmd(_this,CMD32, st) == 0 && sdcardsend_cmd(_this,CMD33, ed) == 0 && sdcardsend_cmd(_this,CMD38, 0) == 0 && sdcardwait_ready(((sdcardDev*)_this->phy))) /* Erase sector block */ - res = RES_OK; /* FatFs does not check result of this command */ - break; - - /* Following command are not used by FatFs module */ - - case MMC_GET_TYPE : /* Get MMC/SDC type (BYTE) */ - *ptr = ((sdcardDev*)_this->phy)->CardType; - res = RES_OK; - break; - - case MMC_GET_CSD : /* Read CSD (16 bytes) */ - if (sdcardsend_cmd(_this,CMD9, 0) == 0 /* READ_CSD */ - && sdcardrcvr_datablock (((sdcardDev*)_this->phy),ptr, 16)) - res = RES_OK; - break; - - case MMC_GET_CID : /* Read CID (16 bytes) */ - if (sdcardsend_cmd(_this,CMD10, 0) == 0 /* READ_CID */ - && sdcardrcvr_datablock (((sdcardDev*)_this->phy),ptr, 16)) - res = RES_OK; - break; - - case MMC_GET_OCR : /* Read OCR (4 bytes) */ - if (sdcardsend_cmd(_this,CMD58, 0) == 0) { /* READ_OCR */ - //for (n = 4; n; n--) *ptr++ = - ((sdcardDev*)_this->phy)->rcvr_mmc(((sdcardDev*)_this->phy)->phy,ptr, 4); - res = RES_OK; - } - break; - - case MMC_GET_SDSTAT : /* Read SD status (64 bytes) */ - if (sdcardsend_cmd(_this,ACMD13, 0) == 0) { /* SD_STATUS */ - ((sdcardDev*)_this->phy)->xmit_mmc(((sdcardDev*)_this->phy)->phy,&dummy, 1); - if (sdcardrcvr_datablock (((sdcardDev*)_this->phy),ptr, 64)) - res = RES_OK; - } - break; - - default: - res = RES_PARERR; - } - - sdcarddeselect (_this); - - return res; -} - - - -void sdcardmake(sdcardDev* sdcard,void* phy,void (*rcvr_mmc) (void*,char *,unsigned int ),void (*xmit_mmc) (void*,const char *,unsigned int ),void (*setspeed) (void* phy,unsigned int speed)) -{ - sdcard->phy = phy; - sdcard->rcvr_mmc = rcvr_mmc; - sdcard->xmit_mmc = xmit_mmc; - sdcard->setspeed = setspeed; -} - - void sdcardmakeblkdev(blkdevice* dev,sdcardDev* sdcard, blkdevselect_t select,blkdevpower_t power,blkdevdetect_t detect,blkdevwriteprotected_t writeprotected) - { - dev->phy=sdcard; - dev->select=select; - dev->power = power; - dev->detect = detect; - dev->writeprotected = writeprotected; - dev->write = sdcarddisk_write; - dev->read = sdcarddisk_read; - dev->ioctl = sdcarddisk_ioctl; - dev->initialize = sdcarddisk_initialize; - dev->status = sdcarddisk_status; - - } - - - - - - - - - - - - - - - - - - - diff --git a/lib/src/common/SDCARD/sdcard.h b/lib/src/common/SDCARD/sdcard.h deleted file mode 100644 --- a/lib/src/common/SDCARD/sdcard.h +++ /dev/null @@ -1,116 +0,0 @@ -/*------------------------------------------------------------------------------ --- This file is a part of the libuc, microcontroler library --- Copyright (C) 2012, Alexis Jeandet --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -------------------------------------------------------------------------------- --- Author : Alexis Jeandet --- Mail : alexis.jeandet@gmail.com --------------------------------------------------------------------------------*/ -#ifndef SDCARD_H -#define SDCARD_H -#include "blkdevice.h" -#include - -/* MMC/SD command */ -#define CMD0 (0) /* GO_IDLE_STATE */ -#define CMD1 (1) /* SEND_OP_COND (MMC) */ -#define ACMD41 (0x80+41) /* SEND_OP_COND (SDC) */ -#define CMD8 (8) /* SEND_IF_COND */ -#define CMD9 (9) /* SEND_CSD */ -#define CMD10 (10) /* SEND_CID */ -#define CMD12 (12) /* STOP_TRANSMISSION */ -#define ACMD13 (0x80+13) /* SD_STATUS (SDC) */ -#define CMD16 (16) /* SET_BLOCKLEN */ -#define CMD17 (17) /* READ_SINGLE_BLOCK */ -#define CMD18 (18) /* READ_MULTIPLE_BLOCK */ -#define CMD23 (23) /* SET_BLOCK_COUNT (MMC) */ -#define ACMD23 (0x80+23) /* SET_WR_BLK_ERASE_COUNT (SDC) */ -#define CMD24 (24) /* WRITE_BLOCK */ -#define CMD25 (25) /* WRITE_MULTIPLE_BLOCK */ -#define CMD32 (32) /* ERASE_ER_BLK_START */ -#define CMD33 (33) /* ERASE_ER_BLK_END */ -#define CMD38 (38) /* ERASE */ -#define CMD55 (55) /* APP_CMD */ -#define CMD58 (58) /* READ_OCR */ - -/* Card type flags (CardType) */ -#define CT_MMC 0x01 /* MMC ver 3 */ -#define CT_SD1 0x02 /* SD ver 1 */ -#define CT_SD2 0x04 /* SD ver 2 */ -#define CT_SDC (CT_SD1|CT_SD2) /* SD */ -#define CT_BLOCK 0x08 /* Block addressing */ - -struct sdcard_str -{ - void* phy; - void (*rcvr_mmc) (void* phy,char *buff,unsigned int bc); - void (*xmit_mmc) (void* phy,const char *buff,unsigned int bc); - void (*setspeed) (void* phy,unsigned int speed); - DSTATUS Stat; - char CardType; -}; - -typedef volatile struct sdcard_str sdcardDev; - -extern void sdcardmake(sdcardDev* sdcard,void* phy,void (*rcvr_mmc) (void*,char *,unsigned int ),void (*xmit_mmc) (void*,const char *,unsigned int ),void (*setspeed) (void* phy,unsigned int speed)); -extern void sdcardmakeblkdev(blkdevice* dev,sdcardDev* sdcard, blkdevselect_t select,blkdevpower_t power,blkdevdetect_t detect,blkdevwriteprotected_t writeprotected); - -extern int sdcardselect (blkdevice* _this); -extern void sdcarddeselect (blkdevice* _this); -extern int sdcardwait_ready (sdcardDev* sdcard); -extern int sdcardxmit_datablock (sdcardDev* sdcard,const char *buff,char token); -extern int sdcardrcvr_datablock (sdcardDev* sdcard,char *buff,unsigned int btr); -extern char sdcardsend_cmd (blkdevice* _this,char cmd,unsigned int arg); - -extern DSTATUS sdcarddisk_status (blkdevice* _this,char drv); -extern DSTATUS sdcarddisk_initialize (blkdevice* _this,char drv); -extern DRESULT sdcarddisk_read (blkdevice* _this,char drv,char *buff,unsigned int sector,char count); -extern DRESULT sdcarddisk_write (blkdevice* _this,char drv,const char *buff,unsigned int sector,char count); -extern DRESULT sdcarddisk_ioctl (blkdevice* _this,char drv,char ctrl,void *buff); - -#endif - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/src/common/SDCARD/sdcard.pro b/lib/src/common/SDCARD/sdcard.pro deleted file mode 100644 --- a/lib/src/common/SDCARD/sdcard.pro +++ /dev/null @@ -1,26 +0,0 @@ -TEMPLATE = lib -lpc17XX.ARCH = lpc17XX-arm-noabi-gcc -lpc17XX.TARGET = libsdcard -lpc17XX.TARGETINSTALLPATH = $(LIBUC_LIBS_DIR_SDCARD) -lpc17XX.HEADERSINSTALLPATH = $(LIBUC_INC_DIR_SDCARD) - -lpc17XX.LIBS += SSP BLKDEVICE UCSTRINGS - -lpc17XX.SOURCES += sdcard.c - - -lpc17XX.HEADERS += sdcard.h - - - -lpc21XX.ARCH = lpc21XX-arm-noabi-gcc -lpc21XX.TARGET = libsdcard -lpc21XX.TARGETINSTALLPATH = $(LIBUC_LIBS_DIR_SDCARD) -lpc21XX.HEADERSINSTALLPATH = $(LIBUC_INC_DIR_SDCARD) - -lpc21XX.LIBS += SSP BLKDEVICE - -lpc21XX.SOURCES += sdcard.c - - -lpc21XX.HEADERS += sdcard.h diff --git a/lib/src/lpc17XX/CORE/core.d b/lib/src/lpc17XX/CORE/core.d deleted file mode 100644 --- a/lib/src/lpc17XX/CORE/core.d +++ /dev/null @@ -1,11 +0,0 @@ -core.o: core.c core.h /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/LPC17xx.h \ - /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/core_cm3.h \ - /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/system_LPC17xx.h - -core.h: - -/opt/libuc2/rules/lpc17XX-arm-noabi-gcc/LPC17xx.h: - -/opt/libuc2/rules/lpc17XX-arm-noabi-gcc/core_cm3.h: - -/opt/libuc2/rules/lpc17XX-arm-noabi-gcc/system_LPC17xx.h: diff --git a/lib/src/lpc17XX/IIC/iic.d b/lib/src/lpc17XX/IIC/iic.d deleted file mode 100644 --- a/lib/src/lpc17XX/IIC/iic.d +++ /dev/null @@ -1,14 +0,0 @@ -iic.o: iic.c iic.h /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/LPC17xx.h \ - /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/core_cm3.h \ - /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/system_LPC17xx.h \ - /opt/libuc2/lib/includes/lpc17XX/CORE/core.h - -iic.h: - -/opt/libuc2/rules/lpc17XX-arm-noabi-gcc/LPC17xx.h: - -/opt/libuc2/rules/lpc17XX-arm-noabi-gcc/core_cm3.h: - -/opt/libuc2/rules/lpc17XX-arm-noabi-gcc/system_LPC17xx.h: - -/opt/libuc2/lib/includes/lpc17XX/CORE/core.h: diff --git a/lib/src/lpc17XX/STRINGS/Makefile b/lib/src/lpc17XX/STRINGS/Makefile deleted file mode 100644 --- a/lib/src/lpc17XX/STRINGS/Makefile +++ /dev/null @@ -1,20 +0,0 @@ - -PROJECTDIR = `pwd` -LIBUC = /opt/libuc2 - -HEADERSINSTALLPATH = $(LIBUC_INC_DIR_UCSTRINGS) -HEADERS += libucstrings.h -LIBSOURCES += libucstrings.c -OBJECTFILES = $(LIBSOURCES:.c=.o) -ARCH = lpc17XX-arm-noabi-gcc -ARCHFOLDER = $(LIBUC)/rules/lpc17XX-arm-noabi-gcc -TARGET=libucstrings -LIBUC_INCLUDES= -LIBUC_LIBRARIES= -TARGETINSTALLPATH=$(LIBUC_LIBS_DIR_UCSTRINGS) -HEADERSINSTALLPATH=$(LIBUC_INC_DIR_UCSTRINGS) -BSP=generic -include $(ARCHFOLDER)/rules.mk - -all:lib - @echo Code compiled diff --git a/lib/src/lpc17XX/STRINGS/libucstrings.c b/lib/src/lpc17XX/STRINGS/libucstrings.c deleted file mode 100644 --- a/lib/src/lpc17XX/STRINGS/libucstrings.c +++ /dev/null @@ -1,318 +0,0 @@ -#/*------------------------------------------------------------------------------ -#-- This file is a part of the libuc, microcontroler library -#-- Copyright (C) 2011, Alexis Jeandet -#-- -#-- This program is free software; you can redistribute it and/or modify -#-- it under the terms of the GNU General Public License as published by -#-- the Free Software Foundation; either version 3 of the License, or -#-- (at your option) any later version. -#-- -#-- This program is distributed in the hope that it will be useful, -#-- but WITHOUT ANY WARRANTY; without even the implied warranty of -#-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#-- GNU General Public License for more details. -#-- -#-- You should have received a copy of the GNU General Public License -#-- along with this program; if not, write to the Free Software -#-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -#------------------------------------------------------------------------------- -#-- Author : Alexis Jeandet -#-- Mail : alexis.jeandet@gmail.com -#-------------------------------------------------------------------------------*/ -#include -#include "libucstrings.h" -extern void consoleputc(char); -extern char consolegetc(); -#define _x_prtconv_(a) printhexfromint((a),39) -#define _X_prtconv_(a) printhexfromint((a),7) -#define _d_prtconv_(a) printdecfromint((a)) - -#define _x_scnconv_() scanintfromhex() -#define _d_scnconv_() scanintfromdec() - -void clearch(char* a) -{ - while((*a)) - *a++=' '; - a--; - *a='\n'; -} - - -int scanintfromdec() -{ - char c[8]=" "; - int e=0; - int result=0; - do - { - c[e] = consolegetc(); - consoleputc(c[e]); - if(((c[e] & 0xF0) == 0x30)) - e++; - }while( (c[e]!='\n') && (e<8)); - libucprintf("\n%d number(s) read\n",e); - int i=0; - while((i9) - { - c[e] = c[e]+caseoffset; - } - c[e] = c[e] + 0x30; - a=a>>4; - e++; - } - while(c[--e]=='0'); - e++; - while(e-->0) - consoleputc(c[e]); -} - - -void printdecfromint(int a) -{ - char c[10]=" "; - int e=0; - int d=a; - if((d & 0x80000000) == 0x80000000) - { - d ^= -1; - d++; - consoleputc('-'); - } - while(d>0 && e<10) - { - c[e++] = 0x30 + (d % 10); - d = d / 10; - } - while(e-->0) - consoleputc(c[e]); -} - -void int2hex(unsigned long a,char*b) -{ - char*d = b; - char c[16]=" "; - int e=0; - while(e<8) - { - c[e] = a & 0xF; - if(c[e]>9) - { - c[e] = c[e]+7; - } - c[e] = c[e] + 0x30; - a=a>>4; - e++; - } - for(e=(e-1);e>=0;e--) - { - *d=c[e]; - d = d +1; - } -} - -/// Partialy implemented printf function capable to compute %d,x,X conversions -int libucprintf(const char* format,...) -{ - int nout=0; - va_list ap; - va_start(ap,format); - while(*format) - { - if(*format!='%') - { - consoleputc(*format++); - nout++; - } - else - { - format++; - if(*format!='%') - { - switch(*format) - { - case 'c': - consoleputc((char)va_arg(ap,int)); - format++; - break; - case 'd': - _d_prtconv_(va_arg(ap,int)) ; - format++; - break; - case 'e': - va_arg(ap,int); - format++; - break; - case 'E': - va_arg(ap,int); - format++; - break; - case 'f': - va_arg(ap,int); - format++; - break; - case 's': - va_arg(ap,int); - format++; - break; - case 'x': - _x_prtconv_(va_arg(ap,int)) ; - format++; - break; - case 'X': - _X_prtconv_(va_arg(ap,int)) ; - format++; - break; - case '%': - consoleputc(*format++); - break; - default: - va_arg(ap,int); - format++; - break; - } - } - else - { - consoleputc(*format++); - nout++; - } - } - } - va_end(ap); - return nout; -} - - -int libucscanf(const char* format,...) -{ - int nin=0; - int* value; - va_list ap; - va_start(ap,format); - while(*format) - { - while(*format!='%')format++; - format++; - libucprintf("find %%%c\n",*format); - switch(*format) - { - case 'c': - va_arg(ap,int*); - format++; - break; - case 'd': - value = (int*)va_arg(ap,int*); - *value=_d_scnconv_() ; - format++; - break; - case 'e': - va_arg(ap,int*); - format++; - break; - case 'E': - va_arg(ap,int*); - format++; - break; - case 'f': - va_arg(ap,int*); - format++; - break; - case 's': - va_arg(ap,int*); - format++; - break; - case 'u': - va_arg(ap,int*); - format++; - break; - case 'x': - value = (int*)va_arg(ap,int*); - *value = _x_scnconv_(); - format++; - break; - case 'X': - value = (int*)va_arg(ap,int*); - *value = _x_scnconv_(); - format++; - break; - default: - va_arg(ap,int*); - format++; - break; - } - - } - va_end(ap); - return nin; -} - - - - - - - - - - - - - - diff --git a/lib/src/lpc17XX/STRINGS/libucstrings.d b/lib/src/lpc17XX/STRINGS/libucstrings.d deleted file mode 100644 --- a/lib/src/lpc17XX/STRINGS/libucstrings.d +++ /dev/null @@ -1,3 +0,0 @@ -libucstrings.o: libucstrings.c libucstrings.h - -libucstrings.h: diff --git a/lib/src/lpc17XX/STRINGS/libucstrings.h b/lib/src/lpc17XX/STRINGS/libucstrings.h deleted file mode 100644 --- a/lib/src/lpc17XX/STRINGS/libucstrings.h +++ /dev/null @@ -1,28 +0,0 @@ -#/*------------------------------------------------------------------------------ -#-- This file is a part of the libuc, microcontroler library -#-- Copyright (C) 2011, Alexis Jeandet -#-- -#-- This program is free software; you can redistribute it and/or modify -#-- it under the terms of the GNU General Public License as published by -#-- the Free Software Foundation; either version 3 of the License, or -#-- (at your option) any later version. -#-- -#-- This program is distributed in the hope that it will be useful, -#-- but WITHOUT ANY WARRANTY; without even the implied warranty of -#-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#-- GNU General Public License for more details. -#-- -#-- You should have received a copy of the GNU General Public License -#-- along with this program; if not, write to the Free Software -#-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -#------------------------------------------------------------------------------- -#-- Author : Alexis Jeandet -#-- Mail : alexis.jeandet@gmail.com -#-------------------------------------------------------------------------------*/ - - - -void clearstr(char* a); -void int2hex(unsigned long a,char*b); -int libucprintf(const char*,...); -int libucscanf(const char*,...); diff --git a/lib/src/lpc17XX/STRINGS/strings.pro b/lib/src/lpc17XX/STRINGS/strings.pro deleted file mode 100644 --- a/lib/src/lpc17XX/STRINGS/strings.pro +++ /dev/null @@ -1,12 +0,0 @@ -TEMPLATE = lib -ARCH = lpc17XX-arm-noabi-gcc -TARGET = libucstrings -TARGETINSTALLPATH = $(LIBUC_LIBS_DIR_UCSTRINGS) -HEADERSINSTALLPATH = $(LIBUC_INC_DIR_UCSTRINGS) - -LIBS += - -SOURCES += libucstrings.c - - -HEADERS += libucstrings.h diff --git a/lib/src/lpc17XX/UART/uart.d b/lib/src/lpc17XX/UART/uart.d deleted file mode 100644 --- a/lib/src/lpc17XX/UART/uart.d +++ /dev/null @@ -1,14 +0,0 @@ -uart.o: uart.c /opt/libuc2/lib/includes/lpc17XX/CORE/core.h \ - /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/LPC17xx.h \ - /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/core_cm3.h \ - /opt/libuc2/rules/lpc17XX-arm-noabi-gcc/system_LPC17xx.h uart.h - -/opt/libuc2/lib/includes/lpc17XX/CORE/core.h: - -/opt/libuc2/rules/lpc17XX-arm-noabi-gcc/LPC17xx.h: - -/opt/libuc2/rules/lpc17XX-arm-noabi-gcc/core_cm3.h: - -/opt/libuc2/rules/lpc17XX-arm-noabi-gcc/system_LPC17xx.h: - -uart.h: diff --git a/rules/common/libsrules.mk b/rules/common/libsrules.mk --- a/rules/common/libsrules.mk +++ b/rules/common/libsrules.mk @@ -2,103 +2,124 @@ # LIBRARY DEFINITIONS #--------------------------------------------------------------------------------- LIBUC_LIBS = -LIBUC_LIBS_CORE = -static -lcore -LIBUC_LIBS_UCSTRINGS = -static -lucstrings -LIBUC_LIBS_UART = -static -luart -LIBUC_LIBS_SPI = -static -lspi -LIBUC_LIBS_SSP = -static -lssp + +LIBUC_LIBS_CORE = -static -lcore +LIBUC_LIBS_DIR_CORE = $(LIBUC_LIBS_DIR)/CORE +LIBUC_LIBS_DIR_CORE_CMD = -L $(LIBUC_LIBS_DIR_CORE) +LIBUC_INC_DIR_CORE = $(LIBUC_INC_DIR)/CORE +LIBUC_INC_DIR_CORE_CMD = -I $(LIBUC_INC_DIR_CORE) + +LIBUC_LIBS_APB = -static -lapb +LIBUC_LIBS_DIR_APB = $(LIBUC_LIBS_DIR)/APB +LIBUC_LIBS_DIR_APB_CMD = -L $(LIBUC_LIBS_DIR_APB) +LIBUC_INC_DIR_APB = $(LIBUC_INC_DIR)/APB +LIBUC_INC_DIR_APB_CMD = -I $(LIBUC_INC_DIR_APB) + +LIBUC_LIBS_UCSTRINGS = -static -lucstrings +LIBUC_LIBS_DIR_UCSTRINGS = $(LIBUC_LIBS_DIR)/STRINGS/$(ARCH) +LIBUC_LIBS_DIR_UCSTRINGS_CMD = -L $(LIBUC_LIBS_DIR_UCSTRINGS) +LIBUC_INC_DIR_UCSTRINGS = $(LIBUC_INC_DIR)/STRINGS/$(ARCH) +LIBUC_INC_DIR_UCSTRINGS_CMD = -I $(LIBUC_INC_DIR_UCSTRINGS) + +LIBUC_LIBS_UART = -static -luart +LIBUC_LIBS_DIR_UART = $(LIBUC_LIBS_DIR)/UART +LIBUC_LIBS_DIR_UART_CMD = -L $(LIBUC_LIBS_DIR_UART) +LIBUC_INC_DIR_UART = $(LIBUC_INC_DIR)/UART +LIBUC_INC_DIR_UART_CMD = -I $(LIBUC_INC_DIR_UART) + +LIBUC_LIBS_SPI = -static -lspi +LIBUC_LIBS_DIR_SPI = $(LIBUC_LIBS_DIR)/SPI +LIBUC_LIBS_DIR_SPI_CMD = -L $(LIBUC_LIBS_DIR_SPI) +LIBUC_INC_DIR_SPI = $(LIBUC_INC_DIR)/SPI +LIBUC_INC_DIR_SPI_CMD = -I $(LIBUC_INC_DIR_SPI) + +LIBUC_LIBS_SSP = -static -lssp +LIBUC_LIBS_DIR_SSP = $(LIBUC_LIBS_DIR)/SSP +LIBUC_LIBS_DIR_SSP_CMD = -L $(LIBUC_LIBS_DIR_SSP) +LIBUC_INC_DIR_SSP = $(LIBUC_INC_DIR)/SSP +LIBUC_INC_DIR_SSP_CMD = -I $(LIBUC_INC_DIR_SSP) + LIBUC_LIBS_IIC = -static -liic +LIBUC_LIBS_DIR_IIC = $(LIBUC_LIBS_DIR)/IIC +LIBUC_LIBS_DIR_IIC_CMD = -L $(LIBUC_LIBS_DIR_IIC) +LIBUC_INC_DIR_IIC = $(LIBUC_INC_DIR)/IIC +LIBUC_INC_DIR_IIC_CMD = -I $(LIBUC_INC_DIR_IIC) + LIBUC_LIBS_ADC = -static -ladc -LIBUC_LIBS_24LC0X = -static -l24lc0X -LIBUC_LIBS_SDCARD = -static -lsdcard -LIBUC_LIBS_BLKDEVICE = -static -lblkdevice -LIBUC_LIBS_FAT32 = -static -lfat32 -LIBUC_LIBS_VS10XX = -static -lvs10XX -LIBUC_LIBS_UHANDLE = -static -luhandle -LIBUC_LIBS_HEXVIEWER = -static -lhexviewer -LIBUC_LIBS_MBR = -static -lmbr -LIBUC_LIBS_UCDIRENT = -static -lucdirent -LIBUC_LIBS_FS = -static -lfs -LIBUC_LIBS_ALLFS = $(LIBUC_LIBS_UCDIRENT) $(LIBUC_LIBS_FS) $(LIBUC_LIBS_MBR) $(LIBUC_LIBS_FAT32) $(LIBUC_LIBS_SDCARD) $(LIBUC_LIBS_BLKDEVICE) -LIBUC_LIBS_FSEXPLORER = -static -lfsexplorer +LIBUC_LIBS_DIR_ADC = $(LIBUC_LIBS_DIR)/ADC +LIBUC_LIBS_DIR_ADC_CMD = -L $(LIBUC_LIBS_DIR_ADC) +LIBUC_INC_DIR_ADC = $(LIBUC_INC_DIR)/ADC +LIBUC_INC_DIR_ADC_CMD = -I $(LIBUC_INC_DIR_ADC) -LIBUC_LIBS_DIR_CORE = $(LIBUC_LIBS_DIR)/CORE -LIBUC_LIBS_DIR_UCSTRINGS = $(LIBUC_LIBS_DIR)/STRINGS/$(ARCH) -LIBUC_LIBS_DIR_UART = $(LIBUC_LIBS_DIR)/UART -LIBUC_LIBS_DIR_SPI = $(LIBUC_LIBS_DIR)/SPI -LIBUC_LIBS_DIR_SSP = $(LIBUC_LIBS_DIR)/SSP -LIBUC_LIBS_DIR_IIC = $(LIBUC_LIBS_DIR)/IIC -LIBUC_LIBS_DIR_ADC = $(LIBUC_LIBS_DIR)/ADC +LIBUC_LIBS_24LC0X = -static -l24lc0X LIBUC_LIBS_DIR_24LC0X = $(LIBUC_LIBS_DIR)/24LCXX/24LC0X -LIBUC_LIBS_DIR_SDCARD = $(LIBUC_LIBS_DIR)/SDCARD -LIBUC_LIBS_DIR_VS10XX = $(LIBUC_LIBS_DIR)/VS10XX -LIBUC_LIBS_DIR_BLKDEVICE = $(LIBUC_LIBS_DIR)/BLKDEVICE -LIBUC_LIBS_DIR_FAT32 = $(LIBUC_LIBS_DIR)/FAT32 -LIBUC_LIBS_DIR_UHANDLE = $(LIBUC_LIBS_DIR)/UHANDLE -LIBUC_LIBS_DIR_HEXVIEWER = $(LIBUC_LIBS_DIR)/HEXVIEWER -LIBUC_LIBS_DIR_MBR = $(LIBUC_LIBS_DIR)/MBR -LIBUC_LIBS_DIR_UCDIRENT = $(LIBUC_LIBS_DIR)/UCDIRENT -LIBUC_LIBS_DIR_FS = $(LIBUC_LIBS_DIR)/FS -LIBUC_LIBS_DIR_FSEXPLORER = $(LIBUC_LIBS_DIR)/FSEXPLORER +LIBUC_LIBS_DIR_24LC0X_CMD = -L $(LIBUC_LIBS_DIR_24LC0X) +LIBUC_INC_DIR_24LC0X = $(LIBUC_INC_DIR)/24LCXX/24LC0X +LIBUC_INC_DIR_24LC0X_CMD = -I $(LIBUC_INC_DIR_24LC0X) -LIBUC_LIBS_DIR_CORE_CMD = -L $(LIBUC_LIBS_DIR_CORE) -LIBUC_LIBS_DIR_UCSTRINGS_CMD = -L $(LIBUC_LIBS_DIR_UCSTRINGS) -LIBUC_LIBS_DIR_UART_CMD = -L $(LIBUC_LIBS_DIR_UART) -LIBUC_LIBS_DIR_SPI_CMD = -L $(LIBUC_LIBS_DIR_SPI) -LIBUC_LIBS_DIR_SSP_CMD = -L $(LIBUC_LIBS_DIR_SSP) -LIBUC_LIBS_DIR_IIC_CMD = -L $(LIBUC_LIBS_DIR_IIC) -LIBUC_LIBS_DIR_ADC_CMD = -L $(LIBUC_LIBS_DIR_ADC) -LIBUC_LIBS_DIR_24LC0X_CMD = -L $(LIBUC_LIBS_DIR_24LC0X) -LIBUC_LIBS_DIR_SDCARD_CMD = -L $(LIBUC_LIBS_DIR_SDCARD) -LIBUC_LIBS_DIR_VS10XX_CMD = -L $(LIBUC_LIBS_DIR_VS10XX) -LIBUC_LIBS_DIR_BLKDEVICE_CMD = -L $(LIBUC_LIBS_DIR_BLKDEVICE) -LIBUC_LIBS_DIR_FAT32_CMD = -L $(LIBUC_LIBS_DIR_FAT32) -LIBUC_LIBS_DIR_UHANDLE_CMD = -L $(LIBUC_LIBS_DIR_UHANDLE) -LIBUC_LIBS_DIR_HEXVIEWER_CMD = -L $(LIBUC_LIBS_DIR_HEXVIEWER) -LIBUC_LIBS_DIR_MBR_CMD = -L $(LIBUC_LIBS_DIR_MBR) -LIBUC_LIBS_DIR_UCDIRENT_CMD = -L $(LIBUC_LIBS_DIR_UCDIRENT) -LIBUC_LIBS_DIR_FS_CMD = -L $(LIBUC_LIBS_DIR_FS) -LIBUC_LIBS_DIR_ALLFS_CMD = $(LIBUC_LIBS_DIR_UCDIRENT_CMD) $(LIBUC_LIBS_DIR_FS_CMD) $(LIBUC_LIBS_DIR_MBR_CMD) $(LIBUC_LIBS_DIR_FAT32_CMD) $(LIBUC_LIBS_DIR_SDCARD_CMD) $(LIBUC_LIBS_DIR_BLKDEVICE_CMD) -LIBUC_LIBS_DIR_FSEXPLORER_CMD = -L $(LIBUC_LIBS_DIR_FSEXPLORER) +LIBUC_LIBS_SDCARD = -static -lsdcard +LIBUC_LIBS_DIR_SDCARD = $(LIBUC_LIBS_DIR)/SDCARD +LIBUC_LIBS_DIR_SDCARD_CMD = -L $(LIBUC_LIBS_DIR_SDCARD) +LIBUC_INC_DIR_SDCARD = $(LIBUC_INC_DIR)/SDCARD +LIBUC_INC_DIR_SDCARD_CMD = -I $(LIBUC_INC_DIR_SDCARD) + +LIBUC_LIBS_VS10XX = -static -lvs10XX +LIBUC_LIBS_DIR_VS10XX = $(LIBUC_LIBS_DIR)/VS10XX +LIBUC_LIBS_DIR_VS10XX_CMD = -L $(LIBUC_LIBS_DIR_VS10XX) +LIBUC_INC_DIR_VS10XX = $(LIBUC_INC_DIR)/VS10XX +LIBUC_INC_DIR_VS10XX_CMD = -I $(LIBUC_INC_DIR_VS10XX) + +LIBUC_LIBS_BLKDEVICE = -static -lblkdevice +LIBUC_LIBS_DIR_BLKDEVICE = $(LIBUC_LIBS_DIR)/BLKDEVICE +LIBUC_LIBS_DIR_BLKDEVICE_CMD = -L $(LIBUC_LIBS_DIR_BLKDEVICE) +LIBUC_INC_DIR_BLKDEVICE = $(LIBUC_INC_DIR)/BLKDEVICE +LIBUC_INC_DIR_BLKDEVICE_CMD = -I $(LIBUC_INC_DIR_BLKDEVICE) + +LIBUC_LIBS_FAT32 = -static -lfat32 +LIBUC_LIBS_DIR_FAT32 = $(LIBUC_LIBS_DIR)/FAT32 +LIBUC_LIBS_DIR_FAT32_CMD = -L $(LIBUC_LIBS_DIR_FAT32) +LIBUC_INC_DIR_FAT32 = $(LIBUC_INC_DIR)/FAT32 +LIBUC_INC_DIR_FAT32_CMD = -I $(LIBUC_INC_DIR_FAT32) + +LIBUC_LIBS_UHANDLE = -static -luhandle +LIBUC_LIBS_DIR_UHANDLE = $(LIBUC_LIBS_DIR)/UHANDLE +LIBUC_LIBS_DIR_UHANDLE_CMD = -L $(LIBUC_LIBS_DIR_UHANDLE) +LIBUC_INC_DIR_UHANDLE = $(LIBUC_INC_DIR)/UHANDLE +LIBUC_INC_DIR_UHANDLE_CMD = -I $(LIBUC_INC_DIR_UHANDLE) -LIBUC_INC_DIR_CORE = $(LIBUC_INC_DIR)/CORE -LIBUC_INC_DIR_UCSTRINGS = $(LIBUC_INC_DIR)/STRINGS/$(ARCH) -LIBUC_INC_DIR_UART = $(LIBUC_INC_DIR)/UART -LIBUC_INC_DIR_SPI = $(LIBUC_INC_DIR)/SPI -LIBUC_INC_DIR_SSP = $(LIBUC_INC_DIR)/SSP -LIBUC_INC_DIR_IIC = $(LIBUC_INC_DIR)/IIC -LIBUC_INC_DIR_ADC = $(LIBUC_INC_DIR)/ADC -LIBUC_INC_DIR_24LC0X = $(LIBUC_INC_DIR)/24LCXX/24LC0X -LIBUC_INC_DIR_SDCARD = $(LIBUC_INC_DIR)/SDCARD -LIBUC_INC_DIR_VS10XX = $(LIBUC_INC_DIR)/VS10XX -LIBUC_INC_DIR_BLKDEVICE = $(LIBUC_INC_DIR)/BLKDEVICE -LIBUC_INC_DIR_FAT32 = $(LIBUC_INC_DIR)/FAT32 -LIBUC_INC_DIR_UHANDLE = $(LIBUC_INC_DIR)/UHANDLE -LIBUC_INC_DIR_HEXVIEWER = $(LIBUC_INC_DIR)/HEXVIEWER -LIBUC_INC_DIR_MBR = $(LIBUC_INC_DIR)/MBR -LIBUC_INC_DIR_UCDIRENT = $(LIBUC_INC_DIR)/UCDIRENT -LIBUC_INC_DIR_FS = $(LIBUC_INC_DIR)/FS -LIBUC_INC_DIR_FSEXPLORER = $(LIBUC_INC_DIR)/FSEXPLORER +LIBUC_LIBS_HEXVIEWER = -static -lhexviewer +LIBUC_LIBS_DIR_HEXVIEWER = $(LIBUC_LIBS_DIR)/HEXVIEWER +LIBUC_LIBS_DIR_HEXVIEWER_CMD = -L $(LIBUC_LIBS_DIR_HEXVIEWER) +LIBUC_INC_DIR_HEXVIEWER = $(LIBUC_INC_DIR)/HEXVIEWER +LIBUC_INC_DIR_HEXVIEWER_CMD = -I $(LIBUC_INC_DIR_HEXVIEWER) + +LIBUC_LIBS_MBR = -static -lmbr +LIBUC_LIBS_DIR_MBR = $(LIBUC_LIBS_DIR)/MBR +LIBUC_LIBS_DIR_MBR_CMD = -L $(LIBUC_LIBS_DIR_MBR) +LIBUC_INC_DIR_MBR = $(LIBUC_INC_DIR)/MBR +LIBUC_INC_DIR_MBR_CMD = -I $(LIBUC_INC_DIR_MBR) -LIBUC_INC_DIR_CORE_CMD = -I $(LIBUC_INC_DIR_CORE) -LIBUC_INC_DIR_UCSTRINGS_CMD = -I $(LIBUC_INC_DIR_UCSTRINGS) -LIBUC_INC_DIR_UART_CMD = -I $(LIBUC_INC_DIR_UART) -LIBUC_INC_DIR_SPI_CMD = -I $(LIBUC_INC_DIR_SPI) -LIBUC_INC_DIR_SSP_CMD = -I $(LIBUC_INC_DIR_SSP) -LIBUC_INC_DIR_IIC_CMD = -I $(LIBUC_INC_DIR_IIC) -LIBUC_INC_DIR_ADC_CMD = -I $(LIBUC_INC_DIR_ADC) -LIBUC_INC_DIR_24LC0X_CMD = -I $(LIBUC_INC_DIR_24LC0X) -LIBUC_INC_DIR_SDCARD_CMD = -I $(LIBUC_INC_DIR_SDCARD) -LIBUC_INC_DIR_VS10XX_CMD = -I $(LIBUC_INC_DIR_VS10XX) -LIBUC_INC_DIR_BLKDEVICE_CMD = -I $(LIBUC_INC_DIR_BLKDEVICE) -LIBUC_INC_DIR_FAT32_CMD = -I $(LIBUC_INC_DIR_FAT32) -LIBUC_INC_DIR_UHANDLE_CMD = -I $(LIBUC_INC_DIR_UHANDLE) -LIBUC_INC_DIR_HEXVIEWER_CMD = -I $(LIBUC_INC_DIR_HEXVIEWER) -LIBUC_INC_DIR_MBR_CMD = -I $(LIBUC_INC_DIR_MBR) -LIBUC_INC_DIR_UCDIRENT_CMD = -I $(LIBUC_INC_DIR_UCDIRENT) -LIBUC_INC_DIR_FS_CMD = -I $(LIBUC_INC_DIR_FS) -LIBUC_INC_DIR_ALLFS_CMD = $(LIBUC_INC_DIR_UCDIRENT_CMD) $(LIBUC_INC_DIR_FS_CMD) $(LIBUC_INC_DIR_MBR_CMD) $(LIBUC_INC_DIR_FAT32_CMD) $(LIBUC_INC_DIR_SDCARD_CMD) $(LIBUC_INC_DIR_BLKDEVICE_CMD) -LIBUC_INC_DIR_FSEXPLORER_CMD = -I $(LIBUC_INC_DIR_FSEXPLORER) +LIBUC_LIBS_UCDIRENT = -static -lucdirent +LIBUC_LIBS_DIR_UCDIRENT = $(LIBUC_LIBS_DIR)/UCDIRENT +LIBUC_LIBS_DIR_UCDIRENT_CMD = -L $(LIBUC_LIBS_DIR_UCDIRENT) +LIBUC_INC_DIR_UCDIRENT = $(LIBUC_INC_DIR)/UCDIRENT +LIBUC_INC_DIR_UCDIRENT_CMD = -I $(LIBUC_INC_DIR_UCDIRENT) + +LIBUC_LIBS_FS = -static -lfs +LIBUC_LIBS_DIR_FS = $(LIBUC_LIBS_DIR)/FS +LIBUC_LIBS_DIR_FS_CMD = -L $(LIBUC_LIBS_DIR_FS) +LIBUC_INC_DIR_FS = $(LIBUC_INC_DIR)/FS +LIBUC_INC_DIR_FS_CMD = -I $(LIBUC_INC_DIR_FS) + +LIBUC_LIBS_FSEXPLORER = -static -lfsexplorer +LIBUC_LIBS_DIR_FSEXPLORER = $(LIBUC_LIBS_DIR)/FSEXPLORER +LIBUC_LIBS_DIR_FSEXPLORER_CMD = -L $(LIBUC_LIBS_DIR_FSEXPLORER) +LIBUC_INC_DIR_FSEXPLORER = $(LIBUC_INC_DIR)/FSEXPLORER +LIBUC_INC_DIR_FSEXPLORER_CMD = -I $(LIBUC_INC_DIR_FSEXPLORER) + +LIBUC_LIBS_DIR_ALLFS_CMD = $(LIBUC_LIBS_DIR_UCDIRENT_CMD) $(LIBUC_LIBS_DIR_FS_CMD) $(LIBUC_LIBS_DIR_MBR_CMD) $(LIBUC_LIBS_DIR_FAT32_CMD) $(LIBUC_LIBS_DIR_SDCARD_CMD) $(LIBUC_LIBS_DIR_BLKDEVICE_CMD) +LIBUC_INC_DIR_ALLFS_CMD = $(LIBUC_INC_DIR_UCDIRENT_CMD) $(LIBUC_INC_DIR_FS_CMD) $(LIBUC_INC_DIR_MBR_CMD) $(LIBUC_INC_DIR_FAT32_CMD) $(LIBUC_INC_DIR_SDCARD_CMD) $(LIBUC_INC_DIR_BLKDEVICE_CMD) +LIBUC_LIBS_ALLFS = $(LIBUC_LIBS_UCDIRENT) $(LIBUC_LIBS_FS) $(LIBUC_LIBS_MBR) $(LIBUC_LIBS_FAT32) $(LIBUC_LIBS_SDCARD) $(LIBUC_LIBS_BLKDEVICE) @@ -110,3 +131,21 @@ LIBUC_INC_DIR_FSEXPLORER_CMD = -I $(LI + + + + + + + + + + + + + + + + + + diff --git a/rules/lpc17XX-arm-noabi-gcc/LPC17xx.ld b/rules/lpc17XX-arm-noabi-gcc/LPC17xx.ld --- a/rules/lpc17XX-arm-noabi-gcc/LPC17xx.ld +++ b/rules/lpc17XX-arm-noabi-gcc/LPC17xx.ld @@ -45,6 +45,15 @@ SECTIONS *(.rodata .rodata*) *(.gnu.linkonce.r.*) } >IROM + .testData : + { + _sitestdata = LOADADDR (.testData); + . = ALIGN(4); + _stestdata = .; + *(.testData .testData.*) + . = ALIGN(4); + _etestdata = . ; + } >IRAM1 AT >IROM /******************************************/ /* .ctors .dtors are used for c++ constructors/destructors */ diff --git a/rules/lpc17XX-arm-noabi-gcc/startup_LPC17xx.c b/rules/lpc17XX-arm-noabi-gcc/startup_LPC17xx.c --- a/rules/lpc17XX-arm-noabi-gcc/startup_LPC17xx.c +++ b/rules/lpc17XX-arm-noabi-gcc/startup_LPC17xx.c @@ -85,6 +85,10 @@ extern unsigned long _etext; extern unsigned long _sidata; /* start address for the initialization values of the .data section. defined in linker script */ extern unsigned long _sdata; /* start address for the .data section. defined in linker script */ extern unsigned long _edata; /* end address for the .data section. defined in linker script */ +extern unsigned long _sitestdata; /* start address for the initialization values of the .data section. defined in linker script */ +extern unsigned long _stestdata; /* start address for the .data section. defined in linker script */ +extern unsigned long _etestdata; + extern unsigned long _sifastcode; /* start address for the initialization values of the .fastcode section. defined in linker script */ extern unsigned long _sfastcode; /* start address for the .fastcode section. defined in linker script */ @@ -199,6 +203,12 @@ void Reset_Handler(void) *(pulDest++) = *(pulSrc++); } } + if (&_sitestdata != &_stestdata) { // only if needed + pulSrc = &_sitestdata; + for(pulDest = &_stestdata; pulDest < &_etestdata; ) { + *(pulDest++) = *(pulSrc++); + } + } // Copy the .fastcode code from ROM to SRAM diff --git a/rules/lpc21XX-arm-elf-gcc/rules.mk b/rules/lpc21XX-arm-elf-gcc/rules.mk deleted file mode 100644 diff --git a/rules/sparc-elf-gcc/rules.mk b/rules/sparc-elf-gcc/rules.mk --- a/rules/sparc-elf-gcc/rules.mk +++ b/rules/sparc-elf-gcc/rules.mk @@ -1,92 +1,156 @@ -#/*------------------------------------------------------------------------------ -#-- This file is a part of the libuc, microcontroler library -#-- Copyright (C) 2011, Alexis Jeandet -#-- -#-- This program is free software; you can redistribute it and/or modify -#-- it under the terms of the GNU General Public License as published by -#-- the Free Software Foundation; either version 3 of the License, or -#-- (at your option) any later version. -#-- -#-- This program is distributed in the hope that it will be useful, -#-- but WITHOUT ANY WARRANTY; without even the implied warranty of -#-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#-- GNU General Public License for more details. -#-- -#-- You should have received a copy of the GNU General Public License -#-- along with this program; if not, write to the Free Software -#-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -#------------------------------------------------------------------------------- -#-- Author : Alexis Jeandet -#-- Mail : alexis.jeandet@gmail.com -#-------------------------------------------------------------------------------*/ - -#--------------------------------------------------------------------------------- -# GCC EXECUTABLES -#--------------------------------------------------------------------------------- -LIBUC_PREFIX = sparc-elf- -LIBUC_CC = $(LIBUC_PREFIX)gcc -LIBUC_CXX = $(LIBUC_PREFIX)g++ -LIBUC_AR = $(LIBUC_PREFIX)ar -LIBUC_SIZE = $(LIBUC_PREFIX)size -LIBUC_READELF = $(LIBUC_PREFIX)readelf -LIBUC_OBJCOPY=$(LIBUC_PREFIX)objcopy - - - -#--------------------------------------------------------------------------------- -# GCC FLAGS -#--------------------------------------------------------------------------------- -LIBUC_FMCU = -LIBUC_CFLAGS = $(LIBUC_FMCU) -LIBUC_CFLAGS_WARN_ON = -Wall -LIBUC_CFLAGS_WARN_OFF = -w -LIBUC_CFLAGS_RELEASE = -O2 -LIBUC_CFLAGS_DEBUG = -g -LIBUC_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -g -LIBUC_CFLAGS_STATIC_LIB += -fPIC -LIBUC_CFLAGS_SOFT_FPU = -msoft-float -LIBUC_CFLAGS_HARD_FPU = - -LIBUC_CXXFLAGS = $(LIBUC_FMCU) -LIBUC_CXXFLAGS_WARN_ON = -Wall -LIBUC_CXXFLAGS_WARN_OFF = -w -LIBUC_CXXFLAGS_RELEASE = -O2 -LIBUC_CXXFLAGS_DEBUG = -g -LIBUC_CXXFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -g -LIBUC_CXXFLAGS_STATIC_LIB = -fPIC -LIBUC_CXXFLAGS_SOFT_FPU = -msoft-float -LIBUC_CXXFLAGS_HARD_FPU = - -LIBUC_LIBS = -LIBUC_LIBS_UART = -luart -LIBUC_LIBS_SPI = -lspi -LIBUC_LIBS_IIC = -liic -LIBUC_LIBS_ADC = -ladc -LIBUC_LIBS_APB = -ladc - -LIBUC_LIBS_DIR = $(LIBUC)/lib/bin/LEON3 -LIBUC_LIBS_DIR_UART = -L $(LIBUC_LIBS_DIR)/UART -LIBUC_LIBS_DIR_SPI = -L $(LIBUC_LIBS_DIR)/SPI -LIBUC_LIBS_DIR_IIC = -L $(LIBUC_LIBS_DIR)/IIC -LIBUC_LIBS_DIR_ADC = -L $(LIBUC_LIBS_DIR)/ADC -LIBUC_LIBS_DIR_APB = -L $(LIBUC_LIBS_DIR)/APB - - -LIBUC_INC_DIR = $(LIBUC)/lib/includes/LEON -LIBUC_INC_DIR_UART = -L $(LIBUC_INC_DIR)/UART -LIBUC_INC_DIR_SPI = -L $(LIBUC_INC_DIR)/SPI -LIBUC_INC_DIR_IIC = -L $(LIBUC_INC_DIR)/IIC -LIBUC_INC_DIR_ADC = -L $(LIBUC_INC_DIR)/ADC -LIBUC_INC_DIR_APB = -L $(LIBUC_INC_DIR)/APB - - - - - - - - - - - - +#/*------------------------------------------------------------------------------ +#-- This file is a part of the libuc, microcontroler library +#-- Copyright (C) 2011, Alexis Jeandet +#-- +#-- This program is free software; you can redistribute it and/or modify +#-- it under the terms of the GNU General Public License as published by +#-- the Free Software Foundation; either version 3 of the License, or +#-- (at your option) any later version. +#-- +#-- This program is distributed in the hope that it will be useful, +#-- but WITHOUT ANY WARRANTY; without even the implied warranty of +#-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#-- GNU General Public License for more details. +#-- +#-- You should have received a copy of the GNU General Public License +#-- along with this program; if not, write to the Free Software +#-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +#------------------------------------------------------------------------------- +#-- Author : Alexis Jeandet +#-- Mail : alexis.jeandet@gmail.com +#-------------------------------------------------------------------------------*/ + +#--------------------------------------------------------------------------------- +# GCC EXECUTABLES +#--------------------------------------------------------------------------------- +LIBUC_PREFIX = sparc-elf- +LIBUC_CC = $(LIBUC_PREFIX)gcc +LIBUC_CXX = $(LIBUC_PREFIX)g++ +LIBUC_AR = $(LIBUC_PREFIX)ar +LIBUC_AS = $(LIBUC_PREFIX)as +LIBUC_LD = $(LIBUC_PREFIX)ld +LIBUC_SIZE = $(LIBUC_PREFIX)size +LIBUC_STRIP = $(LIBUC_PREFIX)strip -s +LIBUC_READELF = $(LIBUC_PREFIX)readelf +LIBUC_OBJCOPY=$(LIBUC_PREFIX)objcopy +LIBUC_OBJDUMP=$(LIBUC_PREFIX)objdump + + + +#--------------------------------------------------------------------------------- +# GCC FLAGS +#--------------------------------------------------------------------------------- +LIBUC_FMCU = +LIBUC_CFLAGS = $(LIBUC_FMCU) +LIBUC_CFLAGS = --std=gnu99 -fgnu89-inline +LIBUC_CFLAGS += +LIBUC_LDFLAGS = +LIBUC_ODFLAGS = -x --syms +LIBUC_CPFLAGS = +LIBUC_CFLAGS_WARN_ON = -Wall +LIBUC_CFLAGS_WARN_OFF = -w +LIBUC_CFLAGS_RELEASE = -O2 +LIBUC_CFLAGS_DEBUG = -g +LIBUC_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -g +LIBUC_CFLAGS_STATIC_LIB = -fPIC +LIBUC_CFLAGS_SOFT_FPU = -msoft-float +LIBUC_CFLAGS_HARD_FPU = + +LIBUC_CXXFLAGS = $(LIBUC_FMCU) +LIBUC_CXXFLAGS += -g -gdwarf-2 +LIBUC_CXXFLAGS += -Wextra -Wundef -Wcast-align -msoft-float +LIBUC_CXXFLAGS_WARN_ON = -Wall +LIBUC_CXXFLAGS_WARN_OFF = -w +LIBUC_CXXFLAGS_RELEASE = -O2 +LIBUC_CXXFLAGS_DEBUG = -g +LIBUC_CXXFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -g +LIBUC_CXXFLAGS_STATIC_LIB = -fPIC +LIBUC_CXXFLAGS_SOFT_FPU = -msoft-float +LIBUC_CXXFLAGS_HARD_FPU = + +#--------------------------------------------------------------------------------- +# LIBRARY DEFINITIONS +#--------------------------------------------------------------------------------- + +LIBUC_LIBS_DIR = $(LIBUC)/lib/bin/LEON3 +LIBUC_INC_DIR = $(LIBUC)/lib/includes/LEON3 +include $(LIBUC)/rules/common/libsrules.mk + +#--------------------------------------------------------------------------------- +# BOARD SUPORT PACKAGES +#--------------------------------------------------------------------------------- +LIBUC_BSP_DIR=$(LIBUC)/bsp +LIBUC_BSP_BIN_DIR= $(LIBUC_BSP_DIR)/bin +LIBUC_BSP_INC_DIR= $(LIBUC_BSP_DIR)/includes +LIBUC_BSP = -L $(LIBUC_BSP_BIN_DIR)/$(BSP) -static -lbsp +LIBUC_BSP_INC = -I $(LIBUC_BSP_INC_DIR)/$(BSP) +#--------------------------------------------------------------------------------- +# DEVICE SPECIAL FILES +#--------------------------------------------------------------------------------- + + + +#--------------------------------------------------------------------------------- +# RULES +#--------------------------------------------------------------------------------- + +all: + @echo "sparc-elf-gcc rules" + + +bin: $(BINDIR)/$(TARGET).bin $(BINDIR)/$(TARGET).hex + @echo "compile bin" + + + +lib: $(TARGETINSTALLPATH)/$(TARGET).a + @echo "compile lib" + +%.a: $(OBJECTFILES) + mkdir -p $(TARGETINSTALLPATH) + mkdir -p $(HEADERSINSTALLPATH) + $(LIBUC_AR) rcs $@ $(OBJECTFILES) #$(LIBUC_AR) rcs $(TARGETINSTALLPATH)/$@ $(OBJECTFILES) + cp -f $(HEADERS) $(HEADERSINSTALLPATH)/ + + + +$(OBJECTFILES) : $(OBJDIR)/%.o : %.c $(INC_LIBS_DEPS) $(HEADERS) + mkdir -p $(OBJDIR) + $(LIBUC_CC) -O3 -I $(LIBUC_INCLUDES) $(LIBUC_BSP_INC) -c $(LIBUC_CFLAGS) $< -o $@ + + +%.elf: $(OBJECTFILES) + mkdir -p $(BINDIR) + $(LIBUC_CC) $(LIBUC_LDFLAGS) $^ -o $@ $(LIBUC_BSP) $(LIBUC_LIBRARIES) + + +%.bin: %.elf $(BIN_LIBS_DEPS) + $(LIBUC_OBJCOPY) $(LIBUC_CPFLAGS) -O binary $< $*.bin + + +%.hex: %.elf + $(LIBUC_OBJCOPY) $(LIBUC_CPFLAGS) -O ihex $< $*.hex + + +clean: + rm -f *.o *.d *.bin *.hex *.dump *.map *.a + rm -f $(OBJECTFILES) + rm -f $(BINDIR)/*.bin + rm -f $(BINDIR)/*.hex + rm -f $(BINDIR)/*.dump + rm -f $(BINDIR)/*.map + rm -f $(BINDIR)/*.a + rm -f $(DEVSOURCESND) + +distclean: + rm -f $(TARGETINSTALLPATH)/*.bin + rm -f $(TARGETINSTALLPATH)/*.a + + + + + + + + +