#include "Communication.h"

void SPI_init( uint8_t pin ){
	my_spi.pin=pin;
	pinMode(my_spi.pin, OUTPUT);
	digitalWrite(my_spi.pin, HIGH);
	SPI.begin()
	SPI.beginTransaction(SPISettings(14000000, MSBFIRST, SPI_MODE0));
}

void SPI_send(uint8_t *data, uin8_t len){
	digitalWrite(my_spi.pin, LOW);
	SPI.transfer(data,len);
	digitalWrite(my_spi.pin, HIGH);
}

void SPI_receive(uint8_t *data, uin8_t len){
	digitalWrite(my_spi.pin, LOW);
	SPI.transfer(data,len);
	digitalWrite(my_spi.pin, HIGH);
}