]> rtime.felk.cvut.cz Git - pes-rpp/rpp-test-sw.git/blobdiff - rpp-test-sw/commands/cmd_hout.c
Update library
[pes-rpp/rpp-test-sw.git] / rpp-test-sw / commands / cmd_hout.c
index fa08f0190167176e23327b25f48e338bf7d99e13..cf19029c8d01a52da4ee7ff0e4eb836550d768e4 100644 (file)
@@ -6,18 +6,10 @@
  * Authors:
  *     - Michal Horn
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ * 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.
  *
  * File : cmd_hout.c
  *
@@ -32,8 +24,9 @@
 #ifndef DOCGEN
 
 #include "rpp/rpp.h"
-#include "hal/hal.h"
-#include "drv/drv.h"
+/* FIXME: remove hout.h */
+#include "drv/hout.h"
+#include "drv/digital_io_def.h"
 #include "cmdproc_utils.h"
 
 
 int cmd_do_read_hout_ifbk_values(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
 {
        uint32_t i;                     // Cycle control variable
-       port_desc_t *desc;
-       uint32_t values[PORT_HOUTIFBK_CHANNEL_NUM*2];
+       uint32_t port_num_values = rpp_port_get_pin_cnt(DIO_PORT_NAME_HOUTIFBK);
+       uint32_t values[port_num_values*2];
        int ret;
 
-       desc = hal_port_get_dsc(PORT_NAME_HOUTIFBK, -1);
 
-       ret = desc->port_getfnc_ptr(desc->config, PORT_HOUTIFBK_CHANNEL_NUM, values);
+       ret = rpp_port_get_val(DIO_PORT_NAME_HOUTIFBK, port_num_values, values);
        if (ret < 0)
                return ret;
 
-       for (i = 0; i < PORT_HOUTIFBK_CHANNEL_NUM; i++) {
+       for (i = 0; i < port_num_values; i++) {
                rpp_sci_printf("HOUT%d: %d\n", i+1, values[i]);
        }
        return 0;