I have an example project that uses that twi code. I think its part of the Arduino wrapper. Its looks like this.
uartInit();// initialize UART (serial port)
then to write
data = 0x40;
data = 0x00;
result = twi_writeTo(0x52, data, 2, 1);
So I want to basically use the spi instead. Unfortunately I dont have much experience yet using it. My only use of it is a single byte.
static char spi_mSend ( char data)
/* Start transmission */
SPDR = data;
while(!(SPSR & (1<<SPIF)));
Can it be used like the twi?
these are the twi parameters
address: 7bit i2c device address
data: pointer to byte array
length: number of bytes in array
wait: boolean indicating to wait for write or not
Is spi limited to one byte? Or could one just stack the sends? I'm thinking timing is critical here.