SPI 2010/05/23 by sean chen
Agenda <ul><li>What’s SPI? </li></ul><ul><li>SPI Protocol </li></ul><ul><li>Data transfer   </li></ul><ul><li>Iboot </li><...
What’s SPI? <ul><ul><li>Definition </li></ul></ul><ul><ul><ul><li>The  Serial Peripheral Interface Bus  or  SPI  bus is a ...
SPI Protocol <ul><ul><li>The SPI bus specifies four logic signals. </li></ul></ul><ul><ul><ul><li>SCLK  </li></ul></ul></u...
Time Wave Form <ul><ul><li>CPHA=0 </li></ul></ul><ul><ul><ul><li>Read  </li></ul></ul></ul><ul><ul><ul><ul><li>Red Line </...
Iboot->Definition <ul><li>Definitions </li></ul><ul><ul><li>SPIRegister </li></ul></ul><ul><ul><ul><li>Control </li></ul><...
iboot->methods <ul><li>Methods </li></ul><ul><li>//gating clock  </li></ul><ul><li>clock_gate_switch(SPI0_CLOCKGATE, ON); ...
References <ul><li>Serial Peripheral Interface Bus http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus </li></ul>...
Upcoming SlideShare
Loading in …5
×

Spi

1,213 views

Published on

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,213
On SlideShare
0
From Embeds
0
Number of Embeds
148
Actions
Shares
0
Downloads
25
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Spi

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

×