Instructions

343 C-Control Pro IDE
© 2013 Conrad Electronic
Sub SPI_WriteBuf(ByRef buf As Byte, length As Word)
Description
A number of bytes are sent to the SPI interface.
Parameter
buf pointer to byte array
length number of bytes to be transferred
5.23.2 AVR32Bit
5.23.2.1 SPI_Disable
SPI Functions
Syntax
void SPI_Disable(byte chan);
Sub SPI_Disable(chan As Byte)
Description
The SPI interface is switched off and the associated ports can be used differently.
Parameter
chan SPI channel (0 - 1)
5.23.2.2 SPI_Enable
SPI Functions
Syntax
void SPI_Enable(byte chan, dword speed, byte bits, byte mode);
Sub SPI_Enable(chan As Byte, speed As ULong, bits As Byte, mode As Byte)
Description
The SPI interface is initialized at a clock rate, number of data bits and SPI mode. A divider is then calcu-
lated internally from the speed parameter, to set the chip to the desired baud rate. Since the divider can
only take a value between 1 and 255, the specified speed parameter is roughly maintained. The divider is