-cmd_des_t const cmd_des_port_val={
- 0, 0,
- "portval*","Read or write values from or to the port",
- "=== Command syntax ===\n"
- "\n"
- " portval<NAME> <VAL>\n"
- " portval<NAME>\n"
- "where\n"
- "* <NAME> is a string specifying the name of the port\n"
- "* <VAL> is a sequence of hexadecimal numbers, separated by spaces, e.g. 12 AA CD\n\n"
- "\n"
- "=== Description ===\n"
- "\n"
- "This command sets or gets values of all pins on the specified port.\n"
- "If the port is connected to the GPIO interface of the MCU, then\n"
- "when writing the value, the lowest significant bit of the argument\n"
- "is assigned to the first pin, the second bit is assigned to the\n"
- "second pin, etc. The command returns zero.\n"
- "When reading from the port, the command returns values for each pin.\n"
- "\n"
- "If the port is connected to the SPI interface of the MCU, then\n"
- "it is write only and the argument is interpreted as a command for\n"
- "the port controller. The command returns the response from the\n"
- "port controller.\n"
- "For command examples please refer to the project wiki\n"
- "\n"
- "If the port is connected to the ADC interface of the MCU, then\n"
- "it is read only and returns values for each ADC pin.\n"
- "\n"
- "Port names and interface type can be obtained with the portlist\n"
- "command.\n"
- "\n"
- "NOTE: For successful communication with the HBR, HBR_EN pin must\n"
- "be set first.\n"
- "\n"
- "=== Example ===\n"
- "\n"
- " --> portvalMOUTIN 3A\n"
- " portvalMOUTIN=0\n"
- " --> portvalMOUTIN\n"
- " 0\n"
- " 1\n"
- " 0\n"
- " 1\n"
- " 1\n"
- " 1\n"
- "\n"
- "This pair of commands sets:\nMOUT1IN"
- "MOUT1IN=0\n"
- "MOUT2IN=1\n"
- "MOUT3IN=0\n"
- "MOUT4IN=1\n"
- "MOUT5IN=1\n"
- "MOUT6IN=1\n"
- "Which is shown in getter output\n",
- CMD_HANDLER(cmd_do_port_val), (void *)&cmd_list_port
+cmd_des_t const cmd_des_port_val = {
+ 0, 0,
+ "portval*","Read or write values from or to the port",
+ "### Command syntax ###\n"
+ "\n"
+ " portval<NAME> <VAL> [<VAL> ...]\n"
+ " portval<NAME>\n"
+ "where\n"
+ "\n"
+ "- `<NAME>` is a string specifying the name of the port\n"
+ "- `<VAL>` is decimal, hexdecimal (0x) or octal (0) number\n"
+ "\n"
+ "### Description ###\n"
+ "\n"
+ "This command sets (when VAL is present) or gets (without VAL) values\n"
+ "of all channels of the specified port. For digital IO ports (1 bit per\n"
+ "channel), the least significant bit of the VAL corresponds to the\n"
+ "first pin, the second bit to the second pin, etc.\n"
+ "\n"
+ "The set variant of the command returns a value that depends on the\n"
+ "port type. For digital IO, this is the value set, for SPI ports this\n"
+ "is the SPI response.\n"
+ "\n"
+ "The get variant returns the value read from the port.\n"
+ "\n"
+ "If the port represents an SPI interface of the MCU, then it is write\n"
+ "only and the argument is interpreted as a command for the port\n"
+ "controller.\n"
+ "\n"
+ "If the port is represents the ADC interface of the MCU, it is read\n"
+ "only and returns values for each ADC pin.\n"
+ "\n"
+ "Port names and interface type can be obtained with the portlist\n"
+ "command.\n"
+ "\n"
+ "### Example ###\n"
+ "\n"
+ " --> portvalGIOB 0x3A\n"
+ " portvalGIOB=0x3a\n"
+ " --> portvalGIOB\n"
+ " portvalGIOB=0x3a\n"
+ "This pair of commands sets:\nGIOB"
+ "GIOB=0\n"
+ "GIOB=1\n"
+ "GIOB=0\n"
+ "GIOB=1\n"
+ "GIOB=1\n"
+ "GIOB=1\n"
+ "Which is shown in getter output\n",
+ CMD_HANDLER(cmd_do_port_val), (void *)&cmd_list_port