Initial import, Timer v3.0

Fri, 13 Aug 2010 10:49:23 +0100

author
Philip Pemberton <philpem@philpem.me.uk>
date
Fri, 13 Aug 2010 10:49:23 +0100
changeset 0
396b0bd970d3
child 1
85c1144140c3

Initial import, Timer v3.0

document/ds_icon.jpg file | annotate | diff | revisions
document/ds_icon_ast.jpg file | annotate | diff | revisions
document/dsb_icon.jpg file | annotate | diff | revisions
document/lever40.css file | annotate | diff | revisions
document/lever40_ns.css file | annotate | diff | revisions
document/qm_icon.jpg file | annotate | diff | revisions
document/timer.htm file | annotate | diff | revisions
document/timer.pdf file | annotate | diff | revisions
drivers/device/MicoTimer.c file | annotate | diff | revisions
drivers/device/MicoTimer.h file | annotate | diff | revisions
drivers/peripheral.mk file | annotate | diff | revisions
drivers/service/MicoTimerService.c file | annotate | diff | revisions
drivers/service/MicoTimerService.h file | annotate | diff | revisions
rtl/verilog/timer.v file | annotate | diff | revisions
timer.xml file | annotate | diff | revisions
     1.1 diff -r 000000000000 -r 396b0bd970d3 document/ds_icon.jpg
     1.2 Binary file document/ds_icon.jpg has changed
     2.1 diff -r 000000000000 -r 396b0bd970d3 document/ds_icon_ast.jpg
     2.2 Binary file document/ds_icon_ast.jpg has changed
     3.1 diff -r 000000000000 -r 396b0bd970d3 document/dsb_icon.jpg
     3.2 Binary file document/dsb_icon.jpg has changed
     4.1 diff -r 000000000000 -r 396b0bd970d3 document/lever40.css
     4.2 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 +++ b/document/lever40.css	Fri Aug 13 10:49:23 2010 +0100
     4.4 @@ -0,0 +1,245 @@
     4.5 +H1 { 
     4.6 +    font-weight:bold; 
     4.7 +    border-top-style:none; 
     4.8 +    font-family:Arial, helvetica, sans-serif; 
     4.9 +    color:#ea6d23; 
    4.10 +    margin-left:15px; 
    4.11 +    margin-top:3px; 
    4.12 +    margin-bottom:10px; 
    4.13 +    border-bottom-style:Solid; 
    4.14 +    border-bottom-width:2px; 
    4.15 +    border-bottom-color:#dbdbdb; 
    4.16 +    margin-right:0px; 
    4.17 +    line-height:Normal; 
    4.18 +    font-size:1em;  }
    4.19 +LI.kadov-H1 { 
    4.20 +             font-weight:bold; 
    4.21 +             font-family:Arial, helvetica, sans-serif; 
    4.22 +             color:#ea6d23; 
    4.23 +             line-height:Normal; 
    4.24 +             font-size:1em;  }
    4.25 +H2 { 
    4.26 +    font-weight:bold; 
    4.27 +    x-text-underline:Off; 
    4.28 +    border-top-style:none; 
    4.29 +    border-bottom-style:none; 
    4.30 +    font-family:Arial, helvetica, sans-serif; 
    4.31 +    color:#ea6d23; 
    4.32 +    margin-left:15px; 
    4.33 +    margin-top:12px; 
    4.34 +    margin-bottom:5px; 
    4.35 +    font-size:0.84em; 
    4.36 +    margin-right:0px; 
    4.37 +    text-decoration:none;  }
    4.38 +LI.kadov-H2 { 
    4.39 +             font-weight:bold; 
    4.40 +             x-text-underline:Off; 
    4.41 +             font-family:Arial, helvetica, sans-serif; 
    4.42 +             color:#ea6d23; 
    4.43 +             font-size:0.84em; 
    4.44 +             text-decoration:none;  }
    4.45 +P { 
    4.46 +   margin-top:0pt; 
    4.47 +   font-family:Verdana, Arial, helvetica, sans-serif; 
    4.48 +   color:#323232; 
    4.49 +   font-size:71%; 
    4.50 +   margin-bottom:8px; 
    4.51 +   line-height:1.4em; 
    4.52 +   margin-right:0px; 
    4.53 +   margin-left:15px;  }
    4.54 +LI.kadov-P { 
    4.55 +            font-family:Verdana, Arial, helvetica, sans-serif; 
    4.56 +            color:#323232; 
    4.57 +            font-size:71%; 
    4.58 +            line-height:1.4em;  }
    4.59 +p.Step { 
    4.60 +        list-style:decimal; 
    4.61 +        margin-left:0px; 
    4.62 +        font-size:100%; 
    4.63 +        margin-bottom:7px; 
    4.64 +        margin-top:0px;  }
    4.65 +LI.kadov-p-CStep { 
    4.66 +                  list-style:decimal; 
    4.67 +                  font-size:100%;  }
    4.68 +P.Bullet { 
    4.69 +          font-size:100%; 
    4.70 +          list-style:url("image/top-bullet.gif"); 
    4.71 +          margin-bottom:7px; 
    4.72 +          margin-left:0px; 
    4.73 +          margin-top:0px;  }
    4.74 +LI.kadov-P-CBullet { 
    4.75 +                    font-size:100%; 
    4.76 +                    list-style:url("image/top-bullet.gif");  }
    4.77 +P.NormalIndent { 
    4.78 +                margin-left:40px;  }
    4.79 +LI.kadov-P-CNormalIndent {  }
    4.80 +P.BulletIndent { 
    4.81 +                margin-bottom:2px; 
    4.82 +                font-size:100%; 
    4.83 +                margin-left:15pt; 
    4.84 +                list-style:url("image/secondary-bullet.gif");  }
    4.85 +LI.kadov-P-CBulletIndent { 
    4.86 +                          font-size:100%; 
    4.87 +                          list-style:url("image/secondary-bullet.gif");  }
    4.88 +P.Procedure { 
    4.89 +             font-style:italic; 
    4.90 +             font-weight:normal; 
    4.91 +             x-next-class:Step; 
    4.92 +             x-next-type:p; 
    4.93 +             margin-top:12pt; 
    4.94 +             margin-bottom:5px;  }
    4.95 +LI.kadov-P-CProcedure { 
    4.96 +                       font-style:italic; 
    4.97 +                       font-weight:normal;  }
    4.98 +P.Note { 
    4.99 +        margin-top:8pt; 
   4.100 +        margin-bottom:8pt; 
   4.101 +        border-top-style:Solid; 
   4.102 +        border-bottom-style:Solid; 
   4.103 +        padding-top:4px; 
   4.104 +        padding-bottom:4px; 
   4.105 +        border-top-width:1px; 
   4.106 +        border-bottom-width:1px; 
   4.107 +        background-color:#ffffff;  }
   4.108 +LI.kadov-P-CNote {  }
   4.109 +P.NoteIndent { 
   4.110 +              margin-top:8pt; 
   4.111 +              margin-bottom:8pt; 
   4.112 +              border-top-style:Solid; 
   4.113 +              border-bottom-style:Solid; 
   4.114 +              padding-top:4px; 
   4.115 +              padding-bottom:4px; 
   4.116 +              border-top-width:1px; 
   4.117 +              border-bottom-width:1px; 
   4.118 +              background-color:#ffffff; 
   4.119 +              margin-left:40px;  }
   4.120 +LI.kadov-P-CNoteIndent {  }
   4.121 +P.Table { 
   4.122 +         margin-top:4px; 
   4.123 +         margin-bottom:4px; 
   4.124 +         margin-right:4px; 
   4.125 +         margin-left:4px;  }
   4.126 +LI.kadov-P-CTable {  }
   4.127 +P.Code { 
   4.128 +        margin-bottom:0px; 
   4.129 +        line-height:Normal; 
   4.130 +        font-family:"Courier New"  , Courier, monospace;  }
   4.131 +LI.kadov-P-CCode { 
   4.132 +                  line-height:Normal; 
   4.133 +                  font-family:"Courier New"  , Courier, monospace;  }
   4.134 +P.StepBulletFirst { 
   4.135 +                   font-size:100%; 
   4.136 +                   margin-left:15px; 
   4.137 +                   margin-bottom:2px; 
   4.138 +                   list-style:url("image/secondary-bullet.gif");  }
   4.139 +LI.kadov-P-CStepBulletFirst { 
   4.140 +                             font-size:100%; 
   4.141 +                             list-style:url("image/secondary-bullet.gif");  }
   4.142 +BODY { 
   4.143 +      background-color:#ffffff; 
   4.144 +      color:#000080; 
   4.145 +      font-family:Arial, sans-serif;  }
   4.146 +P.SeeAlso { 
   4.147 +           font-weight:bold; 
   4.148 +           font-style:normal; 
   4.149 +           x-next-type:P; 
   4.150 +           color:#ea6d23; 
   4.151 +           font-family:Arial, helvetica, sans-serif; 
   4.152 +           margin-left:15px; 
   4.153 +           margin-top:12px; 
   4.154 +           margin-bottom:5px; 
   4.155 +           font-size:0.84em;  }
   4.156 +LI.kadov-P-CSeeAlso { 
   4.157 +                     font-weight:bold; 
   4.158 +                     font-style:normal; 
   4.159 +                     color:#ea6d23; 
   4.160 +                     font-family:Arial, helvetica, sans-serif; 
   4.161 +                     font-size:0.84em;  }
   4.162 +A:link { 
   4.163 +        font-weight:bold; 
   4.164 +        font-style:normal; 
   4.165 +        color:#003a98; 
   4.166 +        x-text-underline:Off; 
   4.167 +        text-decoration:none;  }
   4.168 +A:hover { 
   4.169 +         x-text-underline:Normal; 
   4.170 +         color:#59add3; 
   4.171 +         text-decoration:underline;  }
   4.172 +A:active { 
   4.173 +          color:#59add3;  }
   4.174 +A:visited { 
   4.175 +           x-text-underline:Off; 
   4.176 +           color:#385689; 
   4.177 +           font-weight:bold; 
   4.178 +           font-style:normal; 
   4.179 +           text-decoration:none;  }
   4.180 +H1.Home { 
   4.181 +         x-next-type:P; 
   4.182 +         border-top-style:none; 
   4.183 +         border-bottom-style:none; 
   4.184 +         x-text-underline:Off; 
   4.185 +         font-size:15pt; 
   4.186 +         color:#ea6d23; 
   4.187 +         text-decoration:none;  }
   4.188 +LI.kadov-H1-CHome { 
   4.189 +                   x-text-underline:Off; 
   4.190 +                   font-size:15pt; 
   4.191 +                   color:#ea6d23; 
   4.192 +                   text-decoration:none;  }
   4.193 +H3 { 
   4.194 +    margin-left:15px; 
   4.195 +    margin-top:12px; 
   4.196 +    margin-bottom:5px; 
   4.197 +    color:#323232; 
   4.198 +    font-size:71%; 
   4.199 +    font-family:Verdana, Arial, helvetica, sans-serif; 
   4.200 +    margin-right:0px;  }
   4.201 +LI.kadov-H3 { 
   4.202 +             color:#323232; 
   4.203 +             font-size:71%; 
   4.204 +             font-family:Verdana, Arial, helvetica, sans-serif;  }
   4.205 +P.Title { 
   4.206 +         font-weight:bold; 
   4.207 +         font-style:normal; 
   4.208 +         x-next-type:P; 
   4.209 +         font-family:Arial, helvetica, sans-serif; 
   4.210 +         color:#ea6d23; 
   4.211 +         margin-bottom:10px; 
   4.212 +         font-size:1.4em; 
   4.213 +         line-height:Normal; 
   4.214 +         border-bottom-style:Solid; 
   4.215 +         border-bottom-width:2px; 
   4.216 +         border-bottom-color:#dbdbdb; 
   4.217 +         margin-top:0px;  }
   4.218 +LI.kadov-P-CTitle { 
   4.219 +                   font-weight:bold; 
   4.220 +                   font-style:normal; 
   4.221 +                   font-family:Arial, helvetica, sans-serif; 
   4.222 +                   color:#ea6d23; 
   4.223 +                   font-size:1.4em; 
   4.224 +                   line-height:Normal;  }
   4.225 +P.Supra { 
   4.226 +         font-weight:bold; 
   4.227 +         font-style:normal; 
   4.228 +         margin-bottom:6pt; 
   4.229 +         font-family:Arial, helvetica, sans-serif;  }
   4.230 +LI.kadov-P-CSupra { 
   4.231 +                   font-weight:bold; 
   4.232 +                   font-style:normal; 
   4.233 +                   font-family:Arial, helvetica, sans-serif;  }
   4.234 +OL { 
   4.235 +    font-size:71%; 
   4.236 +    font-family:Verdana, Arial, helvetica, sans-serif; 
   4.237 +    color:#323232;  }
   4.238 +UL { 
   4.239 +    font-size:71%; 
   4.240 +    font-family:Verdana, Arial, helvetica, sans-serif; 
   4.241 +    color:#323232;  }
   4.242 +P.CodeIndent { 
   4.243 +              font-family:"Courier New"  , Courier, monospace; 
   4.244 +              margin-left:40px; 
   4.245 +              margin-bottom:0px; 
   4.246 +              line-height:Normal;  }
   4.247 +LI.kadov-P-CCodeIndent { 
   4.248 +                        font-family:"Courier New"  , Courier, monospace; 
   4.249 +                        line-height:Normal;  }
     5.1 diff -r 000000000000 -r 396b0bd970d3 document/lever40_ns.css
     5.2 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 +++ b/document/lever40_ns.css	Fri Aug 13 10:49:23 2010 +0100
     5.4 @@ -0,0 +1,248 @@
     5.5 +H1 { 
     5.6 +    font-weight:bold; 
     5.7 +    border-top-style:none; 
     5.8 +    font-family:Arial, helvetica, sans-serif; 
     5.9 +    color:#ea6d23; 
    5.10 +    margin-left:15px; 
    5.11 +    margin-top:3px; 
    5.12 +    margin-bottom:10px; 
    5.13 +    border-bottom-style:Solid; 
    5.14 +    border-bottom-width:2px; 
    5.15 +    border-bottom-color:#dbdbdb; 
    5.16 +    margin-right:1pt; 
    5.17 +    line-height:Normal; 
    5.18 +    font-size:1em;  }
    5.19 +LI.kadov-H1 { 
    5.20 +             font-weight:bold; 
    5.21 +             font-family:Arial, helvetica, sans-serif; 
    5.22 +             color:#ea6d23; 
    5.23 +             line-height:Normal; 
    5.24 +             font-size:1em;  }
    5.25 +H2 { 
    5.26 +    font-weight:bold; 
    5.27 +    x-text-underline:Off; 
    5.28 +    border-top-style:none; 
    5.29 +    border-bottom-style:none; 
    5.30 +    font-family:Arial, helvetica, sans-serif; 
    5.31 +    color:#ea6d23; 
    5.32 +    margin-left:15px; 
    5.33 +    margin-top:12px; 
    5.34 +    margin-bottom:5px; 
    5.35 +    font-size:0.84em; 
    5.36 +    margin-right:1pt; 
    5.37 +    text-decoration:none;  }
    5.38 +LI.kadov-H2 { 
    5.39 +             font-weight:bold; 
    5.40 +             x-text-underline:Off; 
    5.41 +             font-family:Arial, helvetica, sans-serif; 
    5.42 +             color:#ea6d23; 
    5.43 +             font-size:0.84em; 
    5.44 +             text-decoration:none;  }
    5.45 +P { 
    5.46 +   margin-top:1pt; 
    5.47 +   font-family:Verdana, Arial, helvetica, sans-serif; 
    5.48 +   color:#323232; 
    5.49 +   font-size:71%; 
    5.50 +   margin-bottom:8px; 
    5.51 +   line-height:1.4em; 
    5.52 +   margin-right:1pt; 
    5.53 +   margin-left:15px;  }
    5.54 +LI.kadov-P { 
    5.55 +            font-family:Verdana, Arial, helvetica, sans-serif; 
    5.56 +            color:#323232; 
    5.57 +            font-size:71%; 
    5.58 +            line-height:1.4em;  }
    5.59 +p.Step { 
    5.60 +        list-style:decimal; 
    5.61 +        margin-left:1pt; 
    5.62 +        font-size:100%; 
    5.63 +        margin-bottom:7px; 
    5.64 +        margin-top:1pt;  }
    5.65 +LI.kadov-p-CStep { 
    5.66 +                  list-style:decimal; 
    5.67 +                  font-size:100%;  }
    5.68 +P.Bullet { 
    5.69 +          font-size:100%; 
    5.70 +          margin-bottom:7px; 
    5.71 +          margin-left:1pt; 
    5.72 +          margin-top:1pt;  }
    5.73 +LI.kadov-P-CBullet { 
    5.74 +                    font-size:100%;  }
    5.75 +P.NormalIndent { 
    5.76 +                margin-left:40px;  }
    5.77 +LI.kadov-P-CNormalIndent {  }
    5.78 +P.BulletIndent { 
    5.79 +                margin-bottom:2px; 
    5.80 +                font-size:100%; 
    5.81 +                margin-left:15pt;  }
    5.82 +LI.kadov-P-CBulletIndent { 
    5.83 +                          font-size:100%;  }
    5.84 +P.Procedure { 
    5.85 +             font-style:italic; 
    5.86 +             font-weight:normal; 
    5.87 +             x-next-class:Step; 
    5.88 +             x-next-type:p; 
    5.89 +             margin-top:12pt; 
    5.90 +             margin-bottom:5px;  }
    5.91 +LI.kadov-P-CProcedure { 
    5.92 +                       font-style:italic; 
    5.93 +                       font-weight:normal;  }
    5.94 +P.Note { 
    5.95 +        margin-top:8pt; 
    5.96 +        margin-bottom:8pt; 
    5.97 +        border-top-style:Solid; 
    5.98 +        border-bottom-style:Solid; 
    5.99 +        padding-top:4px; 
   5.100 +        padding-bottom:4px; 
   5.101 +        border-top-width:1px; 
   5.102 +        border-bottom-width:1px; 
   5.103 +        background-color:#ffffff;  }
   5.104 +LI.kadov-P-CNote {  }
   5.105 +P.NoteIndent { 
   5.106 +              margin-top:8pt; 
   5.107 +              margin-bottom:8pt; 
   5.108 +              border-top-style:Solid; 
   5.109 +              border-bottom-style:Solid; 
   5.110 +              padding-top:4px; 
   5.111 +              padding-bottom:4px; 
   5.112 +              border-top-width:1px; 
   5.113 +              border-bottom-width:1px; 
   5.114 +              background-color:#ffffff; 
   5.115 +              margin-left:40px;  }
   5.116 +LI.kadov-P-CNoteIndent {  }
   5.117 +P.Table { 
   5.118 +         margin-top:4px; 
   5.119 +         margin-bottom:4px; 
   5.120 +         margin-right:4px; 
   5.121 +         margin-left:4px;  }
   5.122 +LI.kadov-P-CTable {  }
   5.123 +P.Code { 
   5.124 +        margin-bottom:1pt; 
   5.125 +        line-height:Normal; 
   5.126 +        font-family:"Courier New"     , Courier, monospace;  }
   5.127 +LI.kadov-P-CCode { 
   5.128 +                  line-height:Normal; 
   5.129 +                  font-family:"Courier New"     , Courier, monospace;  }
   5.130 +P.StepBulletFirst { 
   5.131 +                   font-size:100%; 
   5.132 +                   margin-left:15px; 
   5.133 +                   margin-bottom:2px;  }
   5.134 +LI.kadov-P-CStepBulletFirst { 
   5.135 +                             font-size:100%;  }
   5.136 +BODY { 
   5.137 +      background-color:#ffffff; 
   5.138 +      color:#000080; 
   5.139 +      font-family:Arial, sans-serif;  }
   5.140 +P.SeeAlso { 
   5.141 +           font-weight:bold; 
   5.142 +           font-style:normal; 
   5.143 +           x-next-type:P; 
   5.144 +           color:#ea6d23; 
   5.145 +           font-family:Arial, helvetica, sans-serif; 
   5.146 +           margin-left:15px; 
   5.147 +           margin-top:12px; 
   5.148 +           margin-bottom:5px; 
   5.149 +           font-size:0.84em;  }
   5.150 +LI.kadov-P-CSeeAlso { 
   5.151 +                     font-weight:bold; 
   5.152 +                     font-style:normal; 
   5.153 +                     color:#ea6d23; 
   5.154 +                     font-family:Arial, helvetica, sans-serif; 
   5.155 +                     font-size:0.84em;  }
   5.156 +A:link { 
   5.157 +        font-weight:bold; 
   5.158 +        font-style:normal; 
   5.159 +        color:#003a98; 
   5.160 +        x-text-underline:Off; 
   5.161 +        text-decoration:none;  }
   5.162 +A:hover { 
   5.163 +         x-text-underline:Normal; 
   5.164 +         color:#59add3; 
   5.165 +         text-decoration:underline;  }
   5.166 +A:active { 
   5.167 +          color:#59add3;  }
   5.168 +A:visited { 
   5.169 +           x-text-underline:Off; 
   5.170 +           color:#385689; 
   5.171 +           font-weight:bold; 
   5.172 +           font-style:normal; 
   5.173 +           text-decoration:none;  }
   5.174 +H1.Home { 
   5.175 +         x-next-type:P; 
   5.176 +         border-top-style:none; 
   5.177 +         border-bottom-style:none; 
   5.178 +         x-text-underline:Off; 
   5.179 +         font-size:15pt; 
   5.180 +         color:#ea6d23; 
   5.181 +         text-decoration:none;  }
   5.182 +LI.kadov-H1-CHome { 
   5.183 +                   x-text-underline:Off; 
   5.184 +                   font-size:15pt; 
   5.185 +                   color:#ea6d23; 
   5.186 +                   text-decoration:none;  }
   5.187 +H3 { 
   5.188 +    margin-left:15px; 
   5.189 +    margin-top:12px; 
   5.190 +    margin-bottom:5px; 
   5.191 +    color:#323232; 
   5.192 +    font-size:71%; 
   5.193 +    font-family:Verdana, Arial, helvetica, sans-serif; 
   5.194 +    margin-right:1pt; 
   5.195 +    font-weight:bold;  }
   5.196 +LI.kadov-H3 { 
   5.197 +             color:#323232; 
   5.198 +             font-size:71%; 
   5.199 +             font-family:Verdana, Arial, helvetica, sans-serif;  }
   5.200 +P.Title { 
   5.201 +         font-weight:bold; 
   5.202 +         font-style:normal; 
   5.203 +         x-next-type:P; 
   5.204 +         font-family:Arial, helvetica, sans-serif; 
   5.205 +         color:#ea6d23; 
   5.206 +         margin-bottom:10px; 
   5.207 +         font-size:1.4em; 
   5.208 +         line-height:Normal; 
   5.209 +         border-bottom-style:Solid; 
   5.210 +         border-bottom-width:2px; 
   5.211 +         border-bottom-color:#dbdbdb; 
   5.212 +         margin-top:1pt;  }
   5.213 +LI.kadov-P-CTitle { 
   5.214 +                   font-weight:bold; 
   5.215 +                   font-style:normal; 
   5.216 +                   font-family:Arial, helvetica, sans-serif; 
   5.217 +                   color:#ea6d23; 
   5.218 +                   font-size:1.4em; 
   5.219 +                   line-height:Normal;  }
   5.220 +P.Supra { 
   5.221 +         font-weight:bold; 
   5.222 +         font-style:normal; 
   5.223 +         margin-bottom:6pt; 
   5.224 +         font-family:Arial, helvetica, sans-serif;  }
   5.225 +LI.kadov-P-CSupra { 
   5.226 +                   font-weight:bold; 
   5.227 +                   font-style:normal; 
   5.228 +                   font-family:Arial, helvetica, sans-serif;  }
   5.229 +OL { 
   5.230 +    font-size:71%; 
   5.231 +    font-family:Verdana, Arial, helvetica, sans-serif; 
   5.232 +    color:#323232;  }
   5.233 +UL { 
   5.234 +    font-size:71%; 
   5.235 +    font-family:Verdana, Arial, helvetica, sans-serif; 
   5.236 +    color:#323232;  }
   5.237 +P.CodeIndent { 
   5.238 +              font-family:"Courier New"     , Courier, monospace; 
   5.239 +              margin-left:40px; 
   5.240 +              margin-bottom:1pt; 
   5.241 +              line-height:Normal;  }
   5.242 +LI.kadov-P-CCodeIndent { 
   5.243 +                        font-family:"Courier New"     , Courier, monospace; 
   5.244 +                        line-height:Normal;  }
   5.245 +ol ol { 
   5.246 +       margin-top:1px;  }
   5.247 +ol ul { 
   5.248 +       margin-top:1px;  }
   5.249 +ul ul { 
   5.250 +       margin-top:1px;  }
   5.251 +ul ol { 
   5.252 +       margin-top:1px;  }
     6.1 diff -r 000000000000 -r 396b0bd970d3 document/qm_icon.jpg
     6.2 Binary file document/qm_icon.jpg has changed
     7.1 diff -r 000000000000 -r 396b0bd970d3 document/timer.htm
     7.2 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 +++ b/document/timer.htm	Fri Aug 13 10:49:23 2010 +0100
     7.4 @@ -0,0 +1,253 @@
     7.5 +<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
     7.6 +
     7.7 +<html>
     7.8 +
     7.9 +<head>
    7.10 +<title>timer</title>
    7.11 +<meta http-equiv="content-type" content="text/html; charset=windows-1252">
    7.12 +<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">
    7.13 +<link rel="stylesheet" href="lever40_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">
    7.14 +<!--
    7.15 +if (navigator.appName !="Netscape")
    7.16 +{   document.write("<link rel='stylesheet' href='lever40.css'>");}
    7.17 +//-->
    7.18 +</script>
    7.19 +<style type="text/css">
    7.20 +<!--
    7.21 +img_whs1 { border:none; width:29px; height:31px; float:none; border-style:none; }
    7.22 +p.whs2 { font-style:italic; }
    7.23 +table.whs3 { x-cell-content-align:top; height:84px; margin-left:14px; left:0px; top:114px; width:636px; border-spacing:0px; }
    7.24 +col.whs4 { width:87px; }
    7.25 +col.whs5 { width:502px; }
    7.26 +tr.whs6 { x-cell-content-align:top; height:22px; }
    7.27 +td.whs7 { width:87px; padding-right:10px; padding-left:10px; border-left-style:Solid; border-left-color:#c0c0c0; border-top-style:Solid; border-top-color:#c0c0c0; border-right-color:#c0c0c0; border-right-style:Solid; border-bottom-color:#c0c0c0; border-bottom-style:Solid; border-right-width:1px; border-left-width:1px; border-top-width:1px; border-bottom-width:1px; background-color:#dee8f4; }
    7.28 +td.whs8 { width:502px; padding-right:10px; padding-left:10px; border-top-style:Solid; border-top-color:#c0c0c0; border-right-color:#c0c0c0; border-right-style:Solid; border-bottom-color:#c0c0c0; border-bottom-style:Solid; border-top-width:1px; border-bottom-width:1px; border-right-width:1px; background-color:#dee8f4; }
    7.29 +td.whs9 { width:87px; padding-right:10px; padding-left:10px; border-left-color:#c0c0c0; border-left-width:1px; border-left-style:Solid; border-right-color:#c0c0c0; border-right-style:Solid; border-right-width:1px; border-bottom-color:#c0c0c0; border-bottom-style:Solid; border-bottom-width:1px; }
    7.30 +td.whs10 { width:502px; padding-right:10px; padding-left:10px; border-right-color:#c0c0c0; border-right-style:Solid; border-right-width:1px; border-bottom-color:#c0c0c0; border-bottom-style:Solid; border-bottom-width:1px; }
    7.31 +p.whs11 { margin-left:4px; }
    7.32 +table.whs12 { x-cell-content-align:top; margin-left:15px; border-spacing:0px; }
    7.33 +col.whs13 { width:86px; }
    7.34 +tr.whs14 { x-cell-content-align:top; }
    7.35 +td.whs15 { width:86px; padding-right:10px; padding-left:10px; border-left-style:Solid; border-left-color:#c0c0c0; border-top-color:#c0c0c0; border-top-style:Solid; border-right-color:#c0c0c0; border-right-style:Solid; border-bottom-color:#c0c0c0; border-bottom-style:Solid; border-right-width:1px; border-left-width:1px; border-top-width:1px; border-bottom-width:1px; background-color:#dee8f4; }
    7.36 +td.whs16 { width:502px; padding-right:10px; padding-left:10px; border-top-color:#c0c0c0; border-top-style:Solid; border-right-color:#c0c0c0; border-right-style:Solid; border-bottom-color:#c0c0c0; border-bottom-style:Solid; border-top-width:1px; border-bottom-width:1px; border-right-width:1px; background-color:#dee8f4; }
    7.37 +td.whs17 { width:86px; padding-right:10px; padding-left:10px; border-left-style:Solid; border-left-width:1px; border-left-color:#c0c0c0; border-right-width:1px; border-right-color:#c0c0c0; border-right-style:Solid; border-bottom-width:1px; border-bottom-color:#c0c0c0; border-bottom-style:Solid; }
    7.38 +td.whs18 { width:502px; padding-right:10px; padding-left:10px; border-right-width:1px; border-right-color:#c0c0c0; border-right-style:Solid; border-bottom-width:1px; border-bottom-color:#c0c0c0; border-bottom-style:Solid; }
    7.39 +td.whs19 { width:86px; padding-right:10px; padding-left:10px; border-left-color:#c0c0c0; border-left-width:1px; border-left-style:Solid; border-right-style:Solid; border-right-color:#c0c0c0; border-right-width:1px; border-bottom-style:Solid; border-bottom-color:#c0c0c0; border-bottom-width:1px; }
    7.40 +td.whs20 { width:502px; padding-right:10px; padding-left:10px; border-right-style:Solid; border-right-color:#c0c0c0; border-right-width:1px; border-bottom-style:Solid; border-bottom-color:#c0c0c0; border-bottom-width:1px; }
    7.41 +img_whs21 { border:none; width:14px; height:16px; float:none; border-style:none; }
    7.42 +-->
    7.43 +</style><script type="text/javascript" language="JavaScript">
    7.44 +<!--
    7.45 +function ehlp_showtip(current,e,text)
    7.46 +{
    7.47 +  if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == 'Netscape'))
    7.48 +  {
    7.49 +    document.tooltip.document.write("<layer bgColor='yellow' style='border:1px solid black;font-size:12px;'>"+ text + "</layer>");
    7.50 +    document.tooltip.document.close();
    7.51 +    document.tooltip.left=e.pageX+5;
    7.52 +    document.tooltip.top=e.pageY+5;
    7.53 +    document.tooltip.visibility="show";
    7.54 +  }
    7.55 +}
    7.56 +function ehlp_hidetip()
    7.57 +{
    7.58 +  document.tooltip.visibility="hidden";
    7.59 +}
    7.60 +//-->
    7.61 +</script>
    7.62 +<script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
    7.63 +<!--
    7.64 +function reDo() {
    7.65 +  if (innerWidth != origWidth || innerHeight != origHeight)
    7.66 +     location.reload();
    7.67 +}
    7.68 +if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
    7.69 +	origWidth = innerWidth;
    7.70 +	origHeight = innerHeight;
    7.71 +	onresize = reDo;
    7.72 +}
    7.73 +onerror = null; 
    7.74 +//-->
    7.75 +</script>
    7.76 +<style type="text/css">
    7.77 +<!--
    7.78 +div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }
    7.79 +p.WebHelpNavBar { text-align:right; }
    7.80 +-->
    7.81 +</style><script type="text/javascript" language="javascript1.2" src="whmsg.js"></script>
    7.82 +<script type="text/javascript" language="javascript" src="whver.js"></script>
    7.83 +<script type="text/javascript" language="javascript1.2" src="whproxy.js"></script>
    7.84 +<script type="text/javascript" language="javascript1.2" src="whutils.js"></script>
    7.85 +<script type="text/javascript" language="javascript1.2" src="whtopic.js"></script>
    7.86 +<script type="text/javascript" language="javascript1.2">
    7.87 +<!--
    7.88 +if (window.gbWhTopic)
    7.89 +{
    7.90 +	if (window.setRelStartPage)
    7.91 +	{
    7.92 +	addTocInfo("Timer");
    7.93 +
    7.94 +	}
    7.95 +
    7.96 +
    7.97 +	if (window.setRelStartPage)
    7.98 +	{
    7.99 +	setRelStartPage("msb_peripherals.htm");
   7.100 +
   7.101 +		autoSync(0);
   7.102 +		sendSyncInfo();
   7.103 +		sendAveInfoOut();
   7.104 +	}
   7.105 +
   7.106 +}
   7.107 +else
   7.108 +	if (window.gbIE4)
   7.109 +		document.location.reload();
   7.110 +//-->
   7.111 +</script>
   7.112 +</head>
   7.113 +<body><script type="text/javascript" language="javascript1.2">
   7.114 +<!--
   7.115 +if (window.writeIntopicBar)
   7.116 +	writeIntopicBar(4);
   7.117 +//-->
   7.118 +</script>
   7.119 +<h1>LatticeMico32 Timer &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a title="View Data Sheet" href="timer.pdf" target="_blank" onmouseover="if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == 'Netscape')) ehlp_showtip(this,event,'View Data Sheet');" onmouseout="if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == 'Netscape')) ehlp_hidetip();"><img src="ds_icon_ast.jpg" x-maintain-ratio="TRUE" width="29px" height="31px" border="0" class="img_whs1"></a></h1>
   7.120 +
   7.121 +<p>The LatticeMico32 timer is a highly configurable countdown timer with 
   7.122 + a WISHBONE-compliant slave interface compatible with the LatticeMico32 
   7.123 + microprocessor. &nbsp;</p>
   7.124 +
   7.125 +<p class="whs2"><span style="font-style: italic;"><I>*If the 
   7.126 + data sheet fails to open, see the note at the bottom of this page.</I></span></p>
   7.127 +
   7.128 +<h2>Revision History</h2>
   7.129 +
   7.130 +<table x-use-null-cells cellspacing="0" width="636" height="84" class="whs3">
   7.131 +<script language='JavaScript'><!--
   7.132 +if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4)) document.write("</table><table x-use-null-cells cellspacing='0' width='636' height='84' border='1' bordercolor='silver' bordercolorlight='silver' bordercolordark='silver'>");
   7.133 +//--></script>
   7.134 +<col class="whs4">
   7.135 +<col class="whs5">
   7.136 +
   7.137 +<tr valign="top" class="whs6">
   7.138 +<td bgcolor="#DEE8F4" width="87px" class="whs7">
   7.139 +<p class=Table
   7.140 +	style="font-weight: bold;">Version</td>
   7.141 +<td bgcolor="#DEE8F4" width="502px" class="whs8">
   7.142 +<p class=Table
   7.143 +	style="font-weight: bold;">Description</td></tr>
   7.144 +
   7.145 +<tr valign="top" class="whs6">
   7.146 +<td colspan="1" rowspan="1" width="87px" class="whs9">
   7.147 +<p class=Table
   7.148 +	style="font-weight: normal;"><span style="font-weight: normal;">3.0 
   7.149 + (7.0 SP2)</span></td>
   7.150 +<td colspan="1" rowspan="1" width="502px" class="whs10">
   7.151 +<p class=Table>Version number change only. No RTL code change.</td></tr>
   7.152 +
   7.153 +<tr valign="top" class="whs6">
   7.154 +<td colspan="1" rowspan="1" width="87px" class="whs9">
   7.155 +<p class="whs11">1.0</td>
   7.156 +<td colspan="1" rowspan="1" width="502px" class="whs10">
   7.157 +<p class=Table>Initial release.</td></tr>
   7.158 +<script language='JavaScript'><!--
   7.159 +if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4)) document.write("</table></table><table>");
   7.160 +//--></script>
   7.161 +</table>
   7.162 +
   7.163 +&nbsp; 
   7.164 +
   7.165 +<h2>Dialog Box Parameters</h2>
   7.166 +
   7.167 +<table x-use-null-cells cellspacing="0" class="whs12">
   7.168 +<script language='JavaScript'><!--
   7.169 +if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4)) document.write("</table><table x-use-null-cells cellspacing='0' border='1' bordercolor='silver' bordercolorlight='silver' bordercolordark='silver'>");
   7.170 +//--></script>
   7.171 +<col class="whs13">
   7.172 +<col class="whs5">
   7.173 +
   7.174 +<tr valign="top" class="whs14">
   7.175 +<td bgcolor="#DEE8F4" width="86px" class="whs15">
   7.176 +<p class=Table
   7.177 +	style="font-weight: bold;">Property</td>
   7.178 +<td bgcolor="#DEE8F4" width="502px" class="whs16">
   7.179 +<p class=Table
   7.180 +	style="font-weight: bold;">Description</td></tr>
   7.181 +
   7.182 +<tr valign="top" class="whs14">
   7.183 +<td colspan="1" rowspan="1" width="86px" class="whs17">
   7.184 +<p class=Table>Instance Name</td>
   7.185 +<td colspan="1" rowspan="1" width="502px" class="whs18">
   7.186 +<p class=Table>Specifies the name of the timer instance. Alphanumeric values 
   7.187 + and underscores are supported. The default is timer.</td></tr>
   7.188 +
   7.189 +<tr valign="top" class="whs14">
   7.190 +<td width="86px" class="whs17">
   7.191 +<p class=Table>Base Address</td>
   7.192 +<td width="502px" class="whs18">
   7.193 +<p class=Table>Specifies the base address for configuring the timer device. 
   7.194 + The minimum boundary alignment is 0X80. Supported &nbsp;values 
   7.195 + are 0X00000000 to 0XFFFFFFFF. The default is 0X00000000.</td></tr>
   7.196 +
   7.197 +<tr valign="top" class="whs14">
   7.198 +<td colspan="1" rowspan="1" width="86px" class="whs17">
   7.199 +<p class=Table>Writeable Tick Count</td>
   7.200 +<td colspan="1" rowspan="1" width="502px" class="whs18">
   7.201 +<p class=Table>Determines whether the period register is writable. A tick 
   7.202 + is equivalent to one clock cycle. This option is selected by default.</td></tr>
   7.203 +
   7.204 +<tr valign="top" class="whs14">
   7.205 +<td colspan="1" rowspan="1" width="86px" class="whs17">
   7.206 +<p class=Table>Readable Tick Count</td>
   7.207 +<td colspan="1" rowspan="1" width="502px" class="whs18">
   7.208 +<p class=Table>Determines whether the snapshot register is readable. This 
   7.209 + option is selected by default.</td></tr>
   7.210 +
   7.211 +<tr valign="top" class="whs14">
   7.212 +<td colspan="1" rowspan="1" width="86px" class="whs17">
   7.213 +<p class=Table>Start Stop Control</td>
   7.214 +<td colspan="1" rowspan="1" width="502px" class="whs18">
   7.215 +<p class=Table>Determines whether the START and STOP bits are controllable. 
   7.216 + This option is selected by default.</td></tr>
   7.217 +
   7.218 +<tr valign="top" class="whs14">
   7.219 +<td colspan="1" rowspan="1" width="86px" class="whs19">
   7.220 +<p class=Table>Default Reload Ticks</td>
   7.221 +<td colspan="1" rowspan="1" width="502px" class="whs20">
   7.222 +<p class=Table>Specifies the initial countdown value. The period number 
   7.223 + is the reload value used to initialize the counter. The value should be 
   7.224 + in the range that can be represented by the period width. Supported values 
   7.225 + are 0X00000000 to 0XFFFFFFFF. The default is 20 (0X14).</td></tr>
   7.226 +
   7.227 +<tr valign="top" class="whs14">
   7.228 +<td colspan="1" rowspan="1" width="86px" class="whs17">
   7.229 +<p class=Table>Counter Width</td>
   7.230 +<td colspan="1" rowspan="1" width="502px" class="whs18">
   7.231 +<p class=Table>Controls the period register and internal counter's width. 
   7.232 + The period width is the width of the adder-subtractor used to implement 
   7.233 + the counter. Supported values are 1 to 31. The default is 32.</td></tr>
   7.234 +<script language='JavaScript'><!--
   7.235 +if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4)) document.write("</table></table><table>");
   7.236 +//--></script>
   7.237 +</table>
   7.238 +
   7.239 +&nbsp; 
   7.240 +
   7.241 +<p><span style="font-weight: bold;"><B>Note</B></span>: If the data sheet fails 
   7.242 + to open, click <img src="qm_icon.jpg" x-maintain-ratio="TRUE" width="14px" height="16px" border="0" class="img_whs21"> on the Available Components toolbar, and 
   7.243 + then click the note button.</p>
   7.244 +
   7.245 +<script type="text/javascript" language="JavaScript">
   7.246 +<!--
   7.247 + if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == 'Netscape'))
   7.248 +  document.write("<div id='tooltip' class='WebHelpPopupMenu'></div>");
   7.249 +//-->
   7.250 +</script><script type="text/javascript" language="javascript1.2">
   7.251 +<!--
   7.252 +if (window.writeIntopicBar)
   7.253 +	writeIntopicBar(0);
   7.254 +//-->
   7.255 +</script>
   7.256 +</body>
   7.257 +</html>
     8.1 diff -r 000000000000 -r 396b0bd970d3 document/timer.pdf
     8.2 Binary file document/timer.pdf has changed
     9.1 diff -r 000000000000 -r 396b0bd970d3 drivers/device/MicoTimer.c
     9.2 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 +++ b/drivers/device/MicoTimer.c	Fri Aug 13 10:49:23 2010 +0100
     9.4 @@ -0,0 +1,231 @@
     9.5 +/****************************************************************************
     9.6 +**
     9.7 +**  Name: MicoTimer.c
     9.8 +**
     9.9 +**  Description:
    9.10 +**        Implements functions for manipulating LatticeMico32 Timer
    9.11 +**
    9.12 +**  $Revision: $
    9.13 +**
    9.14 +** Disclaimer:
    9.15 +**
    9.16 +**   This source code is intended as a design reference which
    9.17 +**   illustrates how these types of functions can be implemented.  It
    9.18 +**   is the user's responsibility to verify their design for
    9.19 +**   consistency and functionality through the use of formal
    9.20 +**   verification methods.  Lattice Semiconductor provides no warranty
    9.21 +**   regarding the use or functionality of this code.
    9.22 +**
    9.23 +** --------------------------------------------------------------------
    9.24 +**
    9.25 +**                     Lattice Semiconductor Corporation
    9.26 +**                     5555 NE Moore Court
    9.27 +**                     Hillsboro, OR 97214
    9.28 +**                     U.S.A
    9.29 +**
    9.30 +**                     TEL: 1-800-Lattice (USA and Canada)
    9.31 +**                          (503)268-8001 (other locations)
    9.32 +**
    9.33 +**                     web:   http://www.latticesemi.com
    9.34 +**                     email: techsupport@latticesemi.com
    9.35 +**
    9.36 +** --------------------------------------------------------------------------
    9.37 +**
    9.38 +**  Change History (Latest changes on top)
    9.39 +**
    9.40 +**  Ver    Date        Description
    9.41 +** --------------------------------------------------------------------------
    9.42 +**
    9.43 +**  3.0   Mar-25-2008  Added Header
    9.44 +**
    9.45 +**---------------------------------------------------------------------------
    9.46 +*****************************************************************************/
    9.47 +
    9.48 +
    9.49 +#include "MicoTimer.h"
    9.50 +#include "MicoTimerService.h"
    9.51 +#include "MicoMacros.h"
    9.52 +#include "MicoInterrupts.h"
    9.53 +
    9.54 +
    9.55 +
    9.56 +/**************************************************************************
    9.57 + * driver-debug functions                                                 *
    9.58 + **************************************************************************/
    9.59 +#if _MICO_TIMER_DRIVER_DEBUG_ENABLED_
    9.60 +static void MicoTimerDumpCtx(MicoTimerCtx_t *pCtx)
    9.61 +{
    9.62 +    printf("\n Base     : 0x%x", pCtx->base);
    9.63 +    printf("\n IntrLevel: 0x%x", pCtx->intrLevel);
    9.64 +    printf("\n Context  : 0x%x", pCtx->userCtx);
    9.65 +    printf("\n Callback : 0x%x", pCtx->callback);
    9.66 +    return;
    9.67 +}
    9.68 +
    9.69 +
    9.70 +void MicoTimerDumpRegs(MicoTimerCtx_t *pCtx)
    9.71 +{
    9.72 +    MicoTimer_t *pTimer = (MicoTimer_t *)pCtx->base;
    9.73 +    printf("\n isr-status  : 0x%x",     pTimer->Status);
    9.74 +    printf("\n isr-control : 0x%x",     pTimer->Control);
    9.75 +    printf("\n isr-period  : 0x%x",     pTimer->Period);
    9.76 +    printf("\n isr-snapshot: 0x%x\n",   pTimer->Snapshot);
    9.77 +}
    9.78 +#endif
    9.79 +
    9.80 +
    9.81 +/******************************************************************************
    9.82 + * Timer interrupt-handler                                                    *
    9.83 + ******************************************************************************/
    9.84 +static void MicoTimerISR(unsigned int intrLevel, void *pContext)
    9.85 +{
    9.86 +    /*
    9.87 +     * flow:
    9.88 +     * - clear the timeout-bit
    9.89 +     * - invoke user-registered callback
    9.90 +     */
    9.91 +    MicoTimerCtx_t *ctx = (MicoTimerCtx_t *)pContext;
    9.92 +    volatile MicoTimer_t *pTimer = (MicoTimer_t *)ctx->base;
    9.93 +
    9.94 +    /* acknowledge the interrupt */
    9.95 +    pTimer->Status = 0;
    9.96 +
    9.97 +    /* call the isr */
    9.98 +    if(ctx->callback != 0)
    9.99 +        ((TimerCallback_t)ctx->callback)(ctx->userCtx);
   9.100 +
   9.101 +    return;
   9.102 +}
   9.103 +
   9.104 +
   9.105 +/******************************************************************************
   9.106 + * Initializes a timer                                                        *
   9.107 + *----------------------------------------------------------------------------*
   9.108 + * Inputs:                                                                    *
   9.109 + *     unsigned int IntNum: Interrupt-level                                   *
   9.110 + * Outputs:                                                                   *
   9.111 + * Return values:                                                             *
   9.112 + *            MICO_STATUS_E_INVALID_PARAM                                     *
   9.113 + *            MICO_STATUS_OK                                                  *
   9.114 + ******************************************************************************/
   9.115 +void MicoTimerInit( MicoTimerCtx_t *ctx )
   9.116 +{
   9.117 +    /* stop the timer (if it was running) */
   9.118 +    MicoTimerStop(ctx);
   9.119 +
   9.120 +    /* 
   9.121 +     * Enable interrupts without registering an isr:
   9.122 +     * this way, any spurious timer interrupt that might have
   9.123 +     * existed prior to this init being called, will cause the
   9.124 +     * Mico Interrupt-framework to acknowlede the CPU's interrupt-pending.
   9.125 +     */
   9.126 +    MicoEnableInterrupt(ctx->intrLevel);
   9.127 +
   9.128 +    /* register this timer for lookup service */
   9.129 +    ctx->lookupReg.name = ctx->name;
   9.130 +    ctx->lookupReg.deviceType = "TimerDevice";
   9.131 +    ctx->lookupReg.priv = ctx;
   9.132 +    MicoRegisterDevice( &(ctx->lookupReg) );
   9.133 +
   9.134 +    /* all done */
   9.135 +    return;
   9.136 +}
   9.137 +
   9.138 +
   9.139 +/******************************************************************************
   9.140 + * Starts a Mico32 timer                                                      *
   9.141 + *----------------------------------------------------------------------------*
   9.142 + * Inputs:                                                                    *
   9.143 + *     MicoTimerCtx_t *ctx: pointer to valid ctx                              *
   9.144 + *                                                                            *
   9.145 + *     TimerCallback_t callback: User-provided callback function, called      *
   9.146 + *             in interrupt-context.                                          *
   9.147 + *                                                                            *
   9.148 + *     void *priv: user-provided data that will be called in the callback     *
   9.149 + *                                                                            *
   9.150 + *     unsigned int timercount: ticks to load counter with                    *
   9.151 + *                                                                            *
   9.152 + *     int periodic: if 1, the timer is programmed to auto-load, else         *
   9.153 + *           timer is programmed not to reload on reaching terminal value     *
   9.154 + *                                                                            *
   9.155 + * Note: user MUST supply a valid ctx.                                        *
   9.156 + *       user MUST make sure timerCount is non-zero                           *
   9.157 + ******************************************************************************/
   9.158 +mico_status
   9.159 +MicoTimerStart( MicoTimerCtx_t *ctx, TimerCallback_t callback, void *priv, unsigned int timerCount, int periodic )
   9.160 +{
   9.161 +    volatile MicoTimer_t *pTimer;
   9.162 +    unsigned int regValue;
   9.163 +
   9.164 +    if( (ctx == 0) || (timerCount == 0) )
   9.165 +        return(MICO_STATUS_E_INVALID_PARAM);
   9.166 +
   9.167 +    /* flow:
   9.168 +     * - stop the timer,
   9.169 +     * - load new timerCount,
   9.170 +     * - configure the timer, taking into account the periodicity
   9.171 +     * - register the isr (user MUST provide an isr)
   9.172 +     * - start the timer.
   9.173 +     */
   9.174 +    pTimer          = (MicoTimer_t *)(ctx->base);
   9.175 +    regValue        = (MICO32_TIMER_CONTROL_START_BIT_MASK|MICO32_TIMER_CONTROL_INT_BIT_MASK);
   9.176 +    ctx->callback   = (void *)callback;
   9.177 +    ctx->userCtx    = priv;
   9.178 +
   9.179 +    MicoRegisterISR(ctx->intrLevel, ctx, MicoTimerISR);
   9.180 +
   9.181 +    if(periodic != 0)
   9.182 +        regValue |= MICO32_TIMER_CONTROL_CONT_BIT_MASK;
   9.183 +
   9.184 +
   9.185 +    pTimer->Control = MICO32_TIMER_CONTROL_STOP_BIT_MASK;
   9.186 +    pTimer->Period  = timerCount;
   9.187 +    pTimer->Control = regValue;
   9.188 +
   9.189 +
   9.190 +    return(MICO_STATUS_OK);
   9.191 +}
   9.192 +
   9.193 +
   9.194 +/******************************************************************************
   9.195 + *                                                                            *
   9.196 + * Stops a Mico32 timer                                                       *
   9.197 + *                                                                            *
   9.198 + *----------------------------------------------------------------------------*
   9.199 + *                                                                            *
   9.200 + * Note: user MUST supply a valid ctx.                                        *
   9.201 + *                                                                            *
   9.202 + ******************************************************************************/
   9.203 +mico_status
   9.204 +MicoTimerStop(MicoTimerCtx_t *ctx)
   9.205 +{
   9.206 +    volatile MicoTimer_t *pTimer;
   9.207 +    if(ctx == 0)
   9.208 +        return(MICO_STATUS_E_INVALID_PARAM);
   9.209 +
   9.210 +
   9.211 +    /* stop the timer first and ack any pending interrupts */
   9.212 +    pTimer = (MicoTimer_t *)(ctx->base);
   9.213 +    pTimer->Control = MICO32_TIMER_CONTROL_STOP_BIT_MASK;
   9.214 +    pTimer->Status = 0;
   9.215 +
   9.216 +    /* all done */
   9.217 +    return(MICO_STATUS_OK);
   9.218 +}
   9.219 +
   9.220 +
   9.221 +/******************************************************************************
   9.222 + * reads timer-snapshot                                                       *
   9.223 + *----------------------------------------------------------------------------*
   9.224 + * Note: user MUST supply a valid ctx.                                        *
   9.225 + ******************************************************************************/
   9.226 +unsigned int MicoTimerSnapshot( MicoTimerCtx_t *ctx)
   9.227 +{
   9.228 +    volatile MicoTimer_t *pTimer;
   9.229 +    if(ctx == 0){
   9.230 +        return(0);
   9.231 +    }
   9.232 +    pTimer = (MicoTimer_t *)(ctx->base);
   9.233 +    return(pTimer->Snapshot);
   9.234 +}
   9.235 +
    10.1 diff -r 000000000000 -r 396b0bd970d3 drivers/device/MicoTimer.h
    10.2 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 +++ b/drivers/device/MicoTimer.h	Fri Aug 13 10:49:23 2010 +0100
    10.4 @@ -0,0 +1,153 @@
    10.5 +/****************************************************************************
    10.6 +**
    10.7 +**  Name: MicoTimer.h
    10.8 +**
    10.9 +**  Description:
   10.10 +**        Implements functions for manipulating LatticeMico32 Timer and
   10.11 +**        defines timer register map
   10.12 +**
   10.13 +**  $Revision: $
   10.14 +**
   10.15 +** Disclaimer:
   10.16 +**
   10.17 +**   This source code is intended as a design reference which
   10.18 +**   illustrates how these types of functions can be implemented.  It
   10.19 +**   is the user's responsibility to verify their design for
   10.20 +**   consistency and functionality through the use of formal
   10.21 +**   verification methods.  Lattice Semiconductor provides no warranty
   10.22 +**   regarding the use or functionality of this code.
   10.23 +**
   10.24 +** --------------------------------------------------------------------
   10.25 +**
   10.26 +**                     Lattice Semiconductor Corporation
   10.27 +**                     5555 NE Moore Court
   10.28 +**                     Hillsboro, OR 97214
   10.29 +**                     U.S.A
   10.30 +**
   10.31 +**                     TEL: 1-800-Lattice (USA and Canada)
   10.32 +**                          (503)268-8001 (other locations)
   10.33 +**
   10.34 +**                     web:   http://www.latticesemi.com
   10.35 +**                     email: techsupport@latticesemi.com
   10.36 +**
   10.37 +** --------------------------------------------------------------------------
   10.38 +**
   10.39 +**  Change History (Latest changes on top)
   10.40 +**
   10.41 +**  Ver    Date        Description
   10.42 +** --------------------------------------------------------------------------
   10.43 +**
   10.44 +**  3.0   Mar-25-2008  Added Header
   10.45 +**
   10.46 +**---------------------------------------------------------------------------
   10.47 +*****************************************************************************/
   10.48 +
   10.49 +#ifndef MICO32_MICOTIMER_HEADER_FILE
   10.50 +#define MICO32_MICOTIMER_HEADER_FILE
   10.51 +
   10.52 +#include "MicoTypes.h"
   10.53 +#include "DDStructs.h"
   10.54 +
   10.55 +/****************************************************************************
   10.56 + * Mico-timer driver provides the ability to use a Mico-32 timer in either  *
   10.57 + * a single-shot mode or a periodic mode.                                   *
   10.58 + *--------------------------------------------------------------------------*
   10.59 + * Mico Timers must be located in a non-cached region to use this driver    *
   10.60 + ****************************************************************************/
   10.61 +
   10.62 +
   10.63 +#ifdef __cplusplus
   10.64 +extern "C"
   10.65 +{
   10.66 +#endif /* __cplusplus */
   10.67 +
   10.68 +
   10.69 +/******************************************************************************
   10.70 + * Data Structures:                                                           *
   10.71 + ******************************************************************************/
   10.72 +    /* timer callback function type */
   10.73 +    typedef void(*TimerCallback_t)(void *);
   10.74 +
   10.75 +
   10.76 +    /* mico-timer register structure */
   10.77 +    typedef struct st_MicoTimer{
   10.78 +        volatile unsigned int Status;
   10.79 +        volatile unsigned int Control;
   10.80 +        volatile unsigned int Period;
   10.81 +        volatile unsigned int Snapshot;
   10.82 +    }MicoTimer_t;
   10.83 +
   10.84 +
   10.85 +    /**************************************************************************
   10.86 +     * MICO32 TIMER REGISTER DEFINITIONS                                      *
   10.87 +     * (NOTE: OFFSETS REPRESENT BYTES)                                        *
   10.88 +     **************************************************************************/
   10.89 +    #define MICO32_TIMER_STATUS_REG_OFFSET                  (0x00)
   10.90 +    #define MICO32_TIMER_CONTROL_REG_OFFSET                 (0x04)
   10.91 +    #define MICO32_TIMER_PERIOD_REG_OFFSET                  (0x08)
   10.92 +    #define MICO32_TIMER_SNAPSHOT_REG_OFFSET                (0x0c)
   10.93 +
   10.94 +
   10.95 +    /* status-register bits: */
   10.96 +    #define MICO32_TIMER_STATUS_TO_BIT_MASK                 (0x1)
   10.97 +
   10.98 +
   10.99 +    /* control-register bits */
  10.100 +    #define MICO32_TIMER_CONTROL_INT_BIT_MASK               (0x1)
  10.101 +    #define MICO32_TIMER_CONTROL_CONT_BIT_MASK              (0x2)
  10.102 +    #define MICO32_TIMER_CONTROL_START_BIT_MASK             (0x4)
  10.103 +    #define MICO32_TIMER_CONTROL_STOP_BIT_MASK              (0x8)
  10.104 +
  10.105 +
  10.106 +/******************************************************************************
  10.107 + * functions                                                                  *
  10.108 + ******************************************************************************/
  10.109 +
  10.110 +/* initializes Mico32 timer */
  10.111 +void MicoTimerInit( MicoTimerCtx_t *ctx );
  10.112 +
  10.113 +
  10.114 +/*
  10.115 + ******************************************************************************
  10.116 + * Starts a Mico32 timer                                                      *
  10.117 + *----------------------------------------------------------------------------*
  10.118 + * Inputs:                                                                    *
  10.119 + *     MicoTimerCtx_t *ctx: pointer to valid ctx                              *
  10.120 + *                                                                            *
  10.121 + *     TimerCallback_t callback: User-provided callback function, called      *
  10.122 + *             in interrupt-context.                                          *
  10.123 + *             typedef void(*TimerCallback_t)(void *)                         *
  10.124 + *                                                                            *
  10.125 + *     void *priv: user-provided data that will be called in the callback     *
  10.126 + *                                                                            *
  10.127 + *     unsigned int timercount: ticks to load counter with                    *
  10.128 + *                                                                            *
  10.129 + *     int periodic: if 1, the timer is programmed to auto-load, else         *
  10.130 + *           timer is programmed not to reload on reaching terminal value     *
  10.131 + *                                                                            *
  10.132 + * Note: user MUST supply a valid ctx.                                        *
  10.133 + *       user MUST make sure timerCount is non-zero                           *
  10.134 + ******************************************************************************
  10.135 + */
  10.136 +mico_status MicoTimerStart( MicoTimerCtx_t *ctx, TimerCallback_t callback,
  10.137 +            void *priv, unsigned int timerCount, int periodic );
  10.138 +
  10.139 +
  10.140 +/* stops a mico-32 timer */
  10.141 +mico_status MicoTimerStop(MicoTimerCtx_t *ctx);
  10.142 +
  10.143 +
  10.144 +/*
  10.145 + * Reads timer-count snapshot; snapshot value is returned
  10.146 + * as function return value
  10.147 + */
  10.148 +unsigned int MicoTimerSnapshot(MicoTimerCtx_t *ctx);
  10.149 +
  10.150 +
  10.151 +#ifdef __cplusplus
  10.152 +};
  10.153 +#endif /* __cplusplus */
  10.154 +
  10.155 +
  10.156 +#endif /*MICO32_MICOTIMER_HEADER_FILE */
  10.157 +
    11.1 diff -r 000000000000 -r 396b0bd970d3 drivers/peripheral.mk
    11.2 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 +++ b/drivers/peripheral.mk	Fri Aug 13 10:49:23 2010 +0100
    11.4 @@ -0,0 +1,9 @@
    11.5 +#---------------------------------------------------------
    11.6 +# Identify source-paths for this device's driver-sources,
    11.7 +# compiled when building the library
    11.8 +#---------------------------------------------------------
    11.9 +LIBRARY_C_SRCS	+= MicoTimer.c	\
   11.10 +		MicoTimerService.c
   11.11 +
   11.12 +LIBRARY_ASM_SRCS += 
   11.13 +
    12.1 diff -r 000000000000 -r 396b0bd970d3 drivers/service/MicoTimerService.c
    12.2 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 +++ b/drivers/service/MicoTimerService.c	Fri Aug 13 10:49:23 2010 +0100
    12.4 @@ -0,0 +1,248 @@
    12.5 +/****************************************************************************
    12.6 +**
    12.7 +**  Name: MicoTimerService.c
    12.8 +**
    12.9 +**  Description:
   12.10 +**        Implements timer service functionality:
   12.11 +**               -- registering a timer as a system timer (64-bit)
   12.12 +**                  and retrieving the system tick
   12.13 +**
   12.14 +**               -- registering a timer as a "lookup-able" device
   12.15 +**                  (user does not have to work with these functions)                  
   12.16 +**
   12.17 +**  $Revision: $
   12.18 +**
   12.19 +** Disclaimer:
   12.20 +**
   12.21 +**   This source code is intended as a design reference which
   12.22 +**   illustrates how these types of functions can be implemented.  It
   12.23 +**   is the user's responsibility to verify their design for
   12.24 +**   consistency and functionality through the use of formal
   12.25 +**   verification methods.  Lattice Semiconductor provides no warranty
   12.26 +**   regarding the use or functionality of this code.
   12.27 +**
   12.28 +** --------------------------------------------------------------------
   12.29 +**
   12.30 +**                     Lattice Semiconductor Corporation
   12.31 +**                     5555 NE Moore Court
   12.32 +**                     Hillsboro, OR 97214
   12.33 +**                     U.S.A
   12.34 +**
   12.35 +**                     TEL: 1-800-Lattice (USA and Canada)
   12.36 +**                          (503)268-8001 (other locations)
   12.37 +**
   12.38 +**                     web:   http://www.latticesemi.com
   12.39 +**                     email: techsupport@latticesemi.com
   12.40 +**
   12.41 +** --------------------------------------------------------------------------
   12.42 +**
   12.43 +**  Change History (Latest changes on top)
   12.44 +**
   12.45 +**  Ver    Date        Description
   12.46 +** --------------------------------------------------------------------------
   12.47 +**
   12.48 +**  3.0   Mar-25-2008  Added Header
   12.49 +**
   12.50 +**---------------------------------------------------------------------------
   12.51 +*****************************************************************************/
   12.52 +
   12.53 +#include "MicoTimerService.h"
   12.54 +#include "MicoUtils.h"
   12.55 +#include "MicoMacros.h"
   12.56 +#include "MicoInterrupts.h"
   12.57 +#include "LookupServices.h"
   12.58 +
   12.59 +
   12.60 +#ifdef __cplusplus
   12.61 +extern "C"
   12.62 +{
   12.63 +#endif /* __cplusplus */
   12.64 +
   12.65 +
   12.66 +/******************************************************************************
   12.67 + * Type-definitions and manifest constants and structures                     *
   12.68 + ******************************************************************************/
   12.69 +typedef struct st_ActivityListEntry{
   12.70 +    void                    *ctx;
   12.71 +    MicoSysTimerActivity_t  activity;
   12.72 +}ActivityListEntry_t;
   12.73 +
   12.74 +
   12.75 +/******************************************************************************
   12.76 + * data memebers                                                              *
   12.77 + ******************************************************************************/
   12.78 +static ActivityListEntry_t      s_SysTimerActivity   = {0,0};
   12.79 +static MicoTimerCtx_t           *s_MicoSystemTimer   = 0;
   12.80 +static unsigned long long int   s_MicoCPUTicks;
   12.81 +static unsigned int             s_MicoSysTicks;
   12.82 +
   12.83 +#ifdef __cplusplus
   12.84 +}
   12.85 +#endif /* __cplusplus */
   12.86 +
   12.87 +/******************************************************************************
   12.88 + * debug routines                                                             *
   12.89 + ******************************************************************************/
   12.90 +#ifdef _MICO_TIMER_SERVICES_DEBUG_ENABLED_
   12.91 +
   12.92 +void DumpMicoTimerServicesActivityList()
   12.93 +{
   12.94 +    /* ToDo */
   12.95 +}
   12.96 +
   12.97 +
   12.98 +void DumpMicoTimerServicesRegisteredTimers()
   12.99 +{
  12.100 +    /* ToDo */
  12.101 +}
  12.102 +
  12.103 +#endif
  12.104 +
  12.105 +
  12.106 +/******************************************************************************
  12.107 + * system-timer ISR                                                           *
  12.108 + ******************************************************************************/
  12.109 +static void MicoTimerServicesSysTimerISR(void *pContext)
  12.110 +{
  12.111 +    MicoSysTimerActivity_t activity;
  12.112 +
  12.113 +    /* increment CPU ticks */
  12.114 +    s_MicoCPUTicks += s_MicoSysTicks;
  12.115 +
  12.116 +    /* if there's an activity registered for system-tick, invoke it */
  12.117 +    if(s_SysTimerActivity.activity != 0){
  12.118 +        activity = s_SysTimerActivity.activity;
  12.119 +        activity(s_SysTimerActivity.ctx);
  12.120 +    };
  12.121 +
  12.122 +    return;
  12.123 +}
  12.124 +
  12.125 +
  12.126 +
  12.127 +/******************************************************************************
  12.128 + * Initializes TimerServices                                                  *
  12.129 + ******************************************************************************/
  12.130 +static void MicoTimerServicesInit()
  12.131 +{
  12.132 +    static int s_Initialized = 0;
  12.133 +    if(s_Initialized == 0) {
  12.134 +        s_Initialized = 1;
  12.135 +        s_SysTimerActivity.activity = 0;
  12.136 +        s_MicoSystemTimer           = 0;
  12.137 +        s_MicoCPUTicks              = 0;
  12.138 +    }
  12.139 +}
  12.140 +
  12.141 +
  12.142 +/******************************************************************************
  12.143 + * registers a system-timer if one isn't already registered..                 *
  12.144 + ******************************************************************************/
  12.145 +MicoTimerCtx_t* RegisterSystemTimer(MicoTimerCtx_t *pTimer, unsigned int TicksInMS)
  12.146 +{
  12.147 +	MicoTimerServicesInit();
  12.148 +
  12.149 +    /* 
  12.150 +     * If there's a system-timer registered, don't modify it but simply
  12.151 +     * return its context information
  12.152 +     */
  12.153 +    if(s_MicoSystemTimer != 0)
  12.154 +        return(s_MicoSystemTimer);
  12.155 +
  12.156 +    /*
  12.157 +     * there's none, so register this one as the system-timer
  12.158 +     */
  12.159 +    if(pTimer != 0){
  12.160 +        s_MicoSystemTimer = pTimer;
  12.161 +        if(TicksInMS == 0)
  12.162 +            TicksInMS = 1;
  12.163 +        s_MicoSysTicks = (TicksInMS * (MICO32_CPU_CLOCK_MHZ/1000));
  12.164 +        MicoTimerStart( s_MicoSystemTimer,
  12.165 +                        MicoTimerServicesSysTimerISR,
  12.166 +                        0,
  12.167 +                        s_MicoSysTicks-1,
  12.168 +                        1);
  12.169 +    }
  12.170 +
  12.171 +    return(s_MicoSystemTimer);
  12.172 +}
  12.173 +
  12.174 +
  12.175 +
  12.176 +/******************************************************************************
  12.177 + * get cpu-ticks                                                              *
  12.178 + ******************************************************************************/
  12.179 +void MicoGetCPUTicks(unsigned long long int *ticks)
  12.180 +{
  12.181 +    /* 
  12.182 +     * We need to get a finer resolution than the system-tick and also
  12.183 +     * account for a possible roll-over just after we read the snaphot.
  12.184 +     * We're definitely not going to be exact on the dot but we'll be
  12.185 +     * pretty darn close; higher the clock-speed, less the error (in
  12.186 +     * seconds).
  12.187 +     */
  12.188 +    unsigned long long int cpuTicks = 0;
  12.189 +    unsigned int intrMask;
  12.190 +    unsigned int snapshot;
  12.191 +
  12.192 +    if(s_MicoSystemTimer != 0) {
  12.193 +
  12.194 +        /* disable interrupts and read the gross resolution tick-count */
  12.195 +        intrMask = MicoDisableInterrupts();
  12.196 +        cpuTicks = s_MicoCPUTicks;
  12.197 +
  12.198 +
  12.199 +        /* read the snapshot to get a finer tuning */
  12.200 +        snapshot = MicoTimerSnapshot(s_MicoSystemTimer);
  12.201 +
  12.202 +
  12.203 +        /* 
  12.204 +         * Since the timer is an external peripheral over a bus, there may be
  12.205 +         * contention and we may not get the right reading.  So allow another
  12.206 +         * interrupt if it happened, to make our tick-reading as accurate
  12.207 +         * as possible.
  12.208 +         */
  12.209 +        MicoEnableInterrupt(s_MicoSystemTimer->intrLevel);
  12.210 +
  12.211 +
  12.212 +        /* we're done; decide what our reading should be */
  12.213 +        MicoDisableInterrupts();
  12.214 +        if(cpuTicks == s_MicoCPUTicks)
  12.215 +            cpuTicks += (s_MicoSysTicks - snapshot -1);
  12.216 +        else
  12.217 +            cpuTicks = s_MicoCPUTicks;
  12.218 +
  12.219 +
  12.220 +        /* restore interrupts */
  12.221 +        MicoEnableInterrupts(intrMask);
  12.222 +    }
  12.223 +
  12.224 +    if(ticks != 0)
  12.225 +        *ticks = cpuTicks;
  12.226 +
  12.227 +    return;
  12.228 +}
  12.229 +
  12.230 +
  12.231 +/******************************************************************************
  12.232 + * Registers a periodic-activity (system-timer ticks)                         *
  12.233 + *----------------------------------------------------------------------------*
  12.234 + * System-timer must exist for this to function correctly.                    *
  12.235 + ******************************************************************************/
  12.236 +void MicoRegisterActivity(MicoSysTimerActivity_t activity, void *ctx)
  12.237 +{
  12.238 +	MicoTimerServicesInit();
  12.239 +
  12.240 +    if(s_MicoSystemTimer == 0)
  12.241 +        return;
  12.242 +
  12.243 +    MicoDisableInterrupt(s_MicoSystemTimer->intrLevel);
  12.244 +
  12.245 +    s_SysTimerActivity.ctx      = ctx;
  12.246 +    s_SysTimerActivity.activity = activity;
  12.247 +
  12.248 +    MicoEnableInterrupt(s_MicoSystemTimer->intrLevel);
  12.249 +
  12.250 +    return;
  12.251 +}
  12.252 +
    13.1 diff -r 000000000000 -r 396b0bd970d3 drivers/service/MicoTimerService.h
    13.2 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 +++ b/drivers/service/MicoTimerService.h	Fri Aug 13 10:49:23 2010 +0100
    13.4 @@ -0,0 +1,116 @@
    13.5 +/****************************************************************************
    13.6 +**
    13.7 +**  Name: MicoTimerService.h
    13.8 +**
    13.9 +**  Description:
   13.10 +**        Implements timer service functionality:
   13.11 +**               -- registering a timer as a system timer (64-bit)
   13.12 +**                  and retrieving the system tick
   13.13 +**
   13.14 +**               -- registering a timer as a "lookup-able" device
   13.15 +**                  (user does not have to work with these functions)                  
   13.16 +**
   13.17 +**  $Revision: $
   13.18 +**
   13.19 +** Disclaimer:
   13.20 +**
   13.21 +**   This source code is intended as a design reference which
   13.22 +**   illustrates how these types of functions can be implemented.  It
   13.23 +**   is the user's responsibility to verify their design for
   13.24 +**   consistency and functionality through the use of formal
   13.25 +**   verification methods.  Lattice Semiconductor provides no warranty
   13.26 +**   regarding the use or functionality of this code.
   13.27 +**
   13.28 +** --------------------------------------------------------------------
   13.29 +**
   13.30 +**                     Lattice Semiconductor Corporation
   13.31 +**                     5555 NE Moore Court
   13.32 +**                     Hillsboro, OR 97214
   13.33 +**                     U.S.A
   13.34 +**
   13.35 +**                     TEL: 1-800-Lattice (USA and Canada)
   13.36 +**                          (503)268-8001 (other locations)
   13.37 +**
   13.38 +**                     web:   http://www.latticesemi.com
   13.39 +**                     email: techsupport@latticesemi.com
   13.40 +**
   13.41 +** --------------------------------------------------------------------------
   13.42 +**
   13.43 +**  Change History (Latest changes on top)
   13.44 +**
   13.45 +**  Ver    Date        Description
   13.46 +** --------------------------------------------------------------------------
   13.47 +**
   13.48 +**  3.0   Mar-25-2008  Added Header
   13.49 +**
   13.50 +**---------------------------------------------------------------------------
   13.51 +*****************************************************************************/
   13.52 +
   13.53 +
   13.54 +#ifndef MICO32_TIMERSERVICE_HEADER_FILE
   13.55 +#define MICO32_TIMERSERVICE_HEADER_FILE
   13.56 +
   13.57 +#include "MicoTypes.h"
   13.58 +#include "MicoTimer.h"
   13.59 +
   13.60 +
   13.61 +#ifdef __cplusplus
   13.62 +extern "C"
   13.63 +{
   13.64 +#endif /* __cplusplus */
   13.65 +
   13.66 +
   13.67 +/******************************************************************************
   13.68 + * Data Structures/types                                                      *
   13.69 + ******************************************************************************/
   13.70 +typedef void (* MicoSysTimerActivity_t) ( void *);
   13.71 +
   13.72 +
   13.73 +
   13.74 +/******************************************************************************
   13.75 + * functions                                                                  *
   13.76 + ******************************************************************************/
   13.77 +
   13.78 +/* 
   13.79 + * Registers system-tick periodic activity
   13.80 + *  Arguments;
   13.81 + *      MicoSysTimerActivity_t: activity function pointer as described
   13.82 + *      by the prototype.
   13.83 + *      void *ctx: pointer to user-data that will be passed back on
   13.84 + *      system-tick.
   13.85 + */
   13.86 +void MicoRegisterActivity(MicoSysTimerActivity_t activity, void *ctx);
   13.87 +
   13.88 +
   13.89 +/* 
   13.90 + * Retrieves 64-bit tick count, if a system-timer is registered.
   13.91 + * Else, it returns 0.
   13.92 + */
   13.93 +void MicoGetCPUTicks(unsigned long long int *ticks);
   13.94 +
   13.95 +
   13.96 +/* 
   13.97 + * Registers system-timer if one isn't already registered.  Once registered,
   13.98 + * you cannot register some other timer as a the system timer.  You can
   13.99 + * always stop the timer using LatticeMico32 device-driver routine
  13.100 + * and bring the system-timer to a halt.
  13.101 + *  Arguments:
  13.102 + *      MicoTimerCtx_t *ctx: LatticeMico32 Timer instance information
  13.103 + *      structure (context) that should be used as the system timer.
  13.104 + *      unsigned int TickInMS: system-tick value in milli-seconds.
  13.105 + *  Return Value:
  13.106 + *      MicoTimerCtx_t *: LatticeMico32 timer instance information structure
  13.107 + *      of the timer being used as the system-timer.  If there is no system
  13.108 + *      timer, it returns 0.
  13.109 + */
  13.110 +MicoTimerCtx_t* RegisterSystemTimer(MicoTimerCtx_t *ctx, unsigned int TickInMS);
  13.111 +
  13.112 +
  13.113 +
  13.114 +#ifdef __cplusplus
  13.115 +};
  13.116 +#endif /* __cplusplus */
  13.117 +
  13.118 +
  13.119 +#endif
  13.120 +
    14.1 diff -r 000000000000 -r 396b0bd970d3 rtl/verilog/timer.v
    14.2 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 +++ b/rtl/verilog/timer.v	Fri Aug 13 10:49:23 2010 +0100
    14.4 @@ -0,0 +1,351 @@
    14.5 +// =============================================================================
    14.6 +//                           COPYRIGHT NOTICE
    14.7 +// Copyright 2006 (c) Lattice Semiconductor Corporation
    14.8 +// ALL RIGHTS RESERVED
    14.9 +// This confidential and proprietary software may be used only as authorised by
   14.10 +// a licensing agreement from Lattice Semiconductor Corporation.
   14.11 +// The entire notice above must be reproduced on all authorized copies and
   14.12 +// copies may only be made to the extent permitted by a licensing agreement from
   14.13 +// Lattice Semiconductor Corporation.
   14.14 +//
   14.15 +// Lattice Semiconductor Corporation        TEL : 1-800-Lattice (USA and Canada)
   14.16 +// 5555 NE Moore Court                            408-826-6000 (other locations)
   14.17 +// Hillsboro, OR 97124                     web  : http://www.latticesemi.com/
   14.18 +// U.S.A                                   email: techsupport@latticesemi.com
   14.19 +// =============================================================================/
   14.20 +//                         FILE DETAILS
   14.21 +// Project          : LM32 Timer
   14.22 +// File             : timer.v
   14.23 +// Title            : Timer component core file
   14.24 +// Dependencies     : None
   14.25 +// Version          : 7.0
   14.26 +//                  : Initial Release
   14.27 +// Version          : 7.0SP2, 3.0
   14.28 +//                  : No Change
   14.29 +// =============================================================================
   14.30 +`ifndef TIMER_FILE
   14.31 +`define TIMER_FILE
   14.32 +module timer #(
   14.33 +   parameter PERIOD_NUM   = 20,//decimal
   14.34 +   parameter PERIOD_WIDTH = 16,//decimal
   14.35 +   parameter WRITEABLE_PERIOD  = 1,
   14.36 +   parameter READABLE_SNAPSHOT = 1,
   14.37 +   parameter START_STOP_CONTROL = 1,
   14.38 +   parameter TIMEOUT_PULSE = 1,
   14.39 +   parameter WATCHDOG = 0)
   14.40 +             (
   14.41 +             //slave port
   14.42 +             S_ADR_I,    //32bits
   14.43 +             S_DAT_I,    //32bits
   14.44 +             S_WE_I,
   14.45 +             S_STB_I,
   14.46 +             S_CYC_I,
   14.47 +             S_CTI_I,
   14.48 +             S_BTE_I,
   14.49 +             S_LOCK_I,
   14.50 +             S_SEL_I,
   14.51 +             S_DAT_O,    //32bits
   14.52 +             S_ACK_O,
   14.53 +             S_RTY_O,
   14.54 +             S_ERR_O,
   14.55 +             S_INT_O,
   14.56 +             RSTREQ_O,   //resetrequest, only used when WatchDog enabled
   14.57 +             TOPULSE_O,  //timeoutpulse, only used when TimeOutPulse enabled
   14.58 +             //system clock and reset
   14.59 +             CLK_I,
   14.60 +             RST_I
   14.61 +             );
   14.62 +
   14.63 +   input  [31:0]  S_ADR_I;
   14.64 +   input  [31:0]  S_DAT_I;
   14.65 +   input          S_WE_I;
   14.66 +   input          S_STB_I;
   14.67 +   input          S_CYC_I;
   14.68 +   input  [2:0]   S_CTI_I;
   14.69 +   input          S_LOCK_I;
   14.70 +   input  [3:0]   S_SEL_I;
   14.71 +   input  [1:0]   S_BTE_I;
   14.72 +   output [31:0]  S_DAT_O;
   14.73 +   output         S_ACK_O;
   14.74 +   output         S_INT_O;
   14.75 +   output         S_RTY_O;
   14.76 +   output         S_ERR_O;
   14.77 +   output         RSTREQ_O;
   14.78 +   output         TOPULSE_O;
   14.79 +
   14.80 +   input          CLK_I;
   14.81 +   input          RST_I;
   14.82 +
   14.83 +   parameter  UDLY     = 1;
   14.84 +   parameter  ST_IDLE  = 2'b00;
   14.85 +   parameter  ST_CNT   = 2'b01;
   14.86 +   parameter  ST_STOP  = 2'b10;
   14.87 +
   14.88 +   reg  dw00_cs;
   14.89 +   reg  dw04_cs;
   14.90 +   reg  dw08_cs;
   14.91 +   reg  dw0c_cs;
   14.92 +   reg  reg_wr;
   14.93 +   reg  reg_rd;
   14.94 +   reg  [31:0] latch_s_data;
   14.95 +   reg  [1:0]  reg_04_data;
   14.96 +   reg         reg_run;
   14.97 +   reg         reg_stop;
   14.98 +   reg         reg_start;
   14.99 +   reg [1:0]   status;
  14.100 +   reg  [PERIOD_WIDTH-1:0] internal_counter;
  14.101 +   reg  [PERIOD_WIDTH-1:0] reg_08_data;
  14.102 +   reg  s_ack_dly;
  14.103 +   reg  s_ack_2dly;
  14.104 +   reg  s_ack_pre;
  14.105 +   reg  RSTREQ_O;
  14.106 +   reg  TOPULSE_O;
  14.107 +   reg  reg_to;
  14.108 +
  14.109 +   wire        reg_cont;
  14.110 +   wire        reg_ito;
  14.111 +   wire [1:0]  read_00_data;
  14.112 +   wire [1:0]  read_04_data;
  14.113 +   wire [PERIOD_WIDTH-1:0] read_08_data;
  14.114 +   wire [PERIOD_WIDTH-1:0] read_0c_data;
  14.115 +   wire [PERIOD_WIDTH-1:0] reg_period;
  14.116 +   wire        S_ACK_O;
  14.117 +   wire [31:0] S_DAT_O;
  14.118 +   wire        S_INT_O;
  14.119 +
  14.120 +   assign     S_RTY_O = 1'b0;
  14.121 +   assign     S_ERR_O = 1'b0;
  14.122 +
  14.123 +   always @(posedge CLK_I or posedge RST_I)
  14.124 +     if(RST_I)
  14.125 +       latch_s_data     <= #UDLY 32'h0;
  14.126 +     else
  14.127 +       latch_s_data     <= #UDLY S_DAT_I;
  14.128 +
  14.129 +   always @(posedge CLK_I or posedge RST_I)
  14.130 +     if(RST_I)
  14.131 +       begin
  14.132 +          dw00_cs   <= #UDLY 1'b0;
  14.133 +          dw04_cs   <= #UDLY 1'b0;
  14.134 +          dw08_cs   <= #UDLY 1'b0;
  14.135 +          dw0c_cs   <= #UDLY 1'b0;
  14.136 +       end
  14.137 +     else
  14.138 +       begin
  14.139 +          dw00_cs   <= #UDLY (!(|S_ADR_I[5:2]));
  14.140 +          dw04_cs   <= #UDLY (S_ADR_I[5:2] == 4'h1);
  14.141 +          dw08_cs   <= #UDLY (S_ADR_I[5:2] == 4'h2);
  14.142 +          dw0c_cs   <= #UDLY (S_ADR_I[5:2] == 4'h3);
  14.143 +       end
  14.144 +
  14.145 +   always @(posedge CLK_I or posedge RST_I)
  14.146 +     if(RST_I)
  14.147 +       begin
  14.148 +          reg_wr    <= #UDLY 1'b0;
  14.149 +          reg_rd    <= #UDLY 1'b0;
  14.150 +       end
  14.151 +     else
  14.152 +       begin
  14.153 +          reg_wr    <= #UDLY S_WE_I && S_STB_I && S_CYC_I;
  14.154 +          reg_rd    <= #UDLY !S_WE_I && S_STB_I && S_CYC_I;
  14.155 +       end
  14.156 +
  14.157 +   generate
  14.158 +   if (START_STOP_CONTROL == 1)
  14.159 +
  14.160 +   always @(posedge CLK_I or posedge RST_I)
  14.161 +     if(RST_I)
  14.162 +       begin
  14.163 +          status                   <= #UDLY ST_IDLE;
  14.164 +          internal_counter         <= #UDLY 'h0;
  14.165 +       end
  14.166 +     else
  14.167 +       case(status)
  14.168 +         ST_IDLE:
  14.169 +           begin
  14.170 +             if(reg_wr && dw08_cs)
  14.171 +               begin
  14.172 +               internal_counter <= #UDLY (WRITEABLE_PERIOD == 1) ? latch_s_data : reg_period;
  14.173 +               end
  14.174 +             else if(reg_start && !reg_stop)
  14.175 +               begin
  14.176 +               status           <= #UDLY ST_CNT;
  14.177 +               if(|reg_period)
  14.178 +                 internal_counter <= #UDLY reg_period - 1;
  14.179 +               end
  14.180 +           end
  14.181 +         ST_CNT:
  14.182 +           begin
  14.183 +              if(reg_stop && (|internal_counter))
  14.184 +                status           <= #UDLY ST_STOP;
  14.185 +              else if(reg_wr && dw08_cs)
  14.186 +                begin
  14.187 +                internal_counter <= #UDLY (WRITEABLE_PERIOD == 1) ? latch_s_data : reg_period;
  14.188 +                if(!(|internal_counter) && !reg_cont)
  14.189 +                   status        <= #UDLY ST_IDLE;
  14.190 +                end
  14.191 +              else if(!(|internal_counter))
  14.192 +                begin
  14.193 +                if(!reg_cont)
  14.194 +                  begin
  14.195 +                  status         <= #UDLY ST_IDLE;
  14.196 +                  end
  14.197 +                internal_counter <= #UDLY reg_period;
  14.198 +                end
  14.199 +              else
  14.200 +                internal_counter <= #UDLY internal_counter - 1;
  14.201 +           end
  14.202 +         ST_STOP:
  14.203 +           begin
  14.204 +              if(reg_start && !reg_stop)
  14.205 +                status           <= #UDLY ST_CNT;
  14.206 +              else if(reg_wr && dw08_cs)
  14.207 +                begin
  14.208 +                internal_counter <= #UDLY (WRITEABLE_PERIOD == 1) ? latch_s_data : reg_period;
  14.209 +                end
  14.210 +           end
  14.211 +        default:
  14.212 +           begin
  14.213 +              status               <= #UDLY ST_IDLE;
  14.214 +              internal_counter     <= #UDLY 'h0;
  14.215 +           end
  14.216 +       endcase
  14.217 +   endgenerate
  14.218 +
  14.219 +
  14.220 +   generate
  14.221 +   if (START_STOP_CONTROL == 0)
  14.222 +   always @(posedge CLK_I or posedge RST_I)
  14.223 +     if(RST_I)
  14.224 +       internal_counter         <= #UDLY 'h0;
  14.225 +     else if ((reg_wr && dw08_cs) && (WATCHDOG == 1) || !(|internal_counter))
  14.226 +       internal_counter         <= #UDLY reg_period;
  14.227 +     else
  14.228 +       internal_counter         <= #UDLY internal_counter - 1;
  14.229 +   endgenerate
  14.230 +
  14.231 +   always @(posedge CLK_I or posedge RST_I)
  14.232 +     if(RST_I)
  14.233 +       reg_to        <= #UDLY 1'b0;
  14.234 +     else if(reg_wr && dw00_cs && (!latch_s_data[0]))
  14.235 +       reg_to        <= #UDLY 1'b0;
  14.236 +     else if(!(|internal_counter) && reg_ito && ((START_STOP_CONTROL == 0) || reg_run))
  14.237 +       reg_to        <= #UDLY 1'b1;
  14.238 +
  14.239 +   generate
  14.240 +   if (START_STOP_CONTROL == 1)
  14.241 +   always @(posedge CLK_I or posedge RST_I)
  14.242 +     if(RST_I)
  14.243 +       reg_run       <= #UDLY 1'b0;
  14.244 +     else if(reg_stop)
  14.245 +       reg_run       <= #UDLY 1'b0;
  14.246 +     else if(reg_start)
  14.247 +       reg_run       <= #UDLY 1'b1;
  14.248 +     else
  14.249 +       reg_run       <= #UDLY (status !== ST_IDLE);
  14.250 +   endgenerate
  14.251 +
  14.252 +   assign read_00_data   = (START_STOP_CONTROL == 1) ? {reg_run,reg_to} : {1'b1,reg_to};
  14.253 +
  14.254 +   //reg_04:control
  14.255 +   assign      {reg_cont,reg_ito} = reg_04_data;
  14.256 +
  14.257 +   generate
  14.258 +   if (START_STOP_CONTROL == 1)
  14.259 +   always @(posedge CLK_I or posedge RST_I)
  14.260 +     if(RST_I)
  14.261 +       reg_stop      <= #UDLY 1'b0;
  14.262 +     else if(reg_wr && dw04_cs)
  14.263 +       begin
  14.264 +          if(latch_s_data[3] && !latch_s_data[2] && !reg_stop)
  14.265 +            reg_stop  <= #UDLY 1'b1;
  14.266 +          else if(!latch_s_data[3] && latch_s_data[2] && reg_stop)
  14.267 +            reg_stop  <= #UDLY 1'b0;
  14.268 +       end
  14.269 +
  14.270 +   always @(posedge CLK_I or posedge RST_I)
  14.271 +     if(RST_I)
  14.272 +       reg_start     <= #UDLY 1'b0;
  14.273 +     else if(reg_wr && dw04_cs && !reg_run)
  14.274 +       reg_start     <= #UDLY latch_s_data[2];
  14.275 +     else
  14.276 +       reg_start     <= #UDLY 1'b0;
  14.277 +   endgenerate
  14.278 +
  14.279 +   always @(posedge CLK_I or posedge RST_I)
  14.280 +     if(RST_I)
  14.281 +       reg_04_data   <= #UDLY 2'h0;
  14.282 +     else if(reg_wr && dw04_cs)
  14.283 +       reg_04_data   <= #UDLY latch_s_data[1:0];
  14.284 +
  14.285 +   assign  read_04_data   = reg_04_data;
  14.286 +
  14.287 +  generate
  14.288 +  if (WRITEABLE_PERIOD == 1) begin
  14.289 +    assign reg_period     = reg_08_data;
  14.290 +    assign read_08_data   = reg_08_data;
  14.291 +    always @(posedge CLK_I or posedge RST_I) begin
  14.292 +     if (RST_I)
  14.293 +       reg_08_data   <= #UDLY PERIOD_NUM;
  14.294 +     else if ((reg_wr && dw08_cs) && (START_STOP_CONTROL == 1))
  14.295 +       reg_08_data   <= #UDLY latch_s_data;
  14.296 +	 end
  14.297 +   end
  14.298 +  else
  14.299 +     assign reg_period   = PERIOD_NUM;
  14.300 +  endgenerate
  14.301 +
  14.302 +  generate
  14.303 +  if (READABLE_SNAPSHOT == 1)
  14.304 +    assign  read_0c_data   = internal_counter;
  14.305 +  endgenerate
  14.306 +
  14.307 +   always @(posedge CLK_I or posedge RST_I)
  14.308 +     if(RST_I)
  14.309 +       begin
  14.310 +          s_ack_pre     <= #UDLY 1'b0;
  14.311 +          s_ack_dly     <= #UDLY 1'b0;
  14.312 +          s_ack_2dly    <= #UDLY 1'b0;
  14.313 +       end
  14.314 +     else
  14.315 +       begin
  14.316 +          s_ack_pre     <= #UDLY S_STB_I && S_CYC_I;
  14.317 +          s_ack_dly     <= #UDLY s_ack_pre;
  14.318 +          s_ack_2dly    <= #UDLY s_ack_dly;
  14.319 +       end
  14.320 +
  14.321 +   assign S_ACK_O = s_ack_dly & !s_ack_2dly;
  14.322 +   assign S_DAT_O  = (dw00_cs & !S_WE_I & S_STB_I)                     ? read_00_data :
  14.323 +                     (dw04_cs & !S_WE_I & S_STB_I)                     ? read_04_data :
  14.324 +                     (dw08_cs & !S_WE_I & S_STB_I & WRITEABLE_PERIOD)  ? read_08_data :
  14.325 +                     (dw0c_cs & !S_WE_I & S_STB_I & READABLE_SNAPSHOT) ? read_0c_data :
  14.326 +                                                                         32'h0;
  14.327 +   assign S_INT_O  = reg_to;
  14.328 +
  14.329 +  generate
  14.330 +  if (WATCHDOG == 1)
  14.331 +   always @(posedge CLK_I or posedge RST_I) begin
  14.332 +     if(RST_I)
  14.333 +       RSTREQ_O      <= #UDLY 1'b0;
  14.334 +     else if(!(|internal_counter) && !RSTREQ_O && ((START_STOP_CONTROL == 0) || reg_run))
  14.335 +       RSTREQ_O      <= #UDLY 1'b1;
  14.336 +     else
  14.337 +       RSTREQ_O      <= #UDLY 1'b0;
  14.338 +	 end
  14.339 +  endgenerate
  14.340 +
  14.341 +
  14.342 +  generate
  14.343 +  if (TIMEOUT_PULSE == 1)
  14.344 +   //TOPULSE_O
  14.345 +   always @(posedge CLK_I or posedge RST_I)
  14.346 +     if(RST_I)
  14.347 +       TOPULSE_O     <= #UDLY 1'b0;
  14.348 +     else if(!(|internal_counter) && !TOPULSE_O && ((START_STOP_CONTROL == 0) || reg_run))
  14.349 +       TOPULSE_O     <= #UDLY 1'b1;
  14.350 +     else
  14.351 +       TOPULSE_O     <= #UDLY 1'b0;
  14.352 +  endgenerate
  14.353 +
  14.354 +endmodule
  14.355 +`endif
    15.1 diff -r 000000000000 -r 396b0bd970d3 timer.xml
    15.2 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 +++ b/timer.xml	Fri Aug 13 10:49:23 2010 +0100
    15.4 @@ -0,0 +1,55 @@
    15.5 +<?xml version="1.0" encoding="UTF-8"?>
    15.6 +<Component Name="timer" Text="Timer" Hide="false" Type="IO" Ver="3.0" Help="timer\document\timer.htm">
    15.7 +	<MasterSlavePorts>
    15.8 +		<SlavePort Prefix="S" Name="S Port" Type="DATA"/>
    15.9 +	</MasterSlavePorts>
   15.10 +        <ClockPort Name="CLK_I " Description="Clock     one"/>
   15.11 +        <ResetPort Name="RST_I " Description="Reset"/>
   15.12 +	<Interrupt Name="S_INT_O" Active="high" IRQ=""/>
   15.13 +	<Defines>
   15.14 +        	<Define Name="TIMER_DEFINED" Value="1" />
   15.15 +                <Define Name="TIMER_BASE_ADDRESS" Type="base_address" Value="0x0000000"/>
   15.16 +        </Defines>
   15.17 +	<DeviceDriver InitRoutine="MicoTimerInit" StructName="MicoTimerCtx_t">
   15.18 +                <DDInclude Include="LookupServices.h"/>
   15.19 +                <DDstruct>
   15.20 +                        <DDSElem MemberName = "name" MemberType = "const char*" Type="Parm" Value="InstanceName" Format = "string"/>
   15.21 +			<DDSElem MemberName = "base" MemberType = "unsigned int" Type="Parm" Value="BASE_ADDRESS" />
   15.22 +                        <DDSElem MemberName = "lookupReg" MemberType = "DeviceReg_t" Type="uninitialized" Value=""/>			
   15.23 +                        <DDSElem MemberName = "intrLevel" MemberType = "unsigned int" Type="Interrupt" Value="IRQ_LEVEL" />
   15.24 +                        <DDSElem MemberName = "userCtx" MemberType = "void *" Type="uninitialized" Value = "" />
   15.25 +                        <DDSElem MemberName = "callback" MemberType = "void *" Type="uninitialized" Value = "" />
   15.26 +                        <DDSElem MemberName = "prev" MemberType = "void *" Type="uninitialized" Value = "" />
   15.27 +                        <DDSElem MemberName = "next" MemberType = "void *" Type="uninitialized"	Value = "" />
   15.28 +		</DDstruct>
   15.29 +		</DeviceDriver>
   15.30 +      <Files>
   15.31 +	    <File Name="../components/timer/rtl/verilog/timer.v" />
   15.32 +      </Files>
   15.33 +	<Parms>
   15.34 +		<Parm Name="InstanceName"    Value="timer"     Type="string" isiname="true" Text="Instance Name"/>
   15.35 +		<Parm Name="BASE_ADDRESS"    Value="0x80000000" Type="Integer" isba="true" Text="Base Address"/>
   15.36 +		<Parm Name="SIZE"            Value="128"         Type="Integer" issize="true" Text="Size" Enable="false"/>
   15.37 +            <Parm Name="ADDRESS_LOCK" Type="Define" Value="undef" Text="Lock Address"/>
   15.38 +		<Parm Name="DISABLE" Type="Define" Value="undef" isuse="true" Text="Disable Component"/>
   15.39 +		<Parm Name="PERIOD_NUM" Type="Integer" Value="20" Text="Default Reload Ticks" isparm="true"/>
   15.40 +		<Parm Name="PERIOD_WIDTH" Type="Integer" Value="32" ValueRange="1-32" Text="Counter Width" isparm="true"/>
   15.41 +		<Parm Name="WRITEABLE_PERIOD" Type="define" Value="def" Text="Writeable Tick Count" isparm="true"/>
   15.42 +		<Parm Name="READABLE_SNAPSHOT" Type="define" Value="def" Text="Readable Tick Count" isparm="true"/>
   15.43 +		<Parm Name="START_STOP_CONTROL" Type="define" Value="def" Text="Start Stop Control" isparm="true"/>
   15.44 +		<Parm Name="WATCHDOG" Type="define" Value="undef" Text="WATCHDOG" Hide="true" isparm="true"/>
   15.45 +	</Parms>
   15.46 +      <GUIS Columns="2" Help="component_help\lm32.htm" Name="timer">
   15.47 +            <GUI Widget="Text" Span="1" Name="InstanceName" Width="40"/>
   15.48 +            <GUI Widget="Text" Span="1" Name="BASE_ADDRESS"/>
   15.49 +
   15.50 +            <GUI Widget="Group" Span="1" Name="OPTIONS" Text="Options" Columns="1"/>
   15.51 +            <GUI Widget="Check" Span="1" Name="WRITEABLE_PERIOD"/>
   15.52 +            <GUI Widget="Check" Span="1" Name="READABLE_SNAPSHOT"/>
   15.53 +            <GUI Widget="Check" Span="1" Name="START_STOP_CONTROL"/>
   15.54 +
   15.55 +            <GUI Widget="Group" Span="1" Name="SETTINGS" Text="Settings" Columns="2"/>
   15.56 +            <GUI Widget="Text" Span="1" Name="PERIOD_NUM"/>
   15.57 +            <GUI Widget="Spinner" Span="1" Name="PERIOD_WIDTH"/>
   15.58 +      </GUIS>
   15.59 +</Component>