Files
DSView-decoders/counter/__pycache__/pd.cpython-36.pyc
T

44 lines
3.5 KiB
Plaintext
Raw Normal View History

2026-06-18 10:45:25 +08:00
3
ªw/dDã@s8ddlZedƒ\ZZedƒ\ZZZGdd„dejƒZdS)éNééc @seZdZdZdZdZdZdZdZdgZ gZ
dgZ d d
d d d
œfZ ddddd
œfZ
dKZddeffddeffddefffZddd dLd#d$œd%d&d'd(d)œd*d+d"dMd,d$œd-d.d'd/d)œd0d1d'd2d)œd3d4d'd5d)œd6d7d8dNd:d$œfZd;d<„Zd=d>„Zd?d@„ZdAdB„ZdCdD„ZdEdF„ZdGS)OÚDecoderrZcounterÚCounterz Edge counterz&Count the number of edges in a signal.zgplv2+ÚlogicZUtilÚdataÚDataz Data lineZdec_counter_chan_data)ÚidÚnameÚdescÚidnÚresetÚResetz
Reset lineZdec_counter_opt_chan_resetÚ
edge_countú
Edge countÚ
word_countú
Word countÚ
word_resetú
Word resetZ edge_countsZEdgesZ word_countsZWordsZ word_resetsz Word resetsÚ data_edgezEdges to count (data)ÚanyÚrisingÚfallingZdec_counter_opt_data_edge)r r ÚdefaultÚvaluesr ÚdividerzCount divider (word width)rZdec_counter_opt_divider)r r rr Ú
reset_edgez"Edge which clears counters (reset)Zdec_counter_opt_reset_edgeÚedge_offz$Edge counter value after start/resetZdec_counter_opt_edge_offÚword_offz$Word counter value after start/resetZdec_counter_opt_word_offÚ dead_cyclesz"Ignore this many edges after resetZdec_counter_opt_dead_cyclesÚstart_with_resetzAssume decode starts with resetÚnoÚyesZ dec_counter_opt_start_with_resetcCs |jƒdS)N)r
)Úself©r$ú.C:/Program Files/DSView/decoders\counter\pd.pyÚ__init__@szDecoder.__init__cCsdS)Nr$)r#r$r$r%r
Csz
Decoder.resetcCs|tjkr||_dS)N)ÚsrdÚSRD_CONF_SAMPLERATEÚ
samplerate)r#ÚkeyÚvaluer$r$r%ÚmetadataFs
zDecoder.metadatacCs|jtjƒ|_dS)N)Úregisterr'Ú
OUTPUT_ANNÚout_ann)r#r$r$r%ÚstartJsz
Decoder.startcCs|j||j|j||gƒdS)N)ÚputÚ samplenumr/)r#ÚclsÚssZannlistr$r$r%ÚputcMsz Decoder.putccCsÆddddœ}|jd}|jd}|dkr,d}|jd}t||ig}|jtƒ}|rlt|ƒ}|jt||iƒt|jd ƒ}d} t|jd
ƒ}
d} |jd d kr®t|jd
ƒ} nd} �x |j|ƒ|j}
|oÖ|j d|>@�r$t|jd ƒ}|
} t|jd
ƒ}
|
} |j
t |
ddddgƒt|jd
ƒ} q¶| �r<| d8} |
} |
} q¶| dk�rJd} | dk�rXd} |d7}|j
t | dj
|ƒgƒ|
} |t|jd ƒ}|r¶||dkr¶|
d7}
|j
t| dj
|
ƒgƒ|
} q¶WdS)NÚrÚfÚe)rrrrrrrrrr r"réz