|
Navigation: Bibliotheken > SPI > SPI_Enable |
![]() ![]()
|
SPI Funktionen
Syntax
void SPI_Enable(byte ctrl);
Sub SPI_Enable(ctrl As Byte)
Beschreibung
Die SPI Schnittstelle wird mit dem Wert von ctrl initialisiert (siehe SPCR Register in Atmel Mega Reference Manual).
Parameter
| ctrl | Initialisierungsparameter (Mega SPCR Register) |
Bit 7 - SPI Interrupt Enable (nicht einschalten, kann von C-Control Pro nicht genutzt werden)
Bit 6 - SPI Enable (muß gesetzt sein)
Bit 5 - Data Order (1 = LSB first, 0 = MSB first)
Bit 4 - Master/Slave Select (1 = Master, 0 = Slave)
Bit 3 - Clock polarity (1 = leading edge falling, 0 = leading edge rising)
Bit 2 - Clock Phase (1 = sample on trailing edge, 0 = sample on leading edge)
Bit 1 |
Bit 0 |
SCK Frequency |
0 |
0 |
fOsc / 4 |
0 |
1 |
fOsc / 16 |
1 |
0 |
fOsc / 64 |
1 |
1 |
fOsc / 128 |