Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
TDC core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
TDC core
Commits
edce0bce
Commit
edce0bce
authored
Oct 24, 2011
by
Sebastien Bourdeauducq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demo: ring oscillator frequency measurements
parent
bebb9a61
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
0 deletions
+75
-0
tdc.c
demo/software/demo/tdc.c
+51
-0
tdc.h
demo/software/demo/tdc.h
+24
-0
No files found.
demo/software/demo/tdc.c
0 → 100644
View file @
edce0bce
/*
* Time to Digital Converter demo routines
*
* Copyright (C) 2011 CERN
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* 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 Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <uart.h>
#include <hw/tdc.h>
#include "tdc.h"
static
volatile
struct
TDC_WB
*
tdc
=
(
void
*
)
0xa0000000
;
void
rofreq
()
{
int
channel
;
int
val
;
int
last
;
/* reset into debug mode, so this will always work */
tdc
->
DCTL
=
TDC_DCTL_REQ
;
tdc
->
CS
=
TDC_CS_RST
;
while
(
!
(
tdc
->
DCTL
&
TDC_DCTL_ACK
));
while
(
!
readchar_nonblock
())
{
channel
=
0
;
do
{
tdc
->
FCC
=
TDC_FCC_ST
;
while
(
!
(
tdc
->
FCC
&
TDC_FCC_RDY
));
val
=
tdc
->
FCR
;
printf
(
"Channel %d: %d
\n
"
,
channel
,
val
);
channel
++
;
last
=
tdc
->
CSEL
&
TDC_CSEL_LAST
;
tdc
->
CSEL
=
TDC_CSEL_NEXT
;
}
while
(
!
last
);
printf
(
"
\n
"
);
}
}
demo/software/demo/tdc.h
0 → 100644
View file @
edce0bce
/*
* Time to Digital Converter demo routines
*
* Copyright (C) 2011 CERN
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* 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 Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __TDC_H
#define __TDC_H
void
rofreq
();
#endif
/* __TDC_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment