?? spi.c
字號:
#include "common.h"
//******************************************
// SPI MODEL
//******************************************
void SPI_MasterInit(void)
{
DDR_SPI |= (1<<DD_MOSI)|(1<<DD_SCK); // Set MOSI and SCK output, all others input
//SPCR = (1<<SPSR);
SPCR = (1<<SPE)|(1<<MSTR); // Enable SPI, Master, set clock rate fck/16
}
void SPI_MasterTransmit(uchar cData)
{
SPDR = cData; // Start transmission
while(!(SPSR & (1<<SPIF))); // Wait for transmission complete
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -