/**
* @brief Sleep the board
*
- * Command syntax: sleep
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/** Command descriptor for sleep command */
cmd_des_t const cmd_des_sleep={
0, 0,
- "sleep","Sleep the board",
+ "sleep","Sleep the board.",
"=== Description ===\n"
"\n"
"This command configures LIN and CAN peripherals to enter sleep mode\n"
- "and turn the whole device into sleep mode. External signal on CAN will\n"
- "wake the device up.\n",
+ "and turn the whole device into sleep mode. External signal on CAN or\n"
+ "LIN will wake the device up.\n",
CMD_HANDLER(cmd_do_sleep), (void *)&cmd_list
};
/** Command descriptor for show help command */
cmd_des_t const cmd_des_help={
0, 0,
- "help","prints help for commands",
- "=== Syntax ===\n"
- "\n"
- " help [command]\n"
- "\n"
+ "help","prints help for commands.",
"=== Description ===\n"
"\n"
"This command without parameter prints the list of all available\n"
"commands with short help text for each of them. If a parameter is\n"
- "provided, the command prints help for the given command.\n",
+ "provided, the command prints help for the given command.\n"
+ "\n"
+ "=== Syntax ===\n"
+ "\n"
+ " help [command]\n",
CMD_HANDLER(cmd_do_help), (void *)&cmd_list
};
/**
- * @brief Read ADC port
- *
- * Command syntax: readadc
+ * @brief Read values from ADC port
*
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
/** Descriptor of command for adc port reading */
cmd_des_t const cmd_des_read_adc1={
0, 0,
- "readadc","Reads values from ADC1",
+ "readadc","Reads values from ADC1.",
"=== Description ===\n"
"\n"
"This command reads values on all ADIN 1-12 channels and prints it as\n"
/**
* @brief Command for external CAN loopback testing.
*
- * Command syntax: testcan src dest, where src and dest are numbers of CAN in range 1 - 3 and can not be equal.
- *
- * Command resets CAN bus and than sends 100 times message from source and destination.
- * During the sending process number of tx errors, rx errors, tx timeouts and rx timeouts is being tracked.
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/** @brief command descriptor for test CAN loopback command */
cmd_des_t const cmd_des_test_can_loopback={
0, 0,
- "testcan","testcan src<1;3> dest<1;3> Test CAN loopback between src and dest.",
+ "Test CAN loopback between source and destination nodes.",
"=== Description ===\n"
"\n"
"This command tests CAN bus by sending and receiving messages through\n"
"\n"
"=== Command syntax ===\n"
"\n"
- " testcan SOURCE DESTINATION\n"
+ " --> testcan SOURCE DESTINATION\n"
"where SOURCE and DESTINATION is a number in the range 1-3 and SOURCE\n"
"is not equal DESTINATION.\n"
"\n"
/**
* @brief Setup DAC pin enable or disable
*
- * Command syntax: dacsetupX:Y
- * where: X - pin nubmer 1-16
- * Y - 1 = enable
- * 0 = disable
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/**
* @brief Set DAC pin raw value
*
- * Command syntax: dacsetvalX:Y
- * where: X - pin nubmer 1-16
- * Y - value (0 ; 4095)
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/**
* @brief Set DAC pin voltage value in mV units
*
- * Command syntax: dacsetvoltageX:Y
- * where: X - pin nubmer 1-16
- * Y - voltage (0 ; 12000)
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/** Descriptor of command for dac pin setup */
cmd_des_t const cmd_des_dac_pin_setup = {
0, CDESM_OPCHR|CDESM_WR,
- "dacpinsetup#","dacpinsetupX:Y - Enables or disables DAC pin number X. Y equal 1 means enable, 0 means disable.",
- "\n",
+ "dacpinsetup#","Enables or disables DAC pin number. 1 means enable, 0 means disable.",
+ "=== Description ===\n"
+ "\n"
+ "Command provides enabling and disabling function for DAC pin.\n"
+ "\n"
+ "Command expects first parameter, operation character and \n"
+ "second parameter. First parameter specifies number of pin (1-4),\n"
+ "operation character : (setter) and the second binary parameter specifies\n"
+ "enables (1) or disables (0) the pin. \n"
+ "\n"
+ "Command always prints actual state of selected pin.\n"
+ "\n"
+ "=== Command syntax ===\n"
+ "\n"
+ " --> dacpinsetupPIN[:][VALUE] \n"
+ "where\n"
+ "* PIN is in range 1-4\n"
+ "* : means set value VALUE to pin PIN\n"
+ "* VALUE is in range 0-1\n"
+ "\n"
+ "=== Example ===\n"
+ "\n"
+ " --> dacpinsetup1:1\n"
+ "Enables pin DAC1 and print its actual state (which should be 1)\n",
CMD_HANDLER(cmd_do_dac_pin_setup), (void *)&cmd_list_dac
};
/** Descriptor of command for dac pin value set */
cmd_des_t const cmd_des_dac_pin_set_val = {
0, CDESM_OPCHR|CDESM_WR,
- "dacpinval#","dacpinvalX:Y - Sets value Y to pin DAC X.",
+ "dacpinval#","Sets raw value to pin DAC.",
"=== Description ===\n"
"\n"
- "Command provides set and get function for DAC pin voltage.\n"
+ "Command provides set function for DAC pin raw value.\n"
"\n"
- "Command expects first parameter, oparation character and eventually\n"
+ "Command expects first parameter, operation character and \n"
"second parameter. First parameter specifies number of pin (1-4),\n"
- "operation character : (setter) or ? (getter) and in case of set\n"
- "operation character, the second parameter specifies voltage in mV to\n"
- "be set on pin.\n"
+ "operation character : (setter) and the second parameter specifies\n"
+ "raw value to be set on pin. This value sets voltage on the selected\n"
+ "pin according to the formula described in datasheet. \n"
"\n"
- "Command always prints actual voltage of selected pin.\n"
+ "Command always prints actual raw value of selected pin.\n"
"\n"
"=== Command syntax ===\n"
"\n"
- " --> dacpinvalPIN[:|?][VALUE] \n"
- " where PIN is in range 1-4\n"
- " where : means set voltage VALUE to pin PIN\n"
- " where ? means get voltage of pin PIN\n"
+ " --> dacpinvalPIN[:][VALUE] \n"
+ "where\n"
+ "* PIN is in range 1-4\n"
+ "* : means set raw value VALUE to pin PIN\n"
+ "* VALUE is in range 0-4095\n"
"\n"
"=== Example ===\n"
"\n"
- " --> dacpinval1:8000\n"
- "Set pin DAC1 to 8V, prints actual voltage (which should be 8000)\n"
- "\n"
- " --> dacpinval2:500\n"
- "Set pin DAC2 to 500mV, prints actual voltage (which should be 500)\n"
- "\n"
- " --> dacpinval2?\n"
- "Get voltage of pin DAC2 and print it\n",
+ " --> dacpinval1:4095\n"
+ "Set pin DAC1 to 12V, prints actual raw value (which should be 4095)\n",
CMD_HANDLER(cmd_do_dac_pin_set_val), (void *)&cmd_list_dac
};
/** Descriptor of command for dac pin voltage set */
cmd_des_t const cmd_des_dac_pin_set_voltage = {
0, CDESM_OPCHR|CDESM_WR,
- "dacpinvoltage#","dacpinvoltageX:Y - Sets voltage Y mV to pin DAC X.",
- "\n",
+ "dacpinvoltage#","Sets voltage in mV to pin DAC.",
+ "=== Description ===\n"
+ "\n"
+ "Command provides set function for DAC pin voltage.\n"
+ "\n"
+ "Command expects first parameter, operation character and \n"
+ "second parameter. First parameter specifies number of pin (1-4),\n"
+ "operation character : (setter) the second parameter specifies voltage \n"
+ "in mV to be set on pin.\n"
+ "\n"
+ "Command always prints actual voltage of selected pin.\n"
+ "\n"
+ "=== Command syntax ===\n"
+ "\n"
+ " --> dacpinvoltage[:][VALUE] \n"
+ "where\n"
+ "* PIN is in range 1-4\n"
+ "* : means set voltage VALUE to pin PIN\n"
+ "* VALUE is in range 0-12000\n"
+ "\n"
+ "=== Example ===\n"
+ "\n"
+ " --> dacpinvoltage1:8000\n"
+ "Set pin DAC1 to 8V, prints actual voltage (which should be 8000)\n"
+ "\n"
+ " --> dacpinvoltage2:500\n"
+ "Set pin DAC2 to 500mV, prints actual voltage (which should be 500)\n",
CMD_HANDLER(cmd_do_dac_pin_set_voltage), (void *)&cmd_list_dac
};
/**
* @brief Setup DIN pin parameters (Pull up/down, tristate/active, IRQ and wakeup disable/enable
*
- * Command syntax: dinsetupX:(A,B,C)
- * where: X - pin nubmer 1-16
- * A - 1 = pull up (switch to ground)
- * 0 = pull down (switch to battery)
- * B - 1 = tri-state
- * 0 = active
- * C - 1 = can wake up, IRQ enable
- * 0 = wake up and IRQ disabled
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/**
* @brief Get value from DIN pin
*
- * Command syntax: dingetX:Y
- * where: X - pin nubmer 1-16
- * Y - treshold (not yet implemented)
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/**
* @brief Read DIN diagnostic value
*
- * Command syntax: dindiagX?
- * where: X - pin nubmer 1-16
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/** 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)",
- "TODO\n"
- " dinsetupX:(pull-type,active,can-wake) - Sets up DIN X pin.\n"
- " Pull-type: 1 - pull up (switch-to-ground); 0 - pull down (switch-to-battery)\n"
- " Active: 1 - tri-state; 0 - active\n"
- " Can-wake: 1 - pin can wake module up and set an interrupt; 0 - wake up and interrupt disabled.\n",
+ "dinsetup*", "Setup DIN pin parameters (Pull up/down, tristate/active, IRQ and wakeup disable/enable).",
+ "=== 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 wake-up function with IRQ can be activated.\n"
+ "\n"
+ "Command expects first parameter, operation character and \n"
+ "second parameter. First parameter specifies number of pin (1-16),\n"
+ "operation character : (setter) and three arguments in parentheses, separated\n"
+ "by colons.\n"
+ "The first argument specifies pull resistor (1 - pull up, 0 - pull down),\n"
+ "The second argument specifies whether the input is tri-state (1) or active (0),\n"
+ "The third argument activates (1) or deactivates (0) wake up function and IRQ generation.\n"
+ "\n"
+ "Command always prints final state of arguments pull-type|active|wake in this order.\n"
+ "\n"
+ "=== Command syntax ===\n"
+ "\n"
+ " --> dinsetupPIN[:](A,B,C) \n"
+ "where\n"
+ "* PIN is in range 1-16\n"
+ "* : means setup the PIN\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"
+ "\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",
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*","dingetX:Y Read value from DIN X pin with treshold Y",
- "\n",
+ "dinget*","Read value from DIN pin with threshold.",
+ "=== Description ===\n"
+ "\n"
+ "Command gets value from DIN pin. Treshold is not yet implemented.\n"
+ "\n"
+ "Command expects first parameter, operation character and \n"
+ "second parameter. First parameter specifies number of pin (1-16),\n"
+ "operation character is : and second parameter specifies treshold.\n"
+ "\n"
+ "Command prints value of the DIN pin\n"
+ "\n"
+ "=== Command syntax ===\n"
+ "\n"
+ " --> dingetPIN[:]TR \n"
+ "where\n"
+ "* PIN is in range 1-16\n"
+ "* TR is not yet implemented\n"
+ "\n"
+ "=== Example ===\n"
+ "\n"
+ " --> dinget1:0\n"
+ "Prints value of the DIN1.\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*","dindiagX? Read diagnostic value from DIN X pin",
- "\n",
+ "dindiag*","Read diagnostic value from DIN pin.",
+ "=== Description ===\n"
+ "\n"
+ "Command reads value from diagnostic pin of DIN.\n"
+ "\n"
+ "Command expects first, which specifies number of pin (1-16), and\n"
+ "operation character ?\n"
+ "\n"
+ "Command prints value of the diagnostic signal of the specified DIN pin\n"
+ "\n"
+ "=== Command syntax ===\n"
+ "\n"
+ " --> dindiagPIN[?] \n"
+ "where PIN is in range 1-16\n"
+ "\n"
+ "=== Example ===\n"
+ "\n"
+ " --> dindiag1?\n"
+ "Prints value of the diagnostic signal of DIN1.\n",
CMD_HANDLER(cmd_do_din_diag), (void *)&cmd_list_din
};
cmd_des_t const cmd_des_test_ethernet={
0, 0,
- "ethernet", "Try to send few ethernet frames",
+ "ethernet", "Try to send few ethernet frames.",
"=== Description ===\n"
"\n"
"Command tries to send few ethernet frames. No real connection or real\n"
/**
* @brief Start sending and receiving data on as node A
*
- * Command initializes FRAY1 node A, waits for node B and start sending and receiving data.
- * When data are received correctly, "O" is printed, when incorrectly, "X" is prited.
- * Number of errors and received messages is counting.
- *
- * There is command for node B, which should be launched on another device.
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/**
* @brief Start sending and receiving data on as node B
*
- * Command initializes FRAY1 node B, waits for node A and start sending and receiving data.
- * When data are received correctly, "O" is printed, when incorrectly, "X" is prited.
- * Number of errors and received messages is counting.
- *
- * There is command for node A, which should be launched on another device.
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/** Command descriptor for FlexRay status command */
cmd_des_t const cmd_des_fray_stat={
0, 0,
- "fraystat#","get FRAYX status in human readable form",
+ "fraystat#","get FRAYX status in human readable form.",
"=== Description ===\n"
"\n"
"Command receives response from Flexrey driver through SPI, translates\n"
- "it and prints in human readable form. Command expects suffix, which\n"
- "determines FRAY number.\n"
- "\n"
+ "it and prints in form of atribut-value table. Command expects suffix,\n"
+ "which determines FRAY number.\n"
"\n"
"=== Command syntax ===\n"
"\n"
/** 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",
+ "testfrayA","Run FlexRay test as A node.",
"=== Description ===\n"
"\n"
- "Commands creates FlexRay node A and starts infinite sending and\n"
- "receiving messages. Command should be run with two devices connected\n"
- "in FlexRay bus and the second one running testfrayB command. Nothing\n"
- "is printed while the test, so some analysator should be connected in\n"
- "the bus.\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"
"\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"
"=== Command syntax ===\n"
"\n"
" --> testfrayA\n",
/** 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",
+ "testfrayB","Run FlexRay test as B node.",
"=== Description ===\n"
"\n"
- "Commands creates FlexRay node B and starts infinite sending and\n"
- "receiving messages. Command should be run with two devices connected\n"
- "in FlexRay bus and the second one running testfrayA command. Nothing\n"
- "is printed while the test, so some analysator should be connected in\n"
- "the bus.\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"
"\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"
"=== Command syntax ===\n"
"\n"
" --> testfrayB\n",
/**
* @brief Enable HBR driver with given period of PWM
*
- * Value given as a parameter means period of PWM. If lower than zero, default value is used instead.
- * If driver is enabled already, command ends with error.
- *
- * This command should be called before any other HBR commands.
- *
- * Command syntax: hbrenable:X
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/**
* @brief Control HBR driver with given value <-100; 100>
*
- * Value in parameter means duty cycle of PWM period in %. Sigh of the value
- * means direction.
- * Driver must be enabled by hbrenable command before this command can be used.
- *
- * Command syntax: hbrcontrol:X
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/**
* @brief Disable HBR driver.
*
- * If already disabled, command ends with error.
- *
- * Command syntax: hbrdisable
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
cmd_des_t const cmd_des_hbr_enable = {
0, CDESM_OPCHR|CDESM_WR,
"hbrenable","Enables H-bridge with given period.",
- "\n",
+ "=== Description ===\n"
+ "\n"
+ "Command enables H-bridge, which means that enable signal is set, watchdog\n"
+ "reset task is started and PWM is configured with specified period and\n"
+ "duty cycle 0%.\n"
+ "\n"
+ "Command expects operation character : and one parameter, which specifies\n"
+ "a period (in us) of the PWM signal in the HBR output.\n"
+ "\n"
+ "If period is lower than zero, default frequency 18kHz is used instead.\n"
+ "This command should be called befor any other HBR command is used.\n"
+ "If HBR is already enabled, command returns with error.\n"
+ "\n"
+ "=== Command syntax ===\n"
+ "\n"
+ " --> hbrenable:X\n"
+ "where X is PWM period in us\n"
+ "\n"
+ "=== Example ===\n"
+ "\n"
+ " --> hbrenable:1000\n"
+ "\n"
+ "Enables HBR with period 1kHz. HBR output is still inactive, but ready for\n"
+ "other commands calls.\n",
CMD_HANDLER(cmd_do_hbr_enable), (void *)&cmd_list_hbr
};
/** Command descriptor for HBR control command */
cmd_des_t const cmd_des_hbr_control = {
0, CDESM_OPCHR|CDESM_WR,
- "hbrcontrol","Sets direction and PWM duty cycle <-100; 100>",
- "\n",
+ "hbrcontrol","Sets direction and PWM duty cycle <-100; 100>.",
+ "=== Description ===\n"
+ "\n"
+ "Command controls the direction and speed of the motor connected to HBR.\n"
+ "\n"
+ "Command expects operation character : and one parameter, which specifies\n"
+ "the direction and speed. Negative values set one direction and positive\n"
+ "values set the other direction. Absolute value has to be i range 0-100,\n"
+ "because it in fact specifies duty cycle in % of the PWM. This means thah\n"
+ "-100 is the maximum (100%) speed in one direction, 25 is 25% speed in the other\n"
+ "direction. When the value is 0, the output is inactive."
+ "\n"
+ "HBR has to be enabled by hbrenable command befor this one can be called.\n"
+ "\n"
+ "=== Command syntax ===\n"
+ "\n"
+ " --> hbrcontrol:X\n"
+ "where X specifies direction and PWM duty cycle in % (thus in range -100 - 100)\n"
+ "\n"
+ "=== Example ===\n"
+ "\n"
+ " --> hbrcontrol:-25\n"
+ "\n"
+ "Activates motor rotation to the left with 25% speed.\n"
+ "\n"
+ " --> hbrcontrol:25\n"
+ "\n"
+ "Activates motor rotation to the right with 25% speed.\n"
+ "\n"
+ " --> hbrcontrol:0\n"
+ "\n"
+ "Deactivates motor rotation.\n",
CMD_HANDLER(cmd_do_hbr_control), (void *)&cmd_list_hbr
};
/** Command descriptor for HBR disable command */
cmd_des_t const cmd_des_hbr_disable = {
0, 0,
- "hbrdisable","Disables H-bridge",
- "\n",
+ "hbrdisable","Disables H-bridge.",
+ "=== Description ===\n"
+ "\n"
+ "Command disables HBR, which means that PWM is stopped and enable signal is\n"
+ "cleared. Watchdog task is left running, because it is harmless.\n"
+ "\n"
+ "Command expects no parameters."
+ "\n"
+ "After HBR is disabled, it can not be controlled by any command until it\n"
+ "is reenabled egain by hbrenable command\n."
+ "\n"
+ "=== Command syntax ===\n"
+ "\n"
+ " --> hbrdisable\n"
+ "\n"
+ "=== Example ===\n"
+ "\n"
+ " --> hbrdisable\n"
+ "\n"
+ "Stops motor and disables H-bridge.\n",
CMD_HANDLER(cmd_do_hbr_disable), (void *)&cmd_list_hbr
};
/**
* @brief Reads values from HOUT_IFBK pins (subset of ADC)
*
- * Command syntax: readhifbk
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/**
* @brief Runs test of selected HOUT pin.
*
- * This command runs a test to check if HOUT pin is in good or fault condition.
- * When HOUT is OK, HOUT_DIAG pin has the same value as HOUT_IN pin.
- * When HOUT is in fault state, HOUT_DIAG periodically follows HOUT_PIN for 2ms and shorts to ground for 2ms.
- *
- * Command syntax: houtfail#
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/**
* @brief Set or get actual pwm parameters
*
- * Command syntax: houtpwm:(p,d) - set p as a period in us and D as duty cycle in % of the period.
- * houtpwm? - Get actual PWM parameters, period in us and duty cycle in % of the period.
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/**
* @brief Start PWM, if it was previously set by houtpwm command
*
- * Command syntax: houtpwmstart
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/**
* @brief Stop PWM
*
- * Command syntax: houtpwmstop
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/** Command descriptor for test hout fault state command */
cmd_des_t const cmd_des_test_hout_fail = {
0, 0,
- "houtfail","Test if some HOUT port is in fault state",
+ "houtfail","Test if some HOUT pin is in fault state.",
"=== Description ===\n"
"\n"
"This command tests, if HOUT pin is in good condition. When a circuit,\n"
- "controlling HOUT pin, detects some fault, it starts to generate signal\n"
- "on HOUT_DIAG pin.\n"
+ "controlling HOUT pin, detects some failure, it starts to generate signal\n"
+ "on HOUT_DIAG pin. This command is supposed to detect such a state.\n"
+ "\n"
+ "Command expects one parameter (1-6), which specifies pin number."
"\n"
"=== Command syntax ===\n"
"\n"
- " --> houtfail pin\n"
- "where pin is in range 1-6\n",
+ " --> houtfail PIN\n"
+ "where PIN is in range 1-6\n"
+ "=== Example ===\n"
+ "\n"
+ " --> houtfail 1\n"
+ "\n"
+ "Detects state of the HOUT1 and prints OK, FAIL or NOT RUNNING.\n",
CMD_HANDLER(cmd_do_test_hout_fault), (void *)&cmd_list_hout
};
/** Command descriptor for hout read IFBK command */
cmd_des_t const cmd_des_read_hifbk={
0, 0,
- "readhifbk","Reads values from HOUT IFBK",
+ "readhifbk","Reads values from HOUT IFBK.",
"=== Description ===\n"
"\n"
- "Command reads analog values on HOUT_IFBK pins.\n"
- "\n"
+ "Command reads analog values on HOUT_IFBK pins and prints\n"
+ "them in HOUTX-value table.\n"
"\n"
"=== Command syntax ===\n"
"\n"
CMD_HANDLER(cmd_do_read_hout_ifbk_values), (void *)&cmd_list_hout
};
-/** Command descriptor for HBR set PWM command */
+/** Command descriptor for HOUT set PWM command */
cmd_des_t const cmd_des_hout_pwm={
0, CDESM_OPCHR|CDESM_RW,
- "houtpwm*","Set or get actual PWM parameters",
+ "houtpwm*","Set or get actual PWM parameters.",
"=== Description ===\n"
"\n"
"This command can be used for setting or getting HOUT PWM parameters.\n"
"\n"
" --> hbrpwm1?\n"
"\n"
- "Actual period of HOUT1 PWM in us and duty cycle in % will be printed.\n",
+ "Prints actual period of HOUT1 PWM in us and duty cycle in %.\n",
CMD_HANDLER(cmd_do_hout_pwm), (void *)&cmd_list_hout
};
/** Command descriptor for PWM start command */
cmd_des_t const cmd_des_hout_pwm_start={
0, 0,
- "houtpwmstart#","houtpwmstartX - Start generating of pwm signal on HOUTX",
+ "houtpwmstart#","Start generating PWM signal on HOUT.",
"=== Description ===\n"
"\n"
- "If HOUT PWM was previously set by houtpwm command, this command starts\n"
- "generating PWM signal on specified pin.\n"
+ "If HOUT PWM was previously set by houtpwm command, this command starts to\n"
+ "generate PWM signal on specified pin.\n"
+ "Command expects one paramete, which specifies number of pin (1-6)"
"\n"
"=== Command syntax ===\n"
"\n"
" --> houtpwmstartPIN\n"
- "where PIN is in range 1-6\n",
+ "where PIN is in range 1-6\n"
+ "\n"
+ "=== Example ===\n"
+ "\n"
+ " --> houtpwmstart1\n"
+ "\n"
+ "HOUT1 PWM generation will be activated.\n",
CMD_HANDLER(cmd_do_hout_pwm_start), (void *)&cmd_list_hout
};
/** Command descriptor for PWM stop command */
cmd_des_t const cmd_des_hout_pwm_stop={
0, 0,
- "houtpwmstop#","houtpwmstopX - Stop generating of pwm signal on HOUTX",
+ "houtpwmstop#","Stop generating of PWM signal on HOUT.",
"=== Description ===\n"
"\n"
"This command stops generating PWM signal on selected pin.\n"
+ "Command expects one parameter, whic specifies number of pin (1-6)\n"
"\n"
"=== Command syntax ===\n"
"\n"
" --> houtpwmstopPIN\n"
- "where PIN is in range 1-6\n",
+ "where PIN is in range 1-6\n"
+ "\n"
+ "=== Example ===\n"
+ "\n"
+ " --> houtpwmstop1\n"
+ "\n"
+ "HOUT1 PWM generation will be deactivated.\n",
CMD_HANDLER(cmd_do_hout_pwm_stop), (void *)&cmd_list_hout
};
}
/** @brief Command for testing LIN loopback
- *
- * Command sends short data chunk and counts errors when receiving through loopback.
*
* @param[in] cmd_io Pointer to IO functions
* @param[in] cmd_des Pointer to command descriptor
/** Descriptor of command for lin loopback test */
cmd_des_t const cmd_des_lin_loop_back={
0, 0,
- "testlin","Test digital loopback on LIN",
+ "testlin","Test digital loopback on LIN.",
"=== Description ===\n"
"\n"
"This command can be used for testing LIN. Command starts sending short\n"
/**
* @brief Set digital value to LOUT pin
*
- * Command syntax: loutsetX:Y
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/**
* @brief Read digital diagnostic value from LOUT DIAG pin
*
- * Command syntax: loutdiagX?
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/** Command descriptor for lout set port value */
cmd_des_t const cmd_des_lout_set={
0, CDESM_OPCHR|CDESM_WR,
- "loutset#","loutsetX:Y - Set Y value to LOUT X pin",
- "\n",
+ "loutset#","Set value to LOUT pin.",
+ "=== Description ===\n"
+ "\n"
+ "Command sets digital value on an output pin LOUT.\n"
+ "Command expects first parameter, operation character :\n"
+ "and second parameter. The first one specifies number of\n"
+ "pin, the second one specifies value to be set on the output.\n"
+ "\n"
+ "=== Command syntax ===\n"
+ "\n"
+ " --> loutsetPIN:VALUE\n"
+ "where\n"
+ "* PIN is in range 1-8\n"
+ "* : means set VALUE on PIN\n"
+ "* VALUE is binary value to be set\n"
+ "\n"
+ "=== Example ===\n"
+ "\n"
+ " --> loutset1:1\n"
+ "\n"
+ "Sets 1 to LOUT1\n"
+ "\n"
+ " --> loutset2:0\n"
+ "\n"
+ "Sets 0 to LOUT2\n",
CMD_HANDLER(cmd_do_lout_set), (void *)&cmd_list_lout
};
/** Command descriptor for lout get pin diag value */
cmd_des_t const cmd_des_lout_diag={
0, CDESM_OPCHR|CDESM_RD,
- "loutdiag#","loutdiagX? - Reads diag value from LOUT X pin",
- "\n",
+ "loutdiag#","Reads diagnostic value from LOUT pin.",
+ "=== Description ===\n"
+ "\n"
+ "Command reads digital value from LOUT diagnostic signal.\n"
+ "Command expects first parameter and operation character ? .\n"
+ "The parameter specifies number of pin.\n"
+ "\n"
+ "=== Command syntax ===\n"
+ "\n"
+ " --> loutdiagPIN?\n"
+ "where\n"
+ "* PIN is in range 1-8\n"
+ "* ? means get value from PIN\n"
+ "\n"
+ "=== Example ===\n"
+ "\n"
+ " --> loutdiag1?\n"
+ "\n"
+ "Reads value from LOUT1 diagnostic signal.\n",
CMD_HANDLER(cmd_do_lout_diag), (void *)&cmd_list_lout
};
/**
* @brief Read data from control panel and send them to motor controller through FlexRay
*
- * Command syntax: control
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/**
* @brief Receive data from FlexRay and control motor on HBR
*
- * Command syntax: motor
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/** Command descriptor for control */
cmd_des_t const cmd_des_control={
0, 0,
- "control","Run example - control panel",
- "\n",
+ "control","Run example - control panel.",
+ "=== 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."
+ "\n"
+ "The purpose of this pair of commands is to demonstrate functionality\n"
+ "of the FlexRay, ADC, DIN and HBR peripherals.\n"
+ "\n"
+ "=== Command syntax ===\n"
+ "\n"
+ " --> control\n",
CMD_HANDLER(cmd_do_control), (void *)&cmd_list_motor_example
};
/** Command descriptor for motor */
cmd_des_t const cmd_des_motor={
0, 0,
- "motor","Run example - motor controller",
- "\n",
+ "motor","Run example - motor controller.",
+ "=== 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"
+ "\n"
+ "The purpose of this pair of commands is to demonstrate functionality\n"
+ "of the FlexRay, ADC, DIN and HBR peripherals.\n"
+ "\n"
+ "=== Command syntax ===\n"
+ "\n"
+ " --> motor\n",
CMD_HANDLER(cmd_do_motor), (void *)&cmd_list_motor_example
};
/**
* @brief Print list of pins
*
- * Command syntax: pinlist
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/**
* @brief Set or get pin value
*
- * Command syntax: pinvalNAME:v - set value v (1 or 0) to pin NAME (can be obtained by pinlist command)
- * pinvalNAME? - get value on pin NAME (can be obtained by pinlist command)
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/**
* @brief Set or get pin direction
*
- * Command syntax: pindirNAME:v - set direction 1-out, 0-in to pin NAME (can be obtained by pinlist command)
- * pindirNAME? - get direction of pin NAME (can be obtained by pinlist command)
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/** Command descriptor for pin list */
cmd_des_t const cmd_des_pin_list = {
0, 0,
- "pinlist","Prints list of all defined pins",
- "\n",
+ "pinlist","Prints list of all defined pins.",
+ "=== Description ===\n"
+ "\n"
+ "Commands prints list of all defined pins accessible by pinval\n"
+ "and pindir commands\n"
+ "\n"
+ "=== Command syntax ===\n"
+ "\n"
+ " --> pinlist\n",
CMD_HANDLER(cmd_do_pin_list), (void *)&cmd_list_pin
};
/** Command descriptor for pin get/set value */
cmd_des_t const cmd_des_pin_val={
0, CDESM_OPCHR|CDESM_RW,
- "pinval*","Sets or get pin value",
+ "pinval*","Sets or get pin value.",
"=== Description ===\n"
"\n"
"This command is used as setter and getter for selected pin. Command\n"
- "expects suffix, which specifies the name of the pin. Than operation\n"
+ "expects first parameter, operation character and eventually second parameter\n"
+ "The first parameter specifies name of the pin, operation\n"
"character : (setter) or ? (getter) and if setter, last parameter\n"
- "specifies value to be assigned.\n"
+ "specifies value to be assigned to the pin.\n"
"\n"
"Pin name can be obtained by pinlist command.\n"
"\n"
+ "Most of the pins are accessible indirectly via highlevel commands\n"
+ "HBR_EN is for example controlled by hbrenable command. This command\n"
+ "serves as supplement to highlevel commands for testing purpose.\n"
"=== Command syntax ===\n"
"\n"
" --> pinvalNAME[:|?][VAL]\n"
"where\n"
"* NAME is a string\n"
- "* : means assign VAL to pi NAME and ? means get value from pin NAME\n"
+ "* : means assign VAL to pin NAME and ? means get value from pin NAME\n"
"* VAL can be 0 or 1\n"
"\n"
"=== Example ===\n"
/** Command descriptor for pin get/set direction */
cmd_des_t const cmd_des_pin_dir={
0, CDESM_OPCHR|CDESM_RW,
- "pindir*","Sets pin direction 1-out, 0-in",
+ "pindir*","Sets pin direction 1-out, 0-in.",
"=== Description ===\n"
"\n"
- "This command is used as setter and getter of selected pins direction.\n"
- "Command expects suffix, which specifies the name of the pin. Than\n"
- "operation character : (setter) or ? (getter) and if setter, last\n"
- "parameter specifies value to be assigned. 1 means output, 0 means\n"
- "input.\n"
+ "This command is used as setter and getter of selected pins direction. Command\n"
+ "expects first parameter, operation character and eventually second parameter\n"
+ "The first parameter specifies name of the pin, operation\n"
+ "character : (setter) or ? (getter) and if setter, last parameter\n"
+ "specifies direction to be assigned to the pin.\n"
"\n"
"Pin name can be obtained by pinlist command.\n"
"\n"
+ "Most of the pins are accessible indirectly via highlevel commands\n"
+ "HBR_EN is for example controlled by hbrenable command. This command\n"
+ "serves as supplement to highlevel commands for testing purpose.\n"
"=== Command syntax ===\n"
"\n"
" --> pinvdirNAME[:|?][DIR]\n"
"where\n"
"* NAME is a string\n"
- "* : means assign DIR to pi NAME and ? means get direction from pin NAME\n"
+ "* : means assign DIR to pin NAME and ? means get direction from pin NAME\n"
"* DIR can be 0 or 1\n"
"\n"
"=== Example ===\n"
/**
* @brief Read values from specified port
*
- * Command syntax: portvalNAME:(val) - Set value val to port specified by NAME (can be obtsined by portlist command). 1st bit -> PORT_PIN_1, 2nd bit -> PORT_PIN_2)
- * portvalNAME? - Get value on port specified by NAME (can be obtsined by portlist command). 1st bit -> PORT_PIN_1, 2nd bit -> PORT_PIN_2)
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/** Command descriptor for read values from port command */
cmd_des_t const cmd_des_port_val={
0, CDESM_OPCHR|CDESM_RW,
- "portval*","Read or set values from port",
+ "portval*","Read/write values from/to port.",
"=== Description ===\n"
"\n"
- "This command set or get values of all pins on specified port. First\n"
+ "This command sets or gets values of all pins on specified port. First\n"
"parameter specifies a name of the port, than operation character :\n"
- "(setter) or ? (getter) and if setter, then another hexadecimal number\n"
- "specifies the value assigned to the pins. First bit is assigned to the\n"
- "first pin, second bit is assigned to the second pin, etc.\n"
+ "(setter) or ? (getter) is expected and if setter, then another\n"
+ "hexadecimal number specifies the value assigned to the pins. First\n"
+ "bit is assigned to the first pin, second bit is assigned to the second\n"
+ "pin, etc.\n"
"\n"
- "Port names will be available in portlist command, witch is not yet\n"
- "ready.\n"
+ "Port names are available via portlist command.\n"
"\n"
"=== Command syntax ===\n"
"\n"
/** Command descriptor for port list printout */
cmd_des_t const cmd_des_port_list={
0, 0,
- "portlist","Print list of port names",
- "\n",
+ "portlist","Print list of port names.",
+ "=== Description ===\n"
+ "\n"
+ "This command prints list of all defined ports accessible via\n"
+ "portval command.\n"
+ "\n"
+ "=== Command syntax ===\n"
+ "\n"
+ " --> portlist\n",
CMD_HANDLER(cmd_do_port_list), (void *)&cmd_list_port
};
/**
* @brief Start SDR test routine
*
- * Command syntax: testslog
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/**
* @brief Tests the capacity and fitness of connected SDRAM
*
- * Command syntax: testsdram
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/** Command descriptor for test SDRAM */
cmd_des_t const cmd_des_test_sdram={
0, 0,
- "testsdram","Test if SDRAM module is connected and if it is, measure capacity",
+ "testsdram","Test if SDRAM module is connected and if it is, measure capacity.",
"=== Description ===\n"
"\n"
- "This command tests while SDRAM address space by writing and reading a\n"
+ "This command tests SDRAM address space by writing and reading a\n"
"pattern. It detects valid SDRAM capacity.\n"
"\n"
"=== Command syntax ===\n"
cmd_des_t const cmd_des_test_log={
0, 0,
"testlog","Open command subprocessor for managing SDRAM logging.",
- "\n",
+ "=== Description ===\n"
+ "\n"
+ "Command opens subcommand processor, which contains testing commands\n"
+ "for logging into SDRAM\n"
+ "\n"
+ "=== Command syntax ===\n"
+ "\n"
+ " --> testlog\n",
CMD_HANDLER(cmd_do_test_log), (void *)&cmd_list_sdram
};
/**
* @brief Translate SPI response according the command and peripheral type
*
- * Command syntax: spitrNAME?(cmd, resp)
- *
- * Command take response resp given by last command cmd and translate it according peripheral
- * type specified by NAME.
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/**
* @brief Send SPI command on SPI and receive response
*
- * Command syntax: spimst##:ADDR(cmd) - Sends command cmd on SPI ## with address ADDR
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/** Command descriptor for SPI response translation */
cmd_des_t const cmd_des_spi_translate={
0, CDESM_OPCHR|CDESM_RW,
- "spitr*","Translate response from SPI peripheral. spitrPERNAME?(CMD, RESP)",
+ "spitr*","Translate response from SPI peripheral.",
"=== Description ===\n"
"\n"
"This command can translate response from SPI from many different\n"
"peripherals into human readable form. Standard SPI response is in form\n"
"of few bytes, which are encoding the information. This commands takes\n"
"this response, last command which evoked this response, name of the\n"
- "peripheral and translates the response in text form.\n"
+ "peripheral and translates the response to the form of atribute-value table.\n"
"\n"
"Command takes first parameter, which is the peripheral name, then it\n"
"expects ? operation character and another two parameters. The first\n"
- "one is command and the second is response for the command.\n"
+ "one is command and the second one is response for that command.\n"
"\n"
"=== Command syntax ===\n"
"\n"
/** Command descriptor for SPI trasfer */
cmd_des_t const cmd_des_spimst = {
0, CDESM_OPCHR,
- "spimst#", "SPI master communication request",
+ "spimst#", "SPI master communication request.",
"=== Description ===\n"
"\n"
"This is master SPI transfer command. Command expects SPI number as a\n"
/**
* @brief Power on VBAT and VBAT1 using PWM
*
- * Command syntax: poweron
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/**
* @brief Power off VBAT and VBAT1 using PWM
*
- * Command syntax: poweroff
- *
* @param[in] cmd_io Pointer to IO stack
* @param[in] des Pointer to command descriptor
* @param[in] param Parameters of command
/** Command descriptor for poweron */
cmd_des_t const cmd_des_power_on = {
0, 0,
- "poweron","Set VBATEN and VBAT1EN using PWM",
+ "poweron","Set VBATEN and VBAT1EN using PWM.",
"=== Description ===\n"
"\n"
"This command turns on a VBAT and slowly charge capacitors VBAT1 using\n"
"PWM with scalable timing.\n"
"\n"
- "Poweron command have to be launched befor any access to any SPI\n"
- "peripherals. If not, they will not work.\n"
+ "Poweron command have to be launched before any access to any SPI\n"
+ "peripherals, otherwise they will not work.\n"
"\n"
"Please note that parameters for this PWM may change from device to\n"
- "device and it might be nescessary to tune them for each device.\n"
+ "device and it might be necessary to tune them for each device.\n"
"\n"
"=== Command syntax ===\n"
"\n"
/** Command descriptor for poweroff */
cmd_des_t const cmd_des_power_off = {
0, 0,
- "poweroff","Clear VBATEN and VBAT1EN",
+ "poweroff","Clear VBATEN and VBAT1EN.",
"=== Description ===\n"
"\n"
"This command turns off VBAT and VBAT1.\n"