]> rtime.felk.cvut.cz Git - pes-rpp/rpp-test-sw.git/blob - rpp-test-sw/commands/_tms570_hdk/cmd.c
2ef304d629fb4f9e09b4c500bbe4e85163dd0d02
[pes-rpp/rpp-test-sw.git] / rpp-test-sw / commands / _tms570_hdk / cmd.c
1 /*
2  * Copyright (C) 2012-2013 Czech Technical University in Prague
3  *
4  * Created on: 31.7.2012
5  *
6  * Authors:
7  *     - Michal Horn
8  *
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.
13  *
14  * File : cmd.c
15  *
16  * Abstract:
17  *      This file contains root of the list of the commands.
18  *
19  */
20
21 /* Include files */
22 #include "cmdproc.h"
23 #include "../cmd.h"
24 #include "../cmd_adc.h"
25 #include "../cmd_can.h"
26 #include "../cmd_pin.h"
27 #include "../cmd_port.h"
28
29 #ifndef DOCGEN
30
31 #include "rpp/rpp.h"
32 #include "hal/hal.h"
33
34
35 #include <version.h>
36
37 int cmd_do_version(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
38 {
39         rpp_sci_printf("version=%s\n", GIT_VERSION);
40         return 0;
41 }
42
43 #endif  /* DOCGEN */
44
45 /** Root list in which commands are stored */
46 cmd_des_t const **cmd_list;
47
48 /** Command descriptor for show help command */
49 cmd_des_t const cmd_des_help = {
50         0, 0,
51         "help","Print help for commands",
52         "### Syntax ###\n"
53         "\n"
54         " help [command]\n"
55         "\n"
56         "### Description ###\n"
57         "\n"
58         "This command without parameter prints the list of all available\n"
59         "commands with short help text for each of them. If a parameter is\n"
60         "provided, the command prints a long description for given command.\n",
61         CMD_HANDLER(cmd_do_help), (void *)&cmd_list
62 };
63
64 cmd_des_t const cmd_des_version = {
65         0, 0,
66         "version","Print version of the software",
67         "### Syntax ###\n"
68         "\n"
69         " version\n"
70         "\n"
71         "### Description ###\n"
72         "\n"
73         "This command prints the version of the test software. The version\n"
74         "number is the output of 'git describe' command, i.e. it is composed\n"
75         "from the last tag in the git repository, the number of commits since\n"
76         "the tag and the abbreviated commit hash.\n"
77         "\n"
78         "### Example ###\n"
79         "\n"
80         "    --> version\n"
81         "    version=v0.2-109-ga81a9dd\n",
82         CMD_HANDLER(cmd_do_version),
83 };
84
85 /*  ------------------------
86  *  Command lists definitons
87  *  ------------------------
88  */
89
90 /** @brief Main list of commands */
91 cmd_des_t const *cmd_list_main[] = {
92         &cmd_des_help,
93         &cmd_des_version,
94         CMD_DES_INCLUDE_SUBLIST(cmd_list_adc),
95         CMD_DES_INCLUDE_SUBLIST(cmd_list_can),
96         CMD_DES_INCLUDE_SUBLIST(cmd_list_pin),
97         CMD_DES_INCLUDE_SUBLIST(cmd_list_port),
98         NULL
99 };
100
101 /** Pointer to the root list */
102 cmd_des_t const **cmd_list = cmd_list_main;