Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
wr2rf-vme
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
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
wr2rf-vme
Commits
3e22dbf5
Commit
3e22dbf5
authored
Mar 23, 2021
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libwr2rf: add api and command for vtu output reset
parent
144caedf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
0 deletions
+45
-0
board.c
software/libwr2rf/board.c
+21
-0
api.h
software/libwr2rf/libwr2rf/api.h
+4
-0
wr2rf.c
software/libwr2rf/wr2rf.c
+20
-0
No files found.
software/libwr2rf/board.c
View file @
3e22dbf5
...
...
@@ -581,6 +581,27 @@ int libwr2rf_vtu_output_shaper(struct libwr2rf_dev *dev, unsigned id,
return
0
;
}
int
libwr2rf_vtu_output_reset
(
struct
libwr2rf_dev
*
dev
,
unsigned
id
,
unsigned
rst
)
{
unsigned
csr_addr
;
unsigned
v
;
csr_addr
=
libwr2rf_vtu_csr
(
id
);
if
(
csr_addr
==
0
)
return
-
1
;
v
=
libwr2rf_read16
(
dev
,
csr_addr
);
if
(
rst
)
v
|=
WR2RF_INIT_RF_CH_REGS_CH_CSR_TRIG_RST
;
else
v
&=
~
WR2RF_INIT_RF_CH_REGS_CH_CSR_TRIG_RST
;
libwr2rf_write16
(
dev
,
csr_addr
,
v
);
return
0
;
}
static
unsigned
trig_id_to_addr
(
unsigned
id
)
{
switch
(
id
)
{
...
...
software/libwr2rf/libwr2rf/api.h
View file @
3e22dbf5
...
...
@@ -142,6 +142,10 @@ int libwr2rf_vtu_output_enable(struct libwr2rf_dev *dev, unsigned id,
int
libwr2rf_vtu_output_shaper
(
struct
libwr2rf_dev
*
dev
,
unsigned
id
,
unsigned
en
);
/* Hold trigger output in reset or not. */
int
libwr2rf_vtu_output_reset
(
struct
libwr2rf_dev
*
dev
,
unsigned
id
,
unsigned
rst
);
/* Program a single pulse on TU ID after B clock cycles. */
int
libwr2rf_vtu_program_pulse
(
struct
libwr2rf_dev
*
dev
,
unsigned
id
,
uint64_t
b
);
...
...
software/libwr2rf/wr2rf.c
View file @
3e22dbf5
...
...
@@ -3190,6 +3190,25 @@ api_vtu_output_shaper (struct libwr2rf_dev *dev, int argc, char **argv)
printf
(
"failed (status=%d)
\n
"
,
res
);
}
static
void
api_vtu_output_reset
(
struct
libwr2rf_dev
*
dev
,
int
argc
,
char
**
argv
)
{
int
res
;
unsigned
long
id
;
unsigned
long
enable
;
if
(
argc
!=
3
)
{
printf
(
"usage: %s VTU-ID RST
\n
"
,
argv
[
0
]);
return
;
}
id
=
strtoul
(
argv
[
1
],
NULL
,
0
);
enable
=
strtoul
(
argv
[
2
],
NULL
,
0
);
res
=
libwr2rf_vtu_output_reset
(
dev
,
id
,
enable
);
if
(
res
!=
0
)
printf
(
"failed (status=%d)
\n
"
,
res
);
}
static
void
cmd_help
(
struct
libwr2rf_dev
*
dev
,
int
argc
,
char
**
argv
);
struct
cmds
{
...
...
@@ -3211,6 +3230,7 @@ static struct cmds cmds[] =
{
"api-vtu-output-delay"
,
api_vtu_output_delay
,
"set vtu output delay"
},
{
"api-vtu-output-enable"
,
api_vtu_output_enable
,
"enable vtu output delay"
},
{
"api-vtu-output-shaper"
,
api_vtu_output_shaper
,
"enable vtu output shaper"
},
{
"api-vtu-output-reset"
,
api_vtu_output_reset
,
"force reset vtu output"
},
{
"api-vtu-softstart"
,
api_vtu_softstart
,
"software start of a vtu"
},
{
"api-vtu-softstop"
,
api_vtu_softstop
,
"software stop of a vtu"
},
{
"api-vtu-reset"
,
api_vtu_reset
,
"control vtu reset"
},
...
...
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