]> 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 88b8088cbcf620c69a2b272de7510d039a88fd0c..fbc9d0756ef0e31b8c58c12a3526faeb5f5380eb 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2013 Czech Technical University in Prague
+/* Copyright (C) 2012-2013, 2015 Czech Technical University in Prague
  *
  * Authors:
  *     - Michal Horn <hornmich@fel.cvut.cz>
  * File : lout.c
  *
  * Abstract:
- *         This file contains functions to control LOUT port over SPI
+ *      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;
@@ -131,19 +132,18 @@ uint8_t lout_get_word()
 int lout_spi_transfer()
 {
 
-       dio_port_desc_t *desc;
+       const struct port_desc *port;
 
-       desc = dio_port_get_dsc(DIO_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));
 }
 
 /**