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_netstats.h"
40 #include "cmd_sdram.h"
43 #include "cmd_motor_example.h"
44 #include "cmd_fr_basic_test.h"
55 int cmd_do_version(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
57 rpp_sci_printf("version=%s\n", GIT_VERSION);
63 /** Root list in which commands are stored */
64 cmd_des_t const **cmd_list;
66 #ifdef TARGET_TMS570_RPP
67 int cmd_do_sleep(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
70 hal_gpio_pin_set_value(PIN_DSC_CANNSTB, 1);
71 hal_gpio_pin_set_value(PIN_DSC_CANEN, 1);
72 hal_gpio_pin_set_value(PIN_DSC_LIN2NSLP, 1);
73 hal_gpio_pin_set_value(PIN_DSC_LIN1NSLP, 1);
74 vTaskDelay(10/portTICK_RATE_MS);
75 hal_gpio_pin_set_value(PIN_DSC_LIN2NSLP, 0);
76 hal_gpio_pin_set_value(PIN_DSC_LIN1NSLP, 0);
77 hal_gpio_pin_set_value(PIN_DSC_CANNSTB, 0);
82 /** Command descriptor for sleep command */
83 cmd_des_t const cmd_des_sleep = {
85 "sleep","Sleep the board",
90 "### Description ###\n"
92 "This command configures the LIN and CAN peripherals to enter sleep mode\n"
93 "and turn the whole device into sleep mode. External signal on CAN or\n"
94 "LIN will wake the device up.\n",
95 CMD_HANDLER(cmd_do_sleep), (void *)&cmd_list
99 /** Command descriptor for show help command */
100 cmd_des_t const cmd_des_help = {
102 "help","Print help for commands",
107 "### Description ###\n"
109 "This command without parameter prints the list of all available\n"
110 "commands with short help text for each of them. If a parameter is\n"
111 "provided, the command prints a long description for given command.\n",
112 CMD_HANDLER(cmd_do_help), (void *)&cmd_list
115 cmd_des_t const cmd_des_version = {
117 "version","Print version of the software",
122 "### Description ###\n"
124 "This command prints the version of the test software. The version\n"
125 "number is the output of 'git describe' command, i.e. it is composed\n"
126 "from the last tag in the git repository, the number of commits since\n"
127 "the tag and the abbreviated commit hash.\n"
132 " version=v0.2-109-ga81a9dd\n",
133 CMD_HANDLER(cmd_do_version),
136 /* ------------------------
137 * Command lists definitons
138 * ------------------------
141 /** @brief Main list of commands */
142 cmd_des_t const *cmd_list_main[] = {
144 #ifdef TARGET_TMS570_RPP
148 CMD_DES_INCLUDE_SUBLIST(cmd_list_adc),
149 CMD_DES_INCLUDE_SUBLIST(cmd_list_can),
150 #ifdef TARGET_TMS570_RPP
151 CMD_DES_INCLUDE_SUBLIST(cmd_list_dac),
152 CMD_DES_INCLUDE_SUBLIST(cmd_list_din),
153 CMD_DES_INCLUDE_SUBLIST(cmd_list_emac),
154 CMD_DES_INCLUDE_SUBLIST(cmd_list_fr_basic_test),
155 CMD_DES_INCLUDE_SUBLIST(cmd_list_fray),
156 CMD_DES_INCLUDE_SUBLIST(cmd_list_hbr),
157 CMD_DES_INCLUDE_SUBLIST(cmd_list_hout),
158 CMD_DES_INCLUDE_SUBLIST(cmd_list_lin),
159 CMD_DES_INCLUDE_SUBLIST(cmd_list_lout),
160 CMD_DES_INCLUDE_SUBLIST(cmd_list_motor_example),
161 CMD_DES_INCLUDE_SUBLIST(cmd_list_nc),
162 CMD_DES_INCLUDE_SUBLIST(cmd_list_netstats),
164 CMD_DES_INCLUDE_SUBLIST(cmd_list_pin),
165 CMD_DES_INCLUDE_SUBLIST(cmd_list_port),
166 #ifdef TARGET_TMS570_RPP
167 CMD_DES_INCLUDE_SUBLIST(cmd_list_sdram),
168 CMD_DES_INCLUDE_SUBLIST(cmd_list_spi),
169 CMD_DES_INCLUDE_SUBLIST(cmd_list_vbat),
174 /** Pointer to the root list */
175 cmd_des_t const **cmd_list = cmd_list_main;