Package: ctp
ctp==============================================================================Script for compiling a protocol file to a binary file which can be uploaded tothe component tester's SD card. This was made since hand compiling everyprotocol quickly gets tedious, and especially for longer protocols it is veryeasy to make errors. Therefore I made a python script to automate the process.usage:ctp2.py [-h | --help] [-o FILE] [-v | --verify] [INFILE | -c | --code]-h --help       show this-o FILE         specify output file [default: ./out.tst]-v --verify     show if compilation was successful but make no output file-c --code       read code from stdin, instead of a filePROTOCOL SYNTAX==============================================================================A protocol should be described as a series of commands with arguments.Each command must be on a seperate line. Lines beginning with a `#` and linesonly consisting of whitespace are skipped. Case (even mixed case liKe tHiS)does not matter.Protocols will be run until a `CHECK` command finds that the pin state doesnot match what was specified. If this happens the component has failed the test.If the protocol is run through without an error then the component has passedthe test.COMMANDS------------------------------------------------------------------------------#### VINVIN <PINS...>Specifies that `PINS...` should be used as positive voltage supply.Valid pin values are: 5, 14, 15, 16.#### GNDGND <PINS...>Specifies that `PINS..` should be used as ground.Valid pin values are: 8, 12.#### DELAYDELAY <TIME>Delays further execution by `TIME` milliseconds (ms).*NOTE*: If a delay is larger than 65535 ms is needed, it must be split intomultiple `DELAY` calls.#### SETSET (<VALUE> <PINS...>)...Sets the `PINS...` to the value specified by ``VALUE``.`VALUE` is either `ON` or `OFF` (without the qoutation marks).`PINS...` is a list of pin numbers (between 1 and 16) seperated by a space.Any pins which have not been given a value will remain in their current state(either `ON` or `OFF`). Furthermore the `REST` keyword may be used to specifyany pins which have not yet been given a value. Note however that no pins maybe specified after the `REST` keyword, but it is *not* necessary to have pins*before* `REST`.##### Some examples:SET ON 1 2This will set pins 1 and 2 to `ON`. The rest of the pins will stay in theircurrent state (`ON` or `OFF`).SET ON 1 2 OFF 3This will set pins 1 and 2 to ON and pin 3 to `OFF`. The rest of the pins willstay in their current state (`ON` or `OFF`).SET ON 1 2 OFF RESTThis will set pins 1 and 2 to `ON` and every other pin to `OFF`.SET ON RESTThis will set every pin to `ON` since no pin was specified before `REST`.#### CHECKCHECK (<VALUE> <PINS...>)...Checks whether `PINS...` have the value specified by `VALUE`.`VALUE` is either `ON` or `OFF` (without the qoutation marks).`PINS...` is a list of pin numbers (between 1 and 16) seperated by a space.The way `CHECK` is called is similar to `SET` except that a value must bespecified for all pins. However, it is still possible to use the `REST` keywordto represent every pin which have not been given a value.*NOTE*: If a pin has previously been set to `ON` with a call to `VIN` or `SET`,then `CHECK` will assume it should be `ON`, regardless of what is specified bythe arguments.##### Some examples:CHECK ON 1 OFF RESTThis will check whether pin 1 is `ON` and the rest of the pins are `OFF`.CHECK ON 1 2 3 OFF RESTThis will check whether pin 1, 2 and 3 are `ON` and the rest of the pins are`OFF`.CHECK OFF 1 2 OFF RESTThis will check whether pin 1 and 2 are `ON` and the rest of the pins are `OFF`.EXAMPLES------------------------------------------------------------------------------The following program will use pin 16 as vin and pin 8 as ground. It willthen set pins 1 and 2 to `ON` and check if pin 3 is `ON` and everything else(except for pin 16 since that is vin and pins 1 and 2 since we set theseto `ON` previously) is `OFF`.GND 8VIN 16SET ON 1 2CHECK ON 3 OFF RESTThe following program will use pin 16 as vin and pins 8 and 12 as ground.It will then set pin 2 to `ON`, wait 2 seconds, then set it to `OFF` again. Itthen checks if all pins (except for pin 16 since that is vin) are `OFF`:GND 8 12VIN 16SET ON 2DELAY 2000SET OFF 2CHECK OFF REST