Skip to content

Commit

Permalink
examples, usc: add minimal threshold example
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Klotzbuecher <mk@mkio.de>
  • Loading branch information
kmarkus committed Jun 5, 2020
1 parent 1bbfec1 commit 57fa66f
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions examples/usc/threshold.usc
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
--- Example usc using threshold
--
-- this usc connects a ramp to the threshold
--

return bd.system
{
imports = {
"stdtypes", "ptrig", "lfds_cyclic", "threshold", "ramp_double", "mqueue"
},

blocks = {
{ name="thres", type="threshold" },
{ name="ramp", type="ramp_double" },
{ name="trigger", type="std_triggers/ptrig" },
{ name="mq", type="mqueue" },
},


configurations = {
{
name="thres",
config = { threshold = 99.99 }
},
{
name="ramp",
config = { slope=0.1 }
},
{
name="trigger",
config = {
period = {sec=0, usec=10000 }, -- 100 Hz
trig_blocks = {
{ b="#ramp" },
{ b="#thres"} }
}
},
{ name="mq", config = {
mq_id="threshold_events",
type_name = 'struct thres_event', buffer_len = 8 }
},

},

connections = {
{ src="ramp.out", tgt="thres.in" },
{ src="thres.event", tgt="mq" },
},
}

0 comments on commit 57fa66f

Please sign in to comment.