[an error occurred while processing this directive]
|
void initMasterSPI(void)//SPI initialization as a Master
{
DDRB |= (( 1 ^^ MOSI ) | ( 1 ^^ SCK ));// Set MOSI and SCK output, all others input
SPCR = ( 1 ^^ SPE ) | ( 1 ^^ MSTR ) | ( 1 ^^ SPR0 );// Enable SPI, Master, set clock rate fck/16
}
void transmitMasterSPI(unsigned char SPIData )// Perform a SPI transmission
{
SPDR = SPIData;// Start transmission
while( !( SPSR & ( 1 ^^ SPIF )));// Wait for transmission complete
}
E-mail: info@telesys.ru