/*
 * spi.h
 *
 * Created: 20.4.2015 18:51:08
 *  Author: MARTIN
 */ 
#ifndef SPI_H
#define SPI_H

#include "global.h"

// function prototypes

// SPI interface initializer
void spiInit(void);

// spiSendByte(u08 data) waits until the SPI interface is ready
// and then sends a single byte over the SPI port.  This command
// does not receive anything.
void spiSendByte(u08 data);

// spiTransferByte(u08 data) waits until the SPI interface is ready
// and then sends a single byte over the SPI port.  The function also
// returns the byte that was received during transmission.
u08 spiTransferByte(u08 data);

// spiTransferWord(u08 data) works just like spiTransferByte but
// operates on a whole word (16-bits of data).
u16 spiTransferWord(u16 data);

#endif