2 * Copyright (C) 2012-2016 Czech Technical University in Prague
4 * Created on: 31.7.2012
9 * This document contains proprietary information belonging to Czech
10 * Technical University in Prague. Passing on and copying of this
11 * document, and communication of its contents is not permitted
12 * without prior written authorization.
17 * This file contains root of the list of the commands.
29 #include "cmd_netstats.h"
31 #include "cmd_echoserver.h"
33 #include "cmd_iperf.h"
35 #ifdef TARGET_TMS570_RPP
44 #include "cmd_sdram.h"
47 #include "cmd_motor_example.h"
48 #include "cmd_fr_basic_test.h"
57 int cmd_do_version(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
59 rpp_sci_printf("version=%s\n", GIT_VERSION);
65 /** Root list in which commands are stored */
66 cmd_des_t const **cmd_list;
68 #ifdef TARGET_TMS570_RPP
69 int cmd_do_sleep(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
72 if (rpp_gio_set(PIN_CANNSTB, 1) == FAILURE) return -CMDERR_BADDIO;
73 if (rpp_gio_set(PIN_CANEN, 1) == FAILURE) return -CMDERR_BADDIO;
74 if (rpp_gio_set(PIN_LIN2NSLP, 1) == FAILURE) return -CMDERR_BADDIO;
75 if (rpp_gio_set(PIN_LIN1NSLP, 1) == FAILURE) return -CMDERR_BADDIO;
76 vTaskDelay(10/portTICK_RATE_MS);
77 if (rpp_gio_set(PIN_LIN2NSLP, 0) == FAILURE) return -CMDERR_BADDIO;
78 if (rpp_gio_set(PIN_LIN1NSLP, 0) == FAILURE) return -CMDERR_BADDIO;
79 if (rpp_gio_set(PIN_CANNSTB, 0) == FAILURE) return -CMDERR_BADDIO;
84 /** Command descriptor for sleep command */
85 cmd_des_t const cmd_des_sleep = {
87 "sleep","Sleep the board",
92 "### Description ###\n"
94 "This command configures the LIN and CAN peripherals to enter sleep mode\n"
95 "and turn the whole device into sleep mode. External signal on CAN or\n"
96 "LIN will wake the device up.\n",
97 CMD_HANDLER(cmd_do_sleep), (void *)&cmd_list
101 /** Command descriptor for show help command */
102 cmd_des_t const cmd_des_help = {
104 "help","Print help for commands",
109 "### Description ###\n"
111 "This command without parameter prints the list of all available\n"
112 "commands with short help text for each of them. If a parameter is\n"
113 "provided, the command prints a long description for given command.\n",
114 CMD_HANDLER(cmd_do_help), (void *)&cmd_list
117 cmd_des_t const cmd_des_version = {
119 "version","Print version of the software",
124 "### Description ###\n"
126 "This command prints the version of the test software. The version\n"
127 "number is the output of 'git describe' command, i.e. it is composed\n"
128 "from the last tag in the git repository, the number of commits since\n"
129 "the tag and the abbreviated commit hash.\n"
134 " version=v0.2-109-ga81a9dd\n",
135 CMD_HANDLER(cmd_do_version),
138 /* ------------------------
139 * Command lists definitons
140 * ------------------------
143 /** @brief Main list of commands */
144 cmd_des_t const *cmd_list_main[] = {
146 #ifdef TARGET_TMS570_RPP
150 CMD_DES_INCLUDE_SUBLIST(cmd_list_adc),
151 CMD_DES_INCLUDE_SUBLIST(cmd_list_can),
152 CMD_DES_INCLUDE_SUBLIST(cmd_list_emac),
153 CMD_DES_INCLUDE_SUBLIST(cmd_list_nc),
154 CMD_DES_INCLUDE_SUBLIST(cmd_list_es),
155 CMD_DES_INCLUDE_SUBLIST(cmd_list_netstats),
156 CMD_DES_INCLUDE_SUBLIST(cmd_list_ping),
157 CMD_DES_INCLUDE_SUBLIST(cmd_list_iperf),
158 #ifdef TARGET_TMS570_RPP
159 CMD_DES_INCLUDE_SUBLIST(cmd_list_dac),
160 CMD_DES_INCLUDE_SUBLIST(cmd_list_din),
161 CMD_DES_INCLUDE_SUBLIST(cmd_list_fr_basic_test),
162 CMD_DES_INCLUDE_SUBLIST(cmd_list_fray),
163 CMD_DES_INCLUDE_SUBLIST(cmd_list_hbr),
164 CMD_DES_INCLUDE_SUBLIST(cmd_list_hout),
165 CMD_DES_INCLUDE_SUBLIST(cmd_list_lin),
166 CMD_DES_INCLUDE_SUBLIST(cmd_list_lout),
167 CMD_DES_INCLUDE_SUBLIST(cmd_list_mout),
168 CMD_DES_INCLUDE_SUBLIST(cmd_list_motor_example),
170 CMD_DES_INCLUDE_SUBLIST(cmd_list_pin),
171 CMD_DES_INCLUDE_SUBLIST(cmd_list_port),
172 #ifdef TARGET_TMS570_RPP
173 CMD_DES_INCLUDE_SUBLIST(cmd_list_sdram),
174 CMD_DES_INCLUDE_SUBLIST(cmd_list_spi),
175 CMD_DES_INCLUDE_SUBLIST(cmd_list_vbat),
180 /** Pointer to the root list */
181 cmd_des_t const **cmd_list = cmd_list_main;