]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blobdiff - rpp/src/drv/lout.c
Uncrustify
[pes-rpp/rpp-lib.git] / rpp / src / drv / lout.c
index 3acdf54408b45740ac8f9d35c1d9080f891415ae..fbc9d0756ef0e31b8c58c12a3526faeb5f5380eb 100644 (file)
@@ -1,14 +1,22 @@
-/*
- * lout.c
+/* Copyright (C) 2012-2013, 2015 Czech Technical University in Prague
  *
- *  Created on: 7.12.2012
- *      Author: Michal Horn
+ * Authors:
+ *     - Michal Horn <hornmich@fel.cvut.cz>
  *
- *  This file contains functions to control LOUT port over SPI
+ * 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 : lout.c
+ *
+ * Abstract:
+ *      This file contains functions to control LOUT port over SPI
  */
 
 //#include "drv/lout.h"
 #include "drv/drv.h"
+#include "drv/port.h"
 
 /** Prepared spi command */
 uint32_t lout_spi_cmd = LOUT_SPICMD_INIT_VAL;
@@ -124,19 +132,18 @@ uint8_t lout_get_word()
 int lout_spi_transfer()
 {
 
-       port_desc_t *desc;
+       const struct port_desc *port;
 
-       desc = hal_port_get_dsc(PORT_NAME_LOUT, -1);
+       port = &port_desc[PORT_ID_LOUT];
 
        lout_spi_cmd_sh = lout_spi_cmd;
-       uint32_t commands[4];
+       char commands[4];
        commands[0] = (lout_spi_cmd_sh & 0xFF000000) >> 24;
        commands[1] = (lout_spi_cmd_sh & 0xFF0000) >> 16;
        commands[2] = (lout_spi_cmd_sh & 0xFF00) >> 8;
        commands[3] = (lout_spi_cmd_sh & 0xFF);
 
-       lout_spi_resp = desc->port_setfnc_ptr(desc->config, desc->numValues, commands);
-       return lout_spi_resp;
+       return lout_spi_resp = port->set(port, commands, sizeof(commands));
 }
 
 /**