-/*
- * 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;
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));
}
/**