+/*
+ * Copyright (C) 2015 Czech Technical University in Prague
+ *
+ * Authors:
+ * - Michal Sojka <sojkam1@fel.cvut.cz>
+ *
+ * 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.
+ *
+ */
+
+#ifndef RPP_SPI_H
+#define RPP_SPI_H
+
+#include "drv/spi_def.h"
+#include "types.h"
+
+/**
+ * Initizlize SPI subsystem
+ *
+ *
+ * @return SUCCESS or FAILURE
+ */
+int8_t rpp_spi_init();
+
+/**
+ * Transfer message to an SPI device and receive an answer.
+ *
+ * This function is thread safe.
+ *
+ * @param dev The device to communicate with.
+ * @param rq_len The lenght of data (in bytes) pointed by @a tx_buf and @a rx_buf.
+ * @param tx_buf Data to be sent to the device.
+ * @param rx_buf Data received from the device.
+ *
+ * @return SUCCESS or negative RPP error code.
+ */
+int8_t rpp_spi_transfer(enum spi_device dev, int rq_len, const void *tx_buf, void *rx_buf);
+
+/**
+ * Transfer 16-bit message to the device.
+ *
+ * This is a convenience wrapper function over rpp_spi_transfer().
+ *
+ * This function is thread safe.
+ *
+ * @param dev The device to communicate with.
+ * @param tx_val Value to send.
+ * @param rx_val Value to receive.
+ *
+ * @return SUCCESS or negative RPP error code.
+ */
+int8_t rpp_spi_transfer16(enum spi_device dev, uint16_t tx_val, uint16_t *rx_val);
+
+#endif