Machinekit Documentation
HAL Component — UPDOWN
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
updown — Counts up or down, with optional limits and wraparound behavior
SYNOPSIS
updown
USAGE SYNOPSIS
loadrt updown
OR
newinst updown <newinstname> [ pincount=N | iprefix=prefix ] [instanceparamX=X | argX=X ]
( args in [ ] denote possible args and parameters, may not be used in all components )
FUNCTIONS
updown.N.funct ( OR <newinstname>.funct )
Process inputs and update count if necessary
PINS
updown.N.countup bit in ( OR <newinstname>.countup bit in ) - Increment count when this pin goes from 0 to 1
updown.N.countdown bit in ( OR <newinstname>.countdown bit in ) - Decrement count when this pin goes from 0 to 1
updown.N.reset bit in ( OR <newinstname>.reset bit in ) - Reset count when this pin goes from 0 to 1
updown.N.count s32 out ( OR <newinstname>.count s32 out ) - The current count
updown.N.clamp bit io ( OR <newinstname>.clamp bit io ) - If true, then clamp the output to the min and max parameters.
updown.N.wrap bit io ( OR <newinstname>.wrap bit io ) - If true, then wrap around when the count goes above or below the min and max parameters. Note that wrap implies (and overrides) clamp.
updown.N.max s32 io (default: 0x7FFFFFFF) ( OR <newinstname>.max s32 io (default: 0x7FFFFFFF) ) - If clamp or wrap is set, count will never exceed this number
updown.N.min s32 io ( OR <newinstname>.min s32 io ) - If clamp or wrap is set, count will never be less than this number
LICENCE
GPL