]> rtime.felk.cvut.cz Git - rpp-test-sw.git/blobdiff - rpp-test-sw/commands/cmd_din.c
Change license to MIT
[rpp-test-sw.git] / rpp-test-sw / commands / cmd_din.c
index 624cb4c9a7dbde833c015586ba2d3fdc4f6dcbf5..c6f9f14df00e801a6b0b2ee4b38c9691d11edcba 100644 (file)
@@ -1,15 +1,31 @@
 /*
- * Copyright (C) 2012-2013 Czech Technical University in Prague
+ * Copyright (C) 2012-2013, 2016 Czech Technical University in Prague
  *
  * Created on: 28.2.2013
  *
  * Authors:
  *     - Michal Horn
  *
- * This document contains proprietary information belonging to Czech
- * Technical University in Prague. Passing on and copying of this
- * document, and communication of its contents is not permitted
- * without prior written authorization.
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
  *
  * File : cmd_din.c
  *
@@ -24,9 +40,7 @@
 #ifndef DOCGEN
 
 #include "cmdproc_utils.h"
-#include "drv/din.h"
 #include "rpp/rpp.h"
-#include "hal/hal.h"
 
 /**
  * @brief      Setup DIN pin parameters (pull up/down, tristate/active, IRQ and wakeup disable/enable
@@ -189,36 +203,42 @@ cmd_des_t const cmd_des_din_setup = {
        "dinsetup*", "Setup DIN pin parameters (Pull up/down, tristate/active, IRQ and wakeup disable/enable)",
        "### Command syntax ###\n"
        "\n"
-       "    dinsetup<PINS> [A [B [C]]]\n"
+       "    dinsetup<PINS> [PU [ACT [WAKE]]]\n"
        "where\n"
        "\n"
-       "- PINS is either a number in range 1-16 or a range written as `<min>-<max>`\n"
-       "- A is an optional value - either 0 (pull down/switch to battery) or 1 (pull up/switch to ground). The default is 1.\n"
-       "- B is an optional value - either 0 (tri-state) or 1 (active). The default is 0.\n"
-       "- C is an optional value - either 0 (wake up and IRQ disabled) or 1 (wake up and IRQ disabled enabled). The default is 1.\n"
+       "- PINS is either a number in range 0-15 or a range written as\n"
+       "  `<min>-<max>`\n"
+       "- PU is an optional value - either 0 (pull down/switch to battery) or 1\n"
+       "  (pull up/switch to ground). The default is 1.\n"
+       "- ACT is an optional value - either 0 (tri-state) or 1 (active). The\n"
+       "  default is 0.\n"
+       "- WAKE is an optional value - either 0 (wake up and IRQ disabled) or 1\n"
+       "  (wake up and IRQ enabled). The default is 1.\n"
        "\n"
        "### Description ###\n"
        "\n"
        "The command setups properties of one or more DIN pins as specified by\n"
-       "`<PIN>`. Pins 0-7 can be set as pull up (switch to ground) or pull down\n"
-       "(switch to battery), pins 8-15 are hardcoded as switch to ground. All\n"
-       "pins can be set to either tri-state or active state and also can have\n"
+       "`<PINS>`. Pins 0-7 can be set as pull up (switch to ground) or pull\n"
+       "down (switch to battery), pins 8-15 are hardcoded as switch to ground.\n"
+       "All pins can be set to either tri-state or active state and can have\n"
        "wake-up function with IRQ activated or not.\n"
        "\n"
-       "The command always prints the final settings of each set pin as ABC.\n"
-       "The actual configuration cannot be read out of the pin driver.\n"
+       "The command always prints the final settings of each set pin as PU ACT\n"
+       "WAKE (without spaces). The actual configuration cannot be read out of\n"
+       "the pin driver.\n"
        "\n"
        "### Example ###\n"
        "\n"
        "    --> dinsetup1 1 0 0\n"
        "    dinsetup1=100\n"
        "\n"
-       "Sets the DIN1 as switch to ground, active and disables IRQ generation.\n"
+       "Sets the DIN1 as switch to ground, tri-state and disables IRQ\n"
+       "generation.\n"
        "\n"
        "    --> dinsetup2\n"
        "    dinsetup2=101\n"
        "\n"
-       "Sets the DIN2 as to the default values i.e. switch to battery,\n"
+       "Sets the DIN2 as to the default values i.e. switch to ground,\n"
        "tri-state, wake-up/IRQ enabled.\n"
        "\n"
        "    --> dinsetup0-7 1 1 1\n"
@@ -231,7 +251,7 @@ cmd_des_t const cmd_des_din_setup = {
        "    dinsetup6=111\n"
        "    dinsetup7=111\n"
        "\n"
-       "Sets the DIN0 through DIN7 as switch to ground, tri-state, wake-up/IRQ\n"
+       "Sets the DIN0 through DIN7 as switch to battery, active, wake-up/IRQ\n"
        "enabled.\n",
        CMD_HANDLER(cmd_do_din_setup), (void *)&cmd_list_din
 };