From 0c7939a5560d6311dc8a324ba01beaaad04f12d7 Mon Sep 17 00:00:00 2001 From: Thomas Ingleby Date: Fri, 16 May 2014 11:49:20 +0100 Subject: [PATCH] spi: changed write function prototype. * Added write_buf for buffer transfer Signed-off-by: Thomas Ingleby --- api/spi.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/api/spi.h b/api/spi.h index 111e892..09780ab 100644 --- a/api/spi.h +++ b/api/spi.h @@ -36,6 +36,7 @@ extern "C" { #include #include +#include #include "maa.h" @@ -72,14 +73,25 @@ maa_result_t maa_spi_mode(maa_spi_context* spi,unsigned short mode); */ maa_result_t maa_spi_frequency(maa_spi_context* spi, int hz); -/** Write to the SPI device. +/** Write Single Byte to the SPI device. * * @param spi the spid device clock frequency * @param data to send * - * @return data recevied on the miso line. + * @return data received on the miso line. */ -unsigned int maa_spi_write(maa_spi_context* spi, unsigned int data); +uint8_t maa_spi_write(maa_spi_context* spi, uint8_t data); + +/** Write Buffer of bytes to the SPI device. + * + * @param spi the spid device clock frequency + * @param data to send + * @param length elements within buffer, Max 4096 + * + * @return data received on the miso line. Same length as passed in. + */ +uint8_t* maa_spi_write_buf(maa_spi_context* spi, uint8_t data[], int length); + /** De-inits an maa_spi_context device *