Spi
-
Upload
sean-chen -
Category
Technology
-
view
926 -
download
2
Transcript of Spi
SPI
2010/05/23 by sean chen
Agenda
•What’s SPI?•SPI Protocol•Data transfer •Iboot• Definition• Methods•References
What’s SPI?
• Definitiono The Serial Peripheral Interface Bus or SPI bus is a
synchronous serial data link standard named by Motorola that operates in full duplex mode.
o The SPI bus can operate with a single master device and with one or more slave devices.
SPI Protocol
• The SPI bus specifies four logic signals.o SCLK
Serial Clock (output from master) o MOSI/SIMO
Master Output, Slave Input (output from master) o MISO/SOMI
Master Input, Slave Output (output from slave) o SS
Slave Select (active low; output from master)
Time Wave Form
• CPHA=0o Read
Red Lineo Write
Blue Line
• CPHA=1o Read
Blue Lineo Write
Red Line
Iboot->Definition
Definitions• SPIRegister
o Controlo TxDatao RxDatao Status
• SPIInfo– IsMaster;– SPIClockSource clockSource;– txBuffer;– txCurrentLen;– rxBuffer;– RxCurrentLen;
iboot->methodsMethods
//gating clock •clock_gate_switch(SPI0_CLOCKGATE, ON);
•interrupt_install(SPI0_IRQ, spiIRQHandler, 0);
//interrupt •interrupt_enable(SPI0_IRQ);
•Ref:•Gate on/off
–On gates &= ~(1 << gate_flag);–Off gates |= 1 << gate_flag;
References
Serial Peripheral Interface Bushttp://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus
OpeniBoothttp://www.theiphonewiki.com/wiki/index.php?title=IPhoneLinux