Commit 23236075 authored by Alessandro Rubini's avatar Alessandro Rubini

zio.h and docs: introduce ZIO_CSET_SELF_TIMED

The flag is need so self-timed devices, like a TDC, can have their
trigger continuously armed (see next commit).
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
Acked-by: 's avatarFederico Vaga <federico.vaga@gmail.com>
parent 90c6f046
......@@ -1769,14 +1769,20 @@ or used by the developer are:
@cindex ZIO_CSET_TYPE_DIGITAL
@cindex ZIO_CSET_TYPE_ANALOG
@cindex ZIO_CSET_TYPE_TIME
@cindex ZIO_CSET_SELF_TIMED
@cindex ZIO_DIR_INPUT
@cindex ZIO_DIR_OUTPUT
@item unsigned long flags
Currently only the type: @code{ZIO_CSET_TYPE_DIGITAL},
@code{ZIO_CSET_TYPE_ANALOG} or @code{ZIO_CSET_TYPE_TIME} (other types
A few flags, the most important being the type of cset:
@code{ZIO_CSET_TYPE_DIGITAL},
@code{ZIO_CSET_TYPE_ANALOG} or @code{ZIO_CSET_TYPE_TIME} (other types
may be added in the future, we reserved for 8 of them), OR'd with
@t{ZIO_DIR_INPUT} or @t{ZIO_DIR_OUTPUT}.
@t{ZIO_DIR_INPUT} or @t{ZIO_DIR_OUTPUT}. Then, if you set
@t{ZIO_CSET_SELF_TIMED} for an input cset, the trigger will be
immediately armed, so the driver can fill blocks when its time
arrives -- for self-timed csets you should use the default
trigger, which is transparent to user and device actions.
@cindex channel template
@item struct zio_channel *chan_template
......
......@@ -202,14 +202,26 @@ struct zio_cset {
/* first 4bit are reserved for zio object universal flags */
enum zio_cset_flags {
ZIO_CSET_TYPE = 0x70, /* digital, analog, time, TBD... */
ZIO_CSET_TYPE_DIGITAL = 0x00,
ZIO_CSET_TYPE_ANALOG = 0x10,
ZIO_CSET_TYPE_TIME = 0x20,
ZIO_CSET_CHAN_TEMPLATE = 0x80, /* 1 if channels from template */
ZIO_CSET_TYPE = 0x70, /* digital, analog, time, ... */
ZIO_CSET_TYPE_DIGITAL = 0x00,
ZIO_CSET_TYPE_ANALOG = 0x10,
ZIO_CSET_TYPE_TIME = 0x20,
ZIO_CSET_CHAN_TEMPLATE = 0x80, /* 1 if channels from template */
ZIO_CSET_SELF_TIMED = 0x100, /* for trigger use (see docs) */
};
/* Check the flags so we know whether to arm immediately or not */
static inline int zio_cset_is_self_timed(struct zio_cset *cset)
{
unsigned long flags = cset->flags;
if ((flags & ZIO_DIR) == ZIO_DIR_OUTPUT)
return 0;
if (flags & ZIO_CSET_SELF_TIMED)
return 1;
return 0;
}
/*
* zio_channel -- an individual channel within the cset
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment