2 * Copyright (C) 2012-2015 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 #ifdef TARGET_TMS570_RPP
39 #include "cmd_echoserver.h"
40 #include "cmd_netstats.h"
41 #include "cmd_sdram.h"
44 #include "cmd_motor_example.h"
45 #include "cmd_fr_basic_test.h"
51 #include "drv/digital_io_def.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_val(DIO_PIN_NAME_CANNSTB, 1) == FAILURE) return -CMDERR_BADDIO;
72 if (rpp_gio_set_val(DIO_PIN_NAME_CANEN, 1) == FAILURE) return -CMDERR_BADDIO;
73 if (rpp_gio_set_val(DIO_PIN_NAME_LIN2NSLP, 1) == FAILURE) return -CMDERR_BADDIO;
74 if (rpp_gio_set_val(DIO_PIN_NAME_LIN1NSLP, 1) == FAILURE) return -CMDERR_BADDIO;
75 vTaskDelay(10/portTICK_RATE_MS);
76 if (rpp_gio_set_val(DIO_PIN_NAME_LIN2NSLP, 0) == FAILURE) return -CMDERR_BADDIO;
77 if (rpp_gio_set_val(DIO_PIN_NAME_LIN1NSLP, 0) == FAILURE) return -CMDERR_BADDIO;
78 if (rpp_gio_set_val(DIO_PIN_NAME_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 #ifdef TARGET_TMS570_RPP
152 CMD_DES_INCLUDE_SUBLIST(cmd_list_dac),
153 CMD_DES_INCLUDE_SUBLIST(cmd_list_din),
154 CMD_DES_INCLUDE_SUBLIST(cmd_list_emac),
155 CMD_DES_INCLUDE_SUBLIST(cmd_list_fr_basic_test),
156 CMD_DES_INCLUDE_SUBLIST(cmd_list_fray),
157 CMD_DES_INCLUDE_SUBLIST(cmd_list_hbr),
158 CMD_DES_INCLUDE_SUBLIST(cmd_list_hout),
159 CMD_DES_INCLUDE_SUBLIST(cmd_list_lin),
160 CMD_DES_INCLUDE_SUBLIST(cmd_list_lout),
161 CMD_DES_INCLUDE_SUBLIST(cmd_list_motor_example),
162 CMD_DES_INCLUDE_SUBLIST(cmd_list_nc),
163 CMD_DES_INCLUDE_SUBLIST(cmd_list_es),
164 CMD_DES_INCLUDE_SUBLIST(cmd_list_netstats),
166 CMD_DES_INCLUDE_SUBLIST(cmd_list_pin),
167 CMD_DES_INCLUDE_SUBLIST(cmd_list_port),
168 #ifdef TARGET_TMS570_RPP
169 CMD_DES_INCLUDE_SUBLIST(cmd_list_sdram),
170 CMD_DES_INCLUDE_SUBLIST(cmd_list_spi),
171 CMD_DES_INCLUDE_SUBLIST(cmd_list_vbat),
176 /** Pointer to the root list */
177 cmd_des_t const **cmd_list = cmd_list_main;