toggle2nist - toggle button to nist logic
loadrt toggle2nist [count=N|names=name1[,name2...]] |
Toggle2nist can be used with a momentary push button to control a device that has separate on and off inputs and an is-on output. A debounce delay in cycles can be set. (default = 2)
• On a rising edge on pin in when is-on is low: It sets on until is-on becomes high.
• On a rising edge on pin in when is-on is high: It sets off until is-on becomes low.
┐
┌─────xxxxxxxxxxxx┐
┌─────xxxxxxxxxxxx┐
in : └─────┘
xxxxxxxxxxxx└───────────┘
xxxxxxxxxxxx└─────
┐
┌───────────┐
on : └─────┘
└─────────────────────────────────────────
┐
┌───────────┐
off :
└───────────────────────────────────┘
└───────────
┐
┌─────────────────────────────┐
is-on:
└─────────────────┘
└───────────
toggle2nist.N
toggle2nist.N.in bit in
momentary button in
toggle2nist.N.is-on bit in
current state of device
toggle2nist.N.debounce u32 in (default: 2)
debounce delay for ’in’-pin in cycles
toggle2nist.N.on bit out
turn device on
toggle2nist.N.off bit out
turn device off
Anders Wallin, David Mueller
GPL