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
4541f38e
Commit
4541f38e
authored
Jul 08, 2019
by
Dimitris Lampridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[doc] wip
parent
87509f75
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
181 additions
and
6 deletions
+181
-6
conf.py
doc/conf.py
+4
-2
index.rst
doc/index.rst
+0
-2
ref_nodes.rst
doc/ref_nodes.rst
+16
-0
usage_clib.rst
doc/usage_clib.rst
+161
-2
No files found.
doc/conf.py
View file @
4541f38e
...
...
@@ -260,16 +260,18 @@ latex_elements = {
'fontpkg'
:
r'''
\setmainfont{Bitstream Charter}
\setsansfont{Lato}
\setmonofont{FreeMono}
\setmonofont
[Scale=0.92]
{FreeMono}
'''
,
# Additional stuff for the LaTeX preamble.
#
# 'preamble' : '
',
'preamble'
:
'
\
setcounter{tocdepth}{3}
'
,
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
'sphinxsetup'
:
'VerbatimColor={rgb}{.97,.98,.97}'
,
}
# Grouping the document tree into LaTeX files. List of tuples
...
...
doc/index.rst
View file @
4541f38e
...
...
@@ -18,5 +18,3 @@ White Rabbit Trigger Distribution documentation
usage_index
ref_nodes
devel
.. todolist::
doc/ref_nodes.rst
View file @
4541f38e
...
...
@@ -9,7 +9,23 @@ Reference Nodes
SPEC150T-based FMC-ADC
======================
.. figure:: graphics/wrtd_ref_design_spec_adc.png
:name: fig-ref_spec_adc
:align: center
:alt: alternate text
:figclass: align-center
SPEC150T-based FMC-ADC reference WRTD Node
.. _svec_ref_tdc_fd:
SVEC-based TDC+FDELAY
=====================
.. figure:: graphics/wrtd_ref_design_svec_list.png
:name: fig-ref_svec_list
:align: center
:alt: alternate text
:figclass: align-center
SVEC-based TDC+FDELAY reference WRTD Node
doc/usage_clib.rst
View file @
4541f38e
...
...
@@ -68,7 +68,8 @@ Functions
status = wrtd_get_attr_bool(wrtd, WRTD_GLOBAL_REP_CAP_ID,
WRTD_ATTR_EVENT_LOG_EMPTY);
if (status != WRTD_SUCCESS) {
/* query the necessary buffer size for the error message */
/* query the necessary buffer size for
the error message */
buf_size = wrtd_get_error(wrtd, NULL, 0, NULL);
/* allocate the buffer */
err_msg = calloc(sizeof(char), buf_size);
...
...
@@ -215,7 +216,8 @@ Functions
/* check if the event log is empty (global attribute) */
status = wrtd_get_attr_bool(wrtd, WRTD_GLOBAL_REP_CAP_ID,
WRTD_ATTR_EVENT_LOG_EMPTY, &log_empty);
WRTD_ATTR_EVENT_LOG_EMPTY,
&log_empty);
/* add a rule with name "rule1" */
status = wrtd_add_rule(wrtd, "rule1");
...
...
@@ -332,6 +334,48 @@ Configuration of an Alarm happens by setting the relevant :ref:`Attributes <attr
.. doxygenfunction:: wrtd_remove_alarm
.. doxygenfunction:: wrtd_remove_all_alarms
.. doxygenfunction:: wrtd_get_alarm_name
.. code-block:: c
:caption: Adding, removing and indexing :ref:`Alarms <alarm>`.
#include <libwrtd.h>
int main(void) {
int i, count;
char rep_cap_id[16];
wrtd_dev *wrtd;
status = wrtd_init("MT01", false, NULL, &wrtd);
/* disable and then remove any declared alarms */
status = wrtd_disable_all_alarms(wrtd);
status = wrtd_remove_all_alarms(wrtd);
/* Add three alarms */
status = wrtd_add_alarm("alarm1");
status = wrtd_add_alarm("alarm2");
status = wrtd_add_alarm("alarm3");
/* Remove the 2nd alarm */
status = wrtd_remove_alarm("alarm2");
/* Get number of defined alarms */
status = wrtd_get_attr_int32(wrtd, WRTD_GLOBAL_REP_CAP_ID,
WRTD_ATTR_ALARM_COUNT, &count);
/* Iterate through alarms and print their names.
This should output:
1: alarm1
2: alarm3
*/
for (i = 0; i < count; i++) {
status = wrtd_get_alarm_name(wrtd, i, 16, rep_cap_id);
printf ("%d: %s\n", i, rep_cap_id);
}
wrtd_close(wrtd);
return 0;
}
.. _api_rule:
...
...
@@ -349,13 +393,128 @@ Configuration of a Rule happens by setting the relevant :ref:`Attributes <attrib
.. doxygenfunction:: wrtd_remove_all_rules
.. doxygenfunction:: wrtd_get_rule_name
.. doxygenfunction:: wrtd_reset_rule_stats
.. code-block:: c
:caption: Adding, removing and indexing :ref:`Rules <rule>`.
#include <libwrtd.h>
int main(void) {
int i, count;
char rep_cap_id[16];
wrtd_dev *wrtd;
status = wrtd_init("MT01", false, NULL, &wrtd);
/* disable and then remove any declared rules */
status = wrtd_disable_all_rules(wrtd);
status = wrtd_remove_all_rules(wrtd);
/* Add three rules */
status = wrtd_add_rule("rule1");
status = wrtd_add_rule("rule2");
status = wrtd_add_rule("rule3");
/* Remove the 2nd rule */
status = wrtd_remove_rule("rule2");
/* Get number of defined rules */
status = wrtd_get_attr_int32(wrtd, WRTD_GLOBAL_REP_CAP_ID,
WRTD_ATTR_RULE_COUNT, &count);
/* Iterate through rules and print their names.
This should output:
1: rule1
2: rule3
*/
for (i = 0; i < count; i++) {
status = wrtd_get_rule_name(wrtd, i, 16, rep_cap_id);
printf ("%d: %s\n", i, rep_cap_id);
}
wrtd_close(wrtd);
return 0;
}
.. code-block:: c
:caption: Basic :ref:`rule` configuration.
#include <libwrtd.h>
int main(void) {
wrtd_dev *wrtd;
status = wrtd_init("MT01", false, NULL, &wrtd);
/* Add a rule */
status = wrtd_add_rule("rule1");
/* Set rule to listen for events coming on local channel
input 1 and generate a message on the network with
event ID "NET0", after adding 500ns to the event timestamp. */
status = wrtd_set_attr_string(wrtd, "rule1",
WRTD_ATTR_RULE_SOURCE, "LC-I1");
status = wrtd_set_attr_string(wrtd, "rule1",
WRTD_ATTR_RULE_DESTINATION, "NET0");
wrtd_tstamp ts = {.seconds = 0, .ns = 500, .frac = 0};
status = wrtd_set_attr_tstamp(wrtd, "rule1",
WRTD_ATTR_RULE_DELAY, &ts);
/* Enable rule */
status = wrtd_set_attr_bool(wrtd, "rule1",
WRTD_ATTR_RULE_ENABLED, True);
wrtd_close(wrtd);
return 0;
}
.. _api_app:
Applications API
----------------
Similar to :ref:`Rules <rule>` and :ref:`Alarms <alarm>`, :ref:`Applications <application>` are also
:ref:`Repeated Capabilities <rep_cap>`. However, they are read-only and, as such, do not possess any
functions to add or remove them. The only provided functionality is that of indexing.
Information retrieval regarding a particular :ref:`application` is performed by by getting the
relevant :ref:`Attributes <attribute>` via the :ref:`api_attr`.
.. doxygenfunction:: wrtd_get_fw_name
.. code-block:: c
:caption: Indexing :ref:`Applications <application>` and version retrieval.
#include <libwrtd.h>
int main(void) {
int i, count, major, minor;
char rep_cap_id[16];
wrtd_dev *wrtd;
status = wrtd_init("MT01", false, NULL, &wrtd);
/* Get number of defined applications */
status = wrtd_get_attr_int32(wrtd, WRTD_GLOBAL_REP_CAP_ID,
WRTD_ATTR_FW_COUNT, &count);
/* Iterate through applications and print their
names and versions. */
for (i = 0; i < count; i++) {
status = wrtd_get_fw_name(wrtd, i, 16, rep_cap_id);
status = wrtd_get_attr_int32(wrtd, rep_cap_id,
WRTD_ATTR_FW_MAJOR_VERSION,
&major);
status = wrtd_get_attr_int32(wrtd, rep_cap_id,
WRTD_ATTR_FW_MINOR_VERSION,
&minor);
printf ("%d: %s, v%d.%d\n", i, rep_cap_id, major, minor);
}
wrtd_close(wrtd);
return 0;
}
.. _IVI: http://ivifoundation.org
...
...
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