2 * Copyright (C) 2012-2013 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.
35 #include "cmd_echoserver.h"
36 #include "cmd_netstats.h"
39 #include "cmd_sdram.h"
42 #include "cmd_motor_example.h"
43 #include "cmd_fr_basic_test.h"
52 * @brief Sleep the board
54 * @param[in] cmd_io Pointer to IO stack
55 * @param[in] des Pointer to command descriptor
56 * @param[in] param Parameters of command
57 * @return 0 when OK or error code
59 int cmd_do_sleep(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
61 hal_gpio_pin_set_value(PIN_DSC_CANNSTB, 1);
62 hal_gpio_pin_set_value(PIN_DSC_CANEN, 1);
63 hal_gpio_pin_set_value(PIN_DSC_LIN2NSLP, 1);
64 hal_gpio_pin_set_value(PIN_DSC_LIN1NSLP, 1);
65 vTaskDelay(10/portTICK_RATE_MS);
66 hal_gpio_pin_set_value(PIN_DSC_LIN2NSLP, 0);
67 hal_gpio_pin_set_value(PIN_DSC_LIN1NSLP, 0);
68 hal_gpio_pin_set_value(PIN_DSC_CANNSTB, 0);
74 int cmd_do_version(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
76 rpp_sci_printf("version=%s\n", GIT_VERSION);
82 /** Root list in which commands are stored */
83 cmd_des_t const **cmd_list;
85 /** Command descriptor for sleep command */
86 cmd_des_t const cmd_des_sleep = {
88 "sleep","Sleep the board",
93 "### Description ###\n"
95 "This command configures the LIN and CAN peripherals to enter sleep mode\n"
96 "and turn the whole device into sleep mode. External signal on CAN or\n"
97 "LIN will wake the device up.\n",
98 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[] = {
148 CMD_DES_INCLUDE_SUBLIST(cmd_list_adc),
149 CMD_DES_INCLUDE_SUBLIST(cmd_list_can),
150 CMD_DES_INCLUDE_SUBLIST(cmd_list_dac),
151 CMD_DES_INCLUDE_SUBLIST(cmd_list_din),
152 CMD_DES_INCLUDE_SUBLIST(cmd_list_emac),
153 CMD_DES_INCLUDE_SUBLIST(cmd_list_fray),
154 CMD_DES_INCLUDE_SUBLIST(cmd_list_hbr),
155 CMD_DES_INCLUDE_SUBLIST(cmd_list_hout),
156 CMD_DES_INCLUDE_SUBLIST(cmd_list_lin),
157 CMD_DES_INCLUDE_SUBLIST(cmd_list_lout),
158 CMD_DES_INCLUDE_SUBLIST(cmd_list_nc),
159 CMD_DES_INCLUDE_SUBLIST(cmd_list_es),
160 CMD_DES_INCLUDE_SUBLIST(cmd_list_netstats),
161 CMD_DES_INCLUDE_SUBLIST(cmd_list_pin),
162 CMD_DES_INCLUDE_SUBLIST(cmd_list_port),
163 CMD_DES_INCLUDE_SUBLIST(cmd_list_sdram),
164 CMD_DES_INCLUDE_SUBLIST(cmd_list_spi),
165 CMD_DES_INCLUDE_SUBLIST(cmd_list_vbat),
166 CMD_DES_INCLUDE_SUBLIST(cmd_list_motor_example),
167 CMD_DES_INCLUDE_SUBLIST(cmd_list_fr_basic_test),
171 /** Pointer to the root list */
172 cmd_des_t const **cmd_list = cmd_list_main;