Sensorian  1.0
C API Reference Guide Library
SPI.h File Reference

SPI library header. More...

#include "bcm2835.h"

Go to the source code of this file.

Functions

void SPI_Initialize (void)
 Initializes the SPI peripheral. More...
 
unsigned char SPI_Write (unsigned char data)
 Writes a byte of data to the SPI bus. More...
 
void SPI_Write_Array (char *DATA, unsigned int length)
 Writes an array of bytes to the SPI bus. More...
 
unsigned char SPI_Read (void)
 Reads a byte of data from the SPI bus. More...
 
void SPI_Read_Array (char *sArray, char *rArray, char length)
 Reads an array of data from the SPI bus. More...
 
void SPI_Close (void)
 Close SPI bus, should not be called if another SPI device is being used. More...
 

Detailed Description

SPI library header.

Author
D.Qendri
Date
30 May 2015

Definition in file SPI.h.

Function Documentation

void SPI_Close ( void  )

Close SPI bus, should not be called if another SPI device is being used.

Returns
none

Definition at line 95 of file SPI.c.

void SPI_Initialize ( void  )

Initializes the SPI peripheral.

Returns
none

Definition at line 35 of file SPI.c.

unsigned char SPI_Read ( void  )

Reads a byte of data from the SPI bus.

Returns
result Result of data written on SPI bus.

Definition at line 62 of file SPI.c.

void SPI_Read_Array ( char *  sArray,
char *  rArray,
char  length 
)

Reads an array of data from the SPI bus.

Parameters
sArrayBuffer of data to send
rArrayBuffer of data to send
lengthLength of data buffer
Returns
none

Definition at line 86 of file SPI.c.

unsigned char SPI_Write ( unsigned char  data)

Writes a byte of data to the SPI bus.

Parameters
dataByte data to write on bus
Returns
result Result of data written on SPI bus.

Definition at line 53 of file SPI.c.

void SPI_Write_Array ( char *  buff,
unsigned int  length 
)

Writes an array of bytes to the SPI bus.

Parameters
buffPointer to array of char data.
lengthLength of data array.
Returns
none

Definition at line 74 of file SPI.c.