MATRIX_KB(9) | HAL Component | MATRIX_KB(9) |
matrix_kb - Convert integers to HAL pins. Optionally scan a matrix of IO ports to create those integers.
loadrt matrix_kb config=RxCs,RxCs... names=name1,name2...
Creates a component configured for R rows and N columns of matrix keyboard.
If the s option is specified then a set of output rows will be cyclically toggled, and a set of input columns will be scanned.
The names parameter is optional, but if used then the HAL pins and functions will use the specified names rather than the default ones. This can be useful for readbility and 2-pass HAL parsing.
There must be no spaces in the parameter lists.
This component was written to convert matrix keyboard scancodes into HAL pins. However, it might also find uses in converting integers from 0 to N into N HAL pins.
The component can work in two ways, and the HAL pins created vary according to mode.
In the default mode the component expects to be given a scan code from a separate driver but could be any integer from any source. Most typically this will be the keypad scancode from a Mesa 7I73. The default codes for keyup and keydown are based on the Mesa 7I73 specification with 0x40 indicating a keydown and 0x80 a keyup event. If using the 7I73 it is important to match the keypad size jumpers with the HAL component. Valid configs for the 7I73 are 4x8 and 8x8. Note that the component will only work properly with the version 12 (0xC) 7I73 firmware. The firmware version is visible on the component parameters in HAL.
In the optional scan-generation mode the matrix_kb.N.keycode pin changes to an output pin and a set of output row pins and input column pins are created. These need to be connected to physical inputs and outputs to scan the matrix and return values to HAL. Note the negative-logic parameter described below, this will need to be set on the most common forms of inputs which float high when unconnected.
In both modes a set of HAL output pins are created corresponding to each node of the matrix.
2013-03-24 | LinuxCNC Documentation |