]> rtime.felk.cvut.cz Git - pes-rpp/rpp-test-sw.git/commitdiff
Update the documentation of several commands
authorMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 26 Jul 2013 13:51:17 +0000 (15:51 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 26 Jul 2013 13:51:17 +0000 (15:51 +0200)
commands/cmd_dac.c
commands/cmd_din.c
commands/cmd_emac.c
commands/cmd_fray.c
commands/cmd_motor_example.c

index 781e21c53a099109abd4faab040c87caadb6f349..6bbdd089591d959881ff0df1d6acb7ba0d023d09 100644 (file)
@@ -156,24 +156,25 @@ int cmd_do_dac_pin_set_voltage(cmd_io_t *cmd_io, const struct cmd_des *des, char
 /** Descriptor of command for dac pin setup */
 cmd_des_t const cmd_des_dac_pin_setup = {
        0, CDESM_OPCHR|CDESM_WR,
-       "dacpinsetup#","Enables or disables DAC pin number. 1 means enable, 0 means disable.",
+       "dacpinenable#","Enables or disables a DAC pin",
        "=== Command syntax ===\n"
        "\n"
-       "   dacpinsetupPIN:VALUE \n"
+       "   dacpinenable<PIN>:<VALUE> \n"
        "where\n"
-       "* PIN is in range 1-4\n"
-       "* VALUE is in range 0-1\n"
+       "* <PIN> is a number in range 1-4\n"
+       "* <VALUE> is a number 0 (disable) or 1 (enable)\n"
        "\n"
        "=== Description ===\n"
        "\n"
-       "Command for enabling and disabling of DAC pin.\n"
+       "Command for enabling or disabling of a DAC pin.\n"
        "\n"
-       "Command always prints actual state of selected pin.\n"
+       "Command always prints the actual state of the selected pin.\n"
        "\n"
        "=== Example ===\n"
        "\n"
-       "   --> dacpinsetup1:1\n"
-       "Enables pin DAC1 and print its actual state (which will be 1)\n",
+       "   --> dacpinenable1:1\n"
+       "\n"
+       "Enables pin DAC1 and prints its actual state (which will be 1)\n",
        CMD_HANDLER(cmd_do_dac_pin_setup), (void *)&cmd_list_dac
 };
 
@@ -183,24 +184,25 @@ cmd_des_t const cmd_des_dac_pin_set_val = {
        "dacpinval#","Sets raw value to pin DAC.",
        "=== Command syntax ===\n"
        "\n"
-       "   dacpinvalPIN:VALUE \n"
+       "   dacpinval<PIN>:<VALUE>\n"
        "where\n"
-       "* PIN is in range 1-4\n"
-       "* VALUE is in range 0-4095\n"
+       "* <PIN> is a number in range 1-4\n"
+       "* <VALUE> is a number in range 0-4095\n"
        "\n"
        "=== Description ===\n"
        "\n"
-       "Command sets raw value on DAC pin. This value sets\n"
-       "voltage on the selected pin according to the formula\n"
-       "described in datasheet. \n"
+       "This command writes a raw value to DAC register that controls the DAC\n"
+       "output voltage according to the formula described in the datasheet.\n"
+       "<PIN> parameter selects which DAC pin to use.\n"
        "\n"
-       "Command always prints actually configured raw value of\n"
-       "selected pin. Real raw value can not be read out of the pin.\n"
+       "Command always prints the written raw value of the selected pin. There\n"
+       "is no way how to read the value out of the register.\n"
        "\n"
        "=== Example ===\n"
        "\n"
        "   --> dacpinval1:4095\n"
-       "Set pin DAC1 to 12V, prints actual raw value (which will be 4095)\n",
+       "\n"
+       "Set pin DAC1 voltage to 12V, and prints the value (4095).\n",
        CMD_HANDLER(cmd_do_dac_pin_set_val), (void *)&cmd_list_dac
 };
 
@@ -210,25 +212,25 @@ cmd_des_t const cmd_des_dac_pin_set_voltage = {
        "dacpinvoltage#","Sets voltage in mV to pin DAC.",
        "=== Command syntax ===\n"
        "\n"
-       "   dacpinvoltage:VALUE\n"
+       "   dacpinvoltage<PIN>:<VALUE>\n"
        "where\n"
-       "* PIN is in range 1-4\n"
-       "* VALUE is in range 0-12000\n"
+       "* <PIN> is a number in range 1-4\n"
+       "* <VALUE> is a number in range 0-12000\n"
        "\n"
        "=== Description ===\n"
        "\n"
-       "Command sets voltages on DAC pin.\n"
+       "This command sets the voltage on a DAC pin.\n"
        "\n"
-       "Command always prints actually configured voltage of\n"
-       "selected pin. Real value can not be read out of the pin.\n"
+       "The command always prints the actually set voltage of selected pin.\n"
+       "There is no way how to read the value back out of the pin.\n"
        "\n"
        "=== Example ===\n"
        "\n"
        "   --> dacpinvoltage1:8000\n"
-       "Set pin DAC1 to 8V, prints actual voltage (which will be 8000)\n"
+       "Sets pin DAC1 to 8V, prints the actual voltage (8000)\n"
        "\n"
        "   --> dacpinvoltage2:500\n"
-       "Set pin DAC2 to 500mV, prints actual voltage (which will be 500)\n",
+       "Sets pin DAC2 to 500mV, prints actual voltage (500)\n",
        CMD_HANDLER(cmd_do_dac_pin_set_voltage), (void *)&cmd_list_dac
 };
 
index 082372ff0c2c2c810c6058c4bf315fd014035b20..0c2be0f7c6ca33a1f03e3f50a8d45ffaee6aa47f 100644 (file)
@@ -96,25 +96,21 @@ int cmd_do_din_get(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
        int opchar;
        int value;
        int pin;
-       boolean_t var_tr;
 
        if((opchar=cmd_opchar_check(cmd_io,des,param)) < 0)
                return opchar;
        p = param[1];
        if(si_long(&p,(long*)&pin, 0) < 0)
                return -CMDERR_BADPAR;
-       p = param[3];
-       if(si_long(&p,(long*)&var_tr, 0) < 0)
-               return -CMDERR_BADPAR;
 
        if (rpp_din_update() == FAILURE) {
-               rpp_sci_printf("DIN SPI transfer failed.");
+               rpp_sci_printf("DIN SPI transfer failed.\n");
                return -CMDERR_EIO;
        }
 
-       value = rpp_din_get(pin, var_tr);
+       value = rpp_din_get(pin, false);
        if (value == -1) {
-               rpp_sci_printf("Pin out of range.");
+               rpp_sci_printf("Pin out of range.\n");
                return -CMDERR_BADPAR;
        }
        else if (value == -2) {
@@ -162,77 +158,75 @@ int cmd_do_din_diag(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
 /** Command descriptor for din state command */
 cmd_des_t const cmd_des_din_setup={
        0, CDESM_OPCHR|CDESM_WR,
-       "dinsetup*", "Setup DIN pin parameters (Pull up/down, tristate/active, IRQ and wakeup disable/enable).",
+       "dinsetup*", "Setup DIN pin parameters (Pull up/down, tristate/active, IRQ and wakeup disable/enable)",
        "=== Command syntax ===\n"
        "\n"
-       "   dinsetupPIN:(A,B,C) \n"
+       "   dinsetup<PIN>:(A,B,C) \n"
        "where\n"
-       "* PIN is in range 1-16\n"
-       "* A is in range 0-1 and\n"
-       "** 1 = pull up (switch to ground)\n"
-       "** 0 = pull down (switch to battery)\n"
-       "* B is in range 0-1 and\n"
-       "** 1 = tri-state\n"
-       "** 0 = active\n"
-       "* C is in range 0-1 and\n"
-       "** 1 = can wake up, IRQ enable\n"
-       "** 0 = wake up and IRQ disabled\n"
+       "* PIN is a number in range 1-16\n"
+       "* A is either 1 (pull up/switch to ground) or 0 (pull down/switch to battery)\n"
+       "* B is either 0 (active) or 1 (tri-state)\n"
+       "* C is either 0 (wake up and IRQ disabled) or 1 (can wake up, IRQ enable)\n"
        "\n"
        "=== Description ===\n"
        "\n"
-       "Command provides setup function for DIN pin. Every input can be set as\n"
-       "pull up (switch to ground) or pull down (switch to battery);\n"
-       "tri-state or active and also wake-up function with IRQ can be activated.\n"
+       "The command setups properties of a DIN pin. Every pin can be set as\n"
+       "pull up (switch to ground) or pull down (switch to battery); tri-state\n"
+       "or active and also can have wake-up function with IRQ activated or\n"
+       "not.\n"
        "\n"
-       "Command always prints final state of arguments pull-type|active|wake in this \n"
-       "order. Real configuration can not be read out of the pin driver.\n"
+       "The command always prints the final state of arguments\n"
+       "pull-type|active|wake in this order. The actual configuration cannot\n"
+       "be read out of the pin driver.\n"
        "\n"
        "=== Example ===\n"
        "\n"
        "   --> dinsetup1:(1,0,0)\n"
-       "Sets the DIN1 as switch to ground, active and disables IRQ generation and wake up function.\n",
+       "\n"
+       "Sets the DIN1 as switch to ground, active and disables IRQ generation\n"
+       "and wake up function.\n",
        CMD_HANDLER(cmd_do_din_setup), (void *)&cmd_list_din
 };
 
 /** Command descriptor for din state command */
 cmd_des_t const cmd_des_din_get={
-       0, CDESM_OPCHR|CDESM_WR,
-       "dinget*","Read value from DIN pin with threshold.",
+       0, CDESM_OPCHR|CDESM_RD,
+       "dinget*","Read a value from DIN pin (with the default treshold)", /* TODO add a command for reading with a treshold */
        "=== Command syntax ===\n"
        "\n"
-       "   dingetPIN:TR \n"
-       "where\n"
-       "* PIN is in range 1-16\n"
-       "* TR is not yet implemented\n"
+       "   dinget<PIN>?\n"
+       "where PIN is a number in range 0-15\n"
        "\n"
        "=== Description ===\n"
        "\n"
-       "Command reads and prints value from DIN pin. Treshold is not yet implemented.\n"
+       "The command reads and prints a logical value (0 or 1) from a DIN pin.\n"
        "\n"
        "=== Example ===\n"
        "\n"
-       "   --> dinget1:0\n"
-       "Prints value of the DIN1.\n",
+       "   --> dinget1?\n"
+       "Prints the value of the DIN1 pin.\n",
        CMD_HANDLER(cmd_do_din_get), (void *)&cmd_list_din
 };
 
 /** Command descriptor for din state command */
 cmd_des_t const cmd_des_din_diag={
        0, CDESM_OPCHR|CDESM_RD,
-       "dindiag*","Read diagnostic value from DIN pin.",
+       "dindiag*","Read diagnostic value from DIN pin",
        "=== Command syntax ===\n"
        "\n"
-       "   dindiagPIN? \n"
-       "where PIN is in range 1-16\n"
+       "   dindiag<PIN>?\n"
+       "\n"
+       "where <PIN> is in range 1-16\n"
        "\n"
        "=== Description ===\n"
        "\n"
-       "Command reads and prints value from diagnostic pin of DIN.\n"
+       "The command reads and prints the value of diagnostic bit corresponding\n"
+       "to a DIN pin. TODO check what the value actually mean.\n"
        "\n"
        "=== Example ===\n"
        "\n"
        "   --> dindiag1?\n"
-       "Prints value of the diagnostic signal of DIN1.\n",
+       "Prints value of the diagnostic bit of DIN1.\n",
        CMD_HANDLER(cmd_do_din_diag), (void *)&cmd_list_din
 };
 
index f5eaf88464f1f9940bf69de305547ca4534acb8f..49d1ea3b917c9051d4b6fd45bd096305ee3fc8e0 100644 (file)
@@ -264,15 +264,16 @@ int emac_test(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
 
 cmd_des_t const cmd_des_test_ethernet={
     0, 0,
-    "ethernet", "Try to send few ethernet frames.",
+    "ethernet", "Temporary command to test Ethernet communication",
     "=== Command syntax ===\n"
     "\n"
     "   ethernet\n"
     "\n"
     "=== Description ===\n"
     "\n"
-    "Command tries to send few ethernet frames. No real connection or real\n"
-    "packets are send. This only tests, if ethernet is just working.\n",
+    "Command tries to send a few ethernet frames. No real connection or\n"
+    "meaningful packets are sent. This only tests, if Ethernet is just\n"
+    "working.\n",
     CMD_HANDLER(emac_test), (void *)&cmd_list_emac
 };
 
index 8eb87154c1bff1dcd172df6925bb7a202ae0d732..28e12291c1a5b0e8e1b50102c44079c15092911d 100644 (file)
@@ -422,62 +422,68 @@ int cmd_do_test_frayB(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]
 /** Command descriptor for FlexRay status command */
 cmd_des_t const cmd_des_fray_stat={
        0, 0,
-       "fraystat#","get FRAYX status in human readable form.",
+       "frayxcvrstat#","Get status of a FlexRay transceiver in a human readable form",
        "=== Command syntax ===\n"
        "\n"
-       "   fraystatPORT\n"
-       "where PORT is in range 1-2\n"
+       "   frayxcvrstat<CHN>\n"
+       "where CHN is a number in range 1-2\n"
        "\n"
        "=== Description ===\n"
        "\n"
-       "Command receives response from Flexrey driver through SPI, translates\n"
-       "it and prints in form of atribut-value table.\n"
+       "The command receives response from a FlexRay transceiver via SPI, and\n"
+       "prints in the form of attribute-value table.\n"
        "\n"
        "=== Example ===\n"
        "\n"
-       "   --> fray1\n"
+       "   --> frayxcvrstat1\n"
        "\n"
-       "Prints status of FRAY1\n",
+       "Prints the status of FRAY1 transceiver.\n",
        CMD_HANDLER(cmd_do_fray_status), (void *)&cmd_list_fray
 };
 
 /** Command descriptor for FlexRay 1 test node A */
 cmd_des_t const cmd_des_test_fray_a={
            0, 0,
-           "testfrayA","Run FlexRay test as A node.",
+           "fraytestA","Run the FlexRay test as A node.",
            "=== Command syntax ===\n"
            "\n"
-           "   testfrayA\n"
+           "   fraytestA\n"
            "\n"
            "=== Description ===\n"
            "\n"
-           "Commands creates FlexRay node A and starts sending and\n"
-           "receiving 100 messages. Command should be run with two devices\n"
-           "connected in FlexRay bus and the second one running testfrayB command.\n"
+           "The commands creates FlexRay node A and starts sending and receiving\n"
+           "100 messages. The command should be run with two devices connected by\n"
+           "a FlexRay bus and the second device should be running the fraytestB\n"
+           "command (it is necessary to run both commands shortly after each\n"
+           "other).\n"
            "\n"
-           "Command prints O when message is received correctly, X is printed otherwise.\n"
-           "Number of RX errors and successfully received messages is counted and printed\n"
-           "in the end.\n",
+           "When the command receives a message a character is printed. O means\n"
+           "that the message was received correctly, X signal an reception error.\n"
+           "The number of RX errors and successfully received messages is\n"
+           "maintained during the test and printed at the end.\n",
            CMD_HANDLER(cmd_do_test_frayA), (void *)&cmd_list_fray
 };
 
 /** Command descriptor for FlexRay 1 test node B */
 cmd_des_t const cmd_des_test_fray_b={
            0, 0,
-           "testfrayB","Run FlexRay test as B node.",
+           "fraytestB","Run the FlexRay test as B node.",
            "=== Command syntax ===\n"
            "\n"
-           "   testfrayB\n"
+           "   fraytestB\n"
            "\n"
            "=== Description ===\n"
            "\n"
-           "Commands creates FlexRay node B and starts sending and\n"
-           "receiving 100 messages. Command should be run with two devices\n"
-           "connected in FlexRay bus and the second one running testfrayA command.\n"
+           "The commands creates FlexRay node B and starts sending and receiving\n"
+           "100 messages. The command should be run with two devices connected by\n"
+           "a FlexRay bus and the second device should be running the fraytestA\n"
+           "command (it is necessary to run both commands shortly after each\n"
+           "other).\n"
            "\n"
-           "Command prints O when message is received correctly, X is printed otherwise.\n"
-           "Number of RX errors and successfully received messages is counted and printed\n"
-           "in the end.\n",
+           "When the command receives a message a character is printed. O means\n"
+           "that the message was received correctly, X signal an reception error.\n"
+           "The number of RX errors and successfully received messages is\n"
+           "maintained during the test and printed at the end.\n",
            CMD_HANDLER(cmd_do_test_frayB), (void *)&cmd_list_fray
 };
 
index 204e2dcad6bd29195e0f59f0889d8b582385ba41..1e367993ac95ef169df22b867d472e899d73159d 100644 (file)
@@ -366,16 +366,17 @@ int cmd_do_motor(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
 /** Command descriptor for control */
 cmd_des_t const cmd_des_control={
                0, 0,
-               "control","Run example - control panel.",
-           "=== Command syntax ===\n"
-           "\n"
-           "   control\n"
-           "\n"
-           "=== Description ===\n"
-           "\n"
-               "Commands creates a FlexRay node and starts to read buttons and\n"
-               "potentiometer from control panel. Data from control panel are send\n"
-               "via FlexRay to the second node, created by running motor command."
+               "demomotctrl","Run motor control demo - reads input and sends it ",
+               "=== Command syntax ===\n"
+               "\n"
+               "   demomotctrl\n"
+               "\n"
+               "=== Description ===\n"
+               "\n"
+               "This command creates a FlexRay node and starts to read buttons\n"
+               "(connected to DIN0 and DIN1) and a potentiometer (ADC1) from control\n"
+               "panel. The read data are sent via FlexRay to the second node, created\n"
+               "by running demomot command.\n"
                "\n"
                "The purpose of this pair of commands is to demonstrate functionality\n"
                "of the FlexRay, ADC, DIN and HBR peripherals.\n",
@@ -386,15 +387,15 @@ cmd_des_t const cmd_des_control={
 cmd_des_t const cmd_des_motor={
                0, 0,
                "motor","Run example - motor controller.",
-           "=== Command syntax ===\n"
-           "\n"
-           "   motor\n"
-           "\n"
-           "=== Description ===\n"
-           "\n"
-               "Commands creates a FlexRay node and starts to receive data from node\n"
-               "created by command control. Received data are applied on HBR to control\n"
-               "DC motor.\n"
+               "=== Command syntax ===\n"
+               "\n"
+               "   demomot\n"
+               "\n"
+               "=== Description ===\n"
+               "\n"
+               "This command creates a FlexRay node and starts to receive the data\n"
+               "from another node created by command demomotctrl. The received data\n"
+               "are applied to HBR to control DC motor.\n"
                "\n"
                "The purpose of this pair of commands is to demonstrate functionality\n"
                "of the FlexRay, ADC, DIN and HBR peripherals.\n",