= Instruction sets There are / will be two instruction sets for the fnordlicht: - script instruction set - remote control instruction set = Remote Control Instruction Set The following commands are planned: - stop: stop all scripts, fadings etc, retain current led settings. - enter_dynamic_mode: script instructions can be pushed into a fifo and will be deleted after they are executed. Allows great control for the central controller. - enter_static_mode: scripts can bo loaded into the fnordlicht and they will be executed till the controller is reprogrammed. - send_instruction: (dynamic mode) push an additional instruction to the fifo - send_script: (static mode) reprogram the static script. fnordlicht must be stopped before. - and probably some more ... = Script Instruction Set Proposed command format: 4 byte commands, first byte opcode, three bytes parameters. The following commands are planned: - fade_channel: (op: fade) fade a channel to a target value with the given speed. - fade_channels: (op: mfade) fades all three channels to target value, with the current speed settings - set_channel: (op: set) sets a channel directly to a target value - set_channels / set_rgb: (op: mset) sets a fixed rgb value - sleep: do nothing for a number of cycles - goto: (static mode) jumps to a script instruction. - stop: (static mode) stop current script - wait: wait for one / for all channels to finish fading We consider allowing multiple static scripts (one for each channel). Advance is easier configuration, but the number for possible instructions is decreased. In this case, we also need: - stop: (static mode) stops a channel script - start: (static mode) starts a channel script == Thougts about the implementation of the SIS For each script, there is a script handler address. The default script handler gets the next instruction and calls the appropriate procedure. If this procedure does last longer then one pwm cycle, it replaces the default script handler by its own address and restores it, after it is finished. One could use a stack for this, but this is probably overkill for now. : vim: tw=75