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"
34 #ifdef TARGET_TMS570_RPP
43 #include "cmd_sdram.h"
46 #include "cmd_motor_example.h"
47 #include "cmd_fr_basic_test.h"
56 int cmd_do_version(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
58 rpp_sci_printf("version=%s\n", GIT_VERSION);
64 /** Root list in which commands are stored */
65 cmd_des_t const **cmd_list;
67 #ifdef TARGET_TMS570_RPP
68 int cmd_do_sleep(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
71 if (rpp_gio_set(PIN_CANNSTB, 1) == FAILURE) return -CMDERR_BADDIO;
72 if (rpp_gio_set(PIN_CANEN, 1) == FAILURE) return -CMDERR_BADDIO;
73 if (rpp_gio_set(PIN_LIN2NSLP, 1) == FAILURE) return -CMDERR_BADDIO;
74 if (rpp_gio_set(PIN_LIN1NSLP, 1) == FAILURE) return -CMDERR_BADDIO;
75 vTaskDelay(10/portTICK_RATE_MS);
76 if (rpp_gio_set(PIN_LIN2NSLP, 0) == FAILURE) return -CMDERR_BADDIO;
77 if (rpp_gio_set(PIN_LIN1NSLP, 0) == FAILURE) return -CMDERR_BADDIO;
78 if (rpp_gio_set(PIN_CANNSTB, 0) == FAILURE) return -CMDERR_BADDIO;
83 /** Command descriptor for sleep command */
84 cmd_des_t const cmd_des_sleep = {
86 "sleep","Sleep the board",
91 "### Description ###\n"
93 "This command configures the LIN and CAN peripherals to enter sleep mode\n"
94 "and turn the whole device into sleep mode. External signal on CAN or\n"
95 "LIN will wake the device up.\n",
96 CMD_HANDLER(cmd_do_sleep), (void *)&cmd_list
100 /** Command descriptor for show help command */
101 cmd_des_t const cmd_des_help = {
103 "help","Print help for commands",
108 "### Description ###\n"
110 "This command without parameter prints the list of all available\n"
111 "commands with short help text for each of them. If a parameter is\n"
112 "provided, the command prints a long description for given command.\n",
113 CMD_HANDLER(cmd_do_help), (void *)&cmd_list
116 cmd_des_t const cmd_des_version = {
118 "version","Print version of the software",
123 "### Description ###\n"
125 "This command prints the version of the test software. The version\n"
126 "number is the output of 'git describe' command, i.e. it is composed\n"
127 "from the last tag in the git repository, the number of commits since\n"
128 "the tag and the abbreviated commit hash.\n"
133 " version=v0.2-109-ga81a9dd\n",
134 CMD_HANDLER(cmd_do_version),
137 /* ------------------------
138 * Command lists definitons
139 * ------------------------
142 /** @brief Main list of commands */
143 cmd_des_t const *cmd_list_main[] = {
145 #ifdef TARGET_TMS570_RPP
149 CMD_DES_INCLUDE_SUBLIST(cmd_list_adc),
150 CMD_DES_INCLUDE_SUBLIST(cmd_list_can),
151 CMD_DES_INCLUDE_SUBLIST(cmd_list_emac),
152 CMD_DES_INCLUDE_SUBLIST(cmd_list_nc),
153 CMD_DES_INCLUDE_SUBLIST(cmd_list_es),
154 CMD_DES_INCLUDE_SUBLIST(cmd_list_netstats),
155 CMD_DES_INCLUDE_SUBLIST(cmd_list_ping),
156 #ifdef TARGET_TMS570_RPP
157 CMD_DES_INCLUDE_SUBLIST(cmd_list_dac),
158 CMD_DES_INCLUDE_SUBLIST(cmd_list_din),
159 CMD_DES_INCLUDE_SUBLIST(cmd_list_fr_basic_test),
160 CMD_DES_INCLUDE_SUBLIST(cmd_list_fray),
161 CMD_DES_INCLUDE_SUBLIST(cmd_list_hbr),
162 CMD_DES_INCLUDE_SUBLIST(cmd_list_hout),
163 CMD_DES_INCLUDE_SUBLIST(cmd_list_lin),
164 CMD_DES_INCLUDE_SUBLIST(cmd_list_lout),
165 CMD_DES_INCLUDE_SUBLIST(cmd_list_mout),
166 CMD_DES_INCLUDE_SUBLIST(cmd_list_motor_example),
168 CMD_DES_INCLUDE_SUBLIST(cmd_list_pin),
169 CMD_DES_INCLUDE_SUBLIST(cmd_list_port),
170 #ifdef TARGET_TMS570_RPP
171 CMD_DES_INCLUDE_SUBLIST(cmd_list_sdram),
172 CMD_DES_INCLUDE_SUBLIST(cmd_list_spi),
173 CMD_DES_INCLUDE_SUBLIST(cmd_list_vbat),
178 /** Pointer to the root list */
179 cmd_des_t const **cmd_list = cmd_list_main;