]> rtime.felk.cvut.cz Git - rpp-test-sw.git/commitdiff
Basic documentation
authorKarryanna <karry@karryanna.cz>
Thu, 19 Sep 2013 12:36:47 +0000 (14:36 +0200)
committerKarryanna <karry@karryanna.cz>
Thu, 19 Sep 2013 12:36:47 +0000 (14:36 +0200)
commands/cmd_can.c

index bb4adea96a16ca50a0c8a217874e40df9528b58c..ca7fea0de790d70387008fdb86f7b03ceea6e0ba 100644 (file)
@@ -476,21 +476,68 @@ cmd_des_t const cmd_des_test_can_loopback={
 cmd_des_t const cmd_des_can_init={
     0, 0,
     "caninit", "Initialize CAN controllers",
-    "Will (maybe) implement later :)",
+    "=== Command syntax ===\n"
+    "\n"
+    "   caninit\n"
+    "\n"
+    "=== Description ===\n"
+    "\n"
+    "This command (re-)initializes all CAN controllers using current\n"
+    "CAN configuration. This configuration can be changed using\n"
+    "canbaudrate command.\n"
+    "\n"
+    "Default configuration sets baudrate of all CAN controllers to 0.5 Mbit/s\n"
+    "\n"
+    "=== Example ===\n"
+    "  --> caninit\n",
     CMD_HANDLER(cmd_do_can_init), (void *)&cmd_list_can
 };
 
 cmd_des_t const cmd_des_can_baudrate={
     0, CDESM_OPCHR|CDESM_RW,
     "canbaudrate#", "Change baudrate of CAN controller",
-    "Will (maybe) implement later :)",
+    "=== Command syntax ===\n"
+    "\n"
+    "   canbaudrate<CONTROLLER>?\n"
+    "   canbaudrate<CONTROLLER>:<BAUDRATE>\n"
+    "\n"
+    "where <CONTROLLER> is number in range 1-3 and BAUDRATE is number\n"
+    "in range 1000-10000000.\n"
+    "\n"
+    "=== Description ===\n"
+    "\n"
+    "This command is used to set or show baudrate of CAN controller.\n"
+    "The baudrate shown is the one which would be set if caninit was\n"
+    "called now.\n"
+    "\n"
+    "=== Examples ===\n"
+    "\n"
+    "   --> canbaudrate2?\n"
+    "   canbaudrate2=500000\n"
+    "\n"
+    "   --> canbaudrate2:100000\n",
     CMD_HANDLER(cmd_do_can_change_baudrate), (void *)&cmd_list_can
 };
 
 cmd_des_t const cmd_des_can_send={
     0, 0,
     "cansend", "Test sending message over CAN",
-    "Will (maybe) implement later :)",
+    "=== Command syntax ===\n"
+    "\n"
+    "   cansend <CONTROLLER> <ID> <DATA>\n"
+    "\n"
+    "where <CONTROLLER> is number in range 1-3, <ID> is valid CAN ID\n"
+    "and <DATA> is 0-8 bytes of data in hexadecimal representation.\n"
+    "There may be any number of spaces between data bytes.\n"
+    "<ID> may be given in octal, decimal or hexadecimal base.\n"
+    "\n"
+    "=== Description ===\n"
+    "\n"
+    "This command sends a CAN frame using specified CAN controller.\n"
+    "\n"
+    "=== Example ===\n"
+    "   --> cansend 2 0x123 DEAD BEEF\n"
+    "   Sent: can2      123     [4]     DE AD BE EF\n",
     CMD_HANDLER(cmd_do_can_send), (void *)&cmd_list_can
 };
 
@@ -498,7 +545,24 @@ cmd_des_t const cmd_des_can_send={
 cmd_des_t const cmd_des_can_dump={
     0, 0,
     "candump", "Dump all messages received over CAN",
-    "Will (maybe) add later :)",
+    "=== Command syntax ===\n"
+    "\n"
+    "   candump <CONTROLLER>\n"
+    "\n"
+    "where <CONTROLLER> is number in range 1-3.\n"
+    "\n"
+    "=== Description ===\n"
+    "\n"
+    "This command prints out any CAN message received via specified\n"
+    "controller.\n"
+    "\n"
+    "IDs are zero-filled to length 3 if standard ID is used and to 8\n"
+    "if extended ID is used.\n"
+    "\n"
+    "=== Example ===\n"
+    "\n"
+    "   --> candump 2\n"
+    "can2  0000FADE  [2]  12 34\n",
     CMD_HANDLER(cmd_do_can_dump), (void *)&cmd_list_can
 };