Sensorian  1.0
C API Reference Guide Library
SPI.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (C) 2015 Sensorian
3  * *
4  * This file is part of Sensorian. *
5  * *
6  * Sensorian is free software: you can redistribute it and/or modify it *
7  * under the terms of the GNU Lesser General Public License as published *
8  * by the Free Software Foundation, either version 3 of the License, or *
9  * (at your option) any later version. *
10  * *
11  * Sensorian is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14  * GNU Lesser General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU Lesser General Public *
17  * License along with Sensorian. *
18  * If not, see <http://www.gnu.org/licenses/>. *
19  ****************************************************************************/
20 
28 #ifndef __SPI_H__
29 
30 #include "bcm2835.h"
31 
32 void SPI_Initialize(void);
33 unsigned char SPI_Write(unsigned char data);
34 void SPI_Write_Array(char* DATA, unsigned int length);
35 unsigned char SPI_Read(void);
36 void SPI_Read_Array(char* sArray, char* rArray, char length);
37 void SPI_Close(void);
38 
39 #endif
void SPI_Read_Array(char *sArray, char *rArray, char length)
Reads an array of data from the SPI bus.
Definition: SPI.c:86
void SPI_Initialize(void)
Initializes the SPI peripheral.
Definition: SPI.c:35
void SPI_Write_Array(char *DATA, unsigned int length)
Writes an array of bytes to the SPI bus.
Definition: SPI.c:74
void SPI_Close(void)
Close SPI bus, should not be called if another SPI device is being used.
Definition: SPI.c:95
unsigned char SPI_Write(unsigned char data)
Writes a byte of data to the SPI bus.
Definition: SPI.c:53
unsigned char SPI_Read(void)
Reads a byte of data from the SPI bus.
Definition: SPI.c:62