Reflex VectorIndex

Description

A reflex vector describes the complete response to a raw input.  It is an array of indexes and control fields for reflex commands .  The control fields determine how and when a parameter byte in the indexed command is modified based on a given input.  After a cmdRAW_INPUT command, the reflex propagation routine goes through the vector in sequence, looks up each reflex command , modifies a parameter if necessary, and stuffs each command into the command queue or transmits it via the IIC bus to another module.

Reflex vectors have a 7-bit ID.  Since the ID is 7 bits, only 128 different reflex vectors may be stored in the EEPROM.  Each reflex vector is stored as an array of eight 2-byte records.  The bytes in this record are described below.

Reflex Vector Record Byte 1

(7) LAST (6:0) RFLXCMDX

LAST - flag bit to indicate last command in reflex vector
RFLXCMDX - 7 bit (0-127) command index

A reflex vector may store info for up to 8 commands.  Only those records up to and including the record with its LAST flag set will be processed.  This determines the number of commands (1-8) issued by a reflex.  The reflex propagation routine starts at record 0 in the reflex vector array and executes the command indexed by that record.  When it detects a LAST flag, it stops traversing the vector.  Otherwise, it goes to the next record.  The RFLXCMDX field must index a valid reflex command , otherwise operation is undefined.

Reflex Vector Record Byte 2

(7) ENABLE (6:4) MODCODE (3:0) PARAMX

ENABLE - reserved command enable bit
MODCODE - 3-bit (0-7) parameter modification code
PARAMX - 4-bit (0-15) index of parameter byte to be modified

The ENABLE bit must always be 1.  It is a place-holder for future use.  The MODCODE selects an operation to perform using the input byte(s) and a parameter byte within the indexed reflex command.  The codes and operations are listed in the next section.  The PARAMX field is the 0-based index of the parameter byte within the reflex command.

Parameter Modification Codes

0 - no modification
1 - param = input + param
2 - param = param - input
3 - param = input - param
4 - param = input >> param
5 - param = input * param
6 - param = input * param (2-byte to 1-byte scaled conversion)
7 - all input bytes copied into reflex command (copy starts at param byte)

This table has examples of each parameter modification.  Each case has one or two bytes of input data and a 5-byte reflex command.  The first byte in the command is at index 0.  The last byte in the command is at index 4.  The original command has the indexed parameter byte in bold.  The modified command has the changed bytes in bold.  Each case also has an expression that shows the exact operation which took place.

Input Data Bytes MODCODE PARAMX Original Reflex Cmd Modified Reflex Cmd Operation
99 0 3 2 3 23 0 128 2 3 23 0 128 (none)
40 1 3 2 3 23 3 128 2 3 23 43 128 40+3=43
40 2 4 2 3 23 0 128 2 3 23 0 88 128-40=88
140 3 4 2 3 23 0 128 2 3 23 0 12 140-128=12
40 4 4 2 3 23 0 2 2 3 23 0 10 40>>2=10
40 5 4 2 3 23 0 2 2 3 23 0 80 40*2=80
3 40 6 4 2 3 23 0 17 2 3 23 0 53 ((3*256+40)*17)/256=53
3 40 7 3 2 3 23 0 0 2 3 23 3 40 (0 0) --> (3 40)

version: 1.0, build 80903
© Copyright 1994-2008 Acroname, Inc., Boulder, Colorado.  All rights reserved.