Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Trigger Distribution
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
White Rabbit Trigger Distribution
Commits
176ebcd8
Commit
176ebcd8
authored
Jan 16, 2019
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libwrtd: add adcin device configuration.
parent
9729516c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
3 deletions
+25
-3
Makefile
software/lib/Makefile
+1
-1
libwrtd-devices.c
software/lib/libwrtd-devices.c
+24
-2
No files found.
software/lib/Makefile
View file @
176ebcd8
...
...
@@ -14,7 +14,7 @@ LIB = libwrtd.a
OBJS
:=
libwrtd-base.o libwrtd-devices.o libwrtd-attributes.o libwrtd-rules.o
INCFLAGS
=
-I
.
-I
../include
-I
$(TRTL)
/include
-I
$(TRTL)
/lib
\
-I
../firmware/tdc
-I
../firmware/tdc
-I
../../dependencies/fmc-adc-100m14b4cha-gw/hdl/rtl/wb_gen/
CFLAGS
+=
-fno-strict-aliasing
$(INCFLAGS)
CFLAGS
+=
-Wall
-Werror
...
...
software/lib/libwrtd-devices.c
View file @
176ebcd8
...
...
@@ -7,6 +7,7 @@
#include "libwrtd.h"
#include "libwrtd-private.h"
#include "hw/fmctdc-direct.h"
#include "fmc_adc_alt_trigout.h"
/* FIXME: duplicated macro. */
#define BASE_DP_TDC_DIRECT 0x8000
...
...
@@ -33,7 +34,26 @@ static enum wrtd_status wrtd_tdc_configure(struct wrtd_dev *wrtd,
addr
=
wrtd
->
roots
[
cpu
].
devices_io_addr
[
dev
]
+
BASE_DP_TDC_DIRECT
+
DR_REG_CHAN_ENABLE
;
printf
(
"wrtd: write 0x%08x at 0x%08x on cpu#%u
\n
"
,
val
,
addr
,
cpu
);
printf
(
"wrtd: tdc write 0x%08x at 0x%08x on cpu#%u
\n
"
,
val
,
addr
,
cpu
);
status
=
wrtd_msg_writew
(
wrtd
,
cpu
,
addr
,
1
,
&
val
);
return
status
;
}
static
enum
wrtd_status
wrtd_adcin_configure
(
struct
wrtd_dev
*
wrtd
,
unsigned
cpu
,
unsigned
dev
,
unsigned
int
ch_mask
)
{
enum
wrtd_status
status
;
uint32_t
val
;
uint32_t
addr
;
assert
((
ch_mask
&
0x1f
)
==
ch_mask
);
/* Just set the enable bits. */
val
=
(
ch_mask
&
0x0f
)
|
((
ch_mask
&
0x10
)
<<
4
);
addr
=
wrtd
->
roots
[
cpu
].
devices_io_addr
[
dev
]
+
ALT_TRIGOUT_ENABLE
;
printf
(
"wrtd: adcin write 0x%08x at 0x%08x on cpu#%u
\n
"
,
val
,
addr
,
cpu
);
status
=
wrtd_msg_writew
(
wrtd
,
cpu
,
addr
,
1
,
&
val
);
return
status
;
}
...
...
@@ -83,7 +103,7 @@ static const struct wrtd_mt_device adcin_device =
.
dir
=
wrtd_input
,
.
nbr_chs
=
5
,
.
channels
=
adcin_channels
,
.
configure
=
wrtd_
none
_configure
.
configure
=
wrtd_
adcin
_configure
};
static
const
struct
wrtd_mt_device
adcout_device
=
...
...
@@ -98,6 +118,7 @@ static const struct wrtd_mt_device adcout_device =
static
const
struct
wrtd_mt_config
configs
[]
=
{
/* TDC + FD board. */
{
.
mt_app_id
=
0x115790de
,
.
nbr_cpus
=
2
,
...
...
@@ -121,6 +142,7 @@ static const struct wrtd_mt_config configs[] =
}
}
},
/* ADC board. */
{
.
mt_app_id
=
0x115790d1
,
.
nbr_cpus
=
1
,
...
...
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