Machinekit

Machinekit

Machinekit Documentation

HAL Component — MULTICLICK

INSTANTIABLE COMPONENTS — General

All instantiable components can be loaded in two manners

Using loadrt with or without count= | names= parameters as per legacy components
Using newinst, which names the instance and allows further parameters and arguments
primarily pincount= which can set the number of pins created for that instance (where applicable)

NAME

multiclick — Single-, double-, triple-, and quadruple-click detector

SYNOPSIS

multiclick

USAGE SYNOPSIS

loadrt multiclick
OR
newinst multiclick <newinstname> [ pincount=N | iprefix=prefix ] [instanceparamX=X | argX=X ]

( args in [ ] denote possible args and parameters, may not be used in all components )

DESCRIPTION

A click is defined as a rising edge on the 'in' pin, followed by the 'in' pin being True for at most 'max-hold-ns' nanoseconds, followed by a falling edge.

A double-click is defined as two clicks, separated by at most 'max-space-ns' nanoseconds with the 'in' pin in the False state.

I bet you can guess the definition of triple- and quadruple-click.

You probably want to run the input signal through a debounce component before feeding it to the multiclick detector, if the input is at all noisy.

The '*-click' pins go high as soon as the input detects the correct number of clicks.

The '*-click-only' pins go high a short while after the click, after the click separator space timeout has expired to show that no further click is coming. This is useful for triggering halui MDI commands.

FUNCTIONS

multiclick.N.funct ( OR <newinstname>.funct )

Detect single-, double-, triple-, and quadruple-clicks

PINS

multiclick.N.in bit in ( OR <newinstname>.in bit in ) - The input line, this is where we look for clicks.

multiclick.N.single-click bit out ( OR <newinstname>.single-click bit out ) - Goes high briefly when a single-click is detected on the 'in' pin.

multiclick.N.single-click-only bit out ( OR <newinstname>.single-click-only bit out ) - Goes high briefly when a single-click is detected on the 'in' pin and no second click followed it.

multiclick.N.double-click bit out ( OR <newinstname>.double-click bit out ) - Goes high briefly when a double-click is detected on the 'in' pin.

multiclick.N.double-click-only bit out ( OR <newinstname>.double-click-only bit out ) - Goes high briefly when a double-click is detected on the 'in' pin and no third click followed it.

multiclick.N.triple-click bit out ( OR <newinstname>.triple-click bit out ) - Goes high briefly when a triple-click is detected on the 'in' pin.

multiclick.N.triple-click-only bit out ( OR <newinstname>.triple-click-only bit out ) - Goes high briefly when a triple-click is detected on the 'in' pin and no fourth click followed it.

multiclick.N.quadruple-click bit out ( OR <newinstname>.quadruple-click bit out ) - Goes high briefly when a quadruple-click is detected on the 'in' pin.

multiclick.N.quadruple-click-only bit out ( OR <newinstname>.quadruple-click-only bit out ) - Goes high briefly when a quadruple-click is detected on the 'in' pin and no fifth click followed it.

multiclick.N.state s32 out ( OR <newinstname>.state s32 out )

multiclick.N.invert-input bit io (default: false) ( OR <newinstname>.invert-input bit io (default: false) ) - If false (the default), clicks start with rising edges. If true, clicks start with falling edges.

multiclick.N.max-hold-ns u32 io (default: 250000000) ( OR <newinstname>.max-hold-ns u32 io (default: 250000000) ) - If the input is held down longer than this, it’s not part of a multi-click. (Default 250,000,000 ns, 250 ms.)

multiclick.N.max-space-ns u32 io (default: 250000000) ( OR <newinstname>.max-space-ns u32 io (default: 250000000) ) - If the input is released longer than this, it’s not part of a multi-click. (Default 250,000,000 ns, 250 ms.)

multiclick.N.output-hold-ns u32 io (default: 100000000) ( OR <newinstname>.output-hold-ns u32 io (default: 100000000) ) - Positive pulses on the output pins last this long. (Default 100,000,000 ns, 100 ms.)

LICENCE

GPL