Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
Mock Turtle
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
Mock Turtle
Commits
da111fea
Commit
da111fea
authored
Jul 31, 2015
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrtd:out: add dead_time configuration support
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
93b405ea
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
6 deletions
+26
-6
wrtd-common.h
applications/wrtd/include/wrtd-common.h
+1
-0
libwrtd-output.c
applications/wrtd/lib/libwrtd-output.c
+23
-5
rt-fd.c
applications/wrtd/rt/fd/rt-fd.c
+1
-0
wrtd-out-config.c
applications/wrtd/tools/wrtd-out-config.c
+1
-1
No files found.
applications/wrtd/include/wrtd-common.h
View file @
da111fea
...
...
@@ -72,6 +72,7 @@
#define WRTD_CMD_FD_PING 0xa
#define WRTD_CMD_FD_BASE_TIME 0xb
#define WRTD_CMD_FD_CHAN_DEAD_TIME 0xc
#define WRTD_REP_ACK_ID 0x100
...
...
applications/wrtd/lib/libwrtd-output.c
View file @
da111fea
...
...
@@ -569,17 +569,35 @@ int wrtd_out_pulse_width_set(struct wrtd_node *dev, unsigned int output,
/**
* It set the dead time for a given output channel. so, it applies on all
* triggers assigned to the given output channel
* triggers assigned to the given output channel.
*
* The function will round the value, so it may happen that you read back a
* different value. The reason is that the RT application measure the dead
* time in ticks, which are 8ns steps. So this function will internally
* convert the dead time in ticks.
* @param[in] dev device token
* @param[in] output index (0-based) of output channel
* @param[in] dead_time_
ps dead time in pic
o-seconds
* @param[in] dead_time_
ns dead time in nan
o-seconds
* @return 0 on success, -1 on error and errno is set appropriately
*/
int
wrtd_out_dead_time_set
(
struct
wrtd_node
*
dev
,
unsigned
int
output
,
uint64_t
dead_time_
p
s
)
uint64_t
dead_time_
n
s
)
{
errno
=
EWRTD_NO_IMPLEMENTATION
;
return
-
1
;
struct
wrnc_msg
msg
=
wrnc_msg_init
(
5
);
uint32_t
id
,
seq
=
0
,
ticks
=
dead_time_ns
/
8
;
if
(
output
>=
FD_NUM_CHANNELS
)
{
errno
=
EWRTD_INVALID_CHANNEL
;
return
-
1
;
}
dead_time_ns
/=
8
;
/* Convert in ticks*/
id
=
WRTD_CMD_FD_CHAN_DEAD_TIME
;
wrnc_msg_header
(
&
msg
,
&
id
,
&
seq
);
wrnc_msg_uint32
(
&
msg
,
&
output
);
wrnc_msg_uint32
(
&
msg
,
&
ticks
);
return
wrtd_out_trivial_request
(
dev
,
&
msg
);
}
...
...
applications/wrtd/rt/fd/rt-fd.c
View file @
da111fea
...
...
@@ -1307,6 +1307,7 @@ static inline void do_control()
_CMD
(
WRTD_CMD_FD_READ_HASH
,
ctl_read_hash
)
_CMD
(
WRTD_CMD_FD_BASE_TIME
,
ctl_base_time
)
_CMD
(
WRTD_CMD_FD_PING
,
ctl_ping
)
_CMD
(
WRTD_CMD_FD_CHAN_DEAD_TIME
,
ctl_chan_set_dead_time
)
default:
break
;
}
...
...
applications/wrtd/tools/wrtd-out-config.c
View file @
da111fea
...
...
@@ -372,7 +372,7 @@ static int wrtd_cmd_dead_time(struct wrtd_node *wrtd, int output,
return
-
1
;
}
/* Get
a trigger
*/
/* Get
the dead time
*/
parse_delay
(
argv
[
0
],
&
dtime
);
return
wrtd_out_dead_time_set
(
wrtd
,
output
,
dtime
);
...
...
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