Difference between revisions of "SPI"

From ArmadeusWiki
Jump to: navigation, search
m (Links)
(Linux configuration)
Line 15: Line 15:
  
 
== Linux configuration ==
 
== Linux configuration ==
 +
 +
SPI is used by some kernel driver, then selecting it will naturally select the corresponding SPI. To use the SPI from user space you have to unsure that correct spi is selected in «make linux26-menuconfig»:
 +
 +
<pre class="config">
 +
    Device Drivers  --->
 +
        [*] SPI support  --->
 +
            ...
 +
            <*>  Freescale iMX SPI controller
 +
            [*]    CSPI1
 +
            [*]    CSPI2
 +
            [*]    CSPI3
 +
            ...
 +
</pre>
 +
 +
And special user device option must be selected to :
 +
 +
<pre class="config">
 +
    Device Drivers  --->
 +
        [*] SPI support  --->
 +
            ...
 +
            *** SPI Protocol Masters ***
 +
            <M>  User mode SPI device driver support
 +
            ...
 +
</pre>
  
 
== Linux user space C code ==
 
== Linux user space C code ==

Revision as of 11:45, 16 December 2009

Page under construction... Construction.png Informations on this page are not guaranteed !!

This page will summarize the informations to use the SPI bus on our boards.

Overview

SPI (Serial Peripheral Interface) is a 3-wire full-duplex serial bus. Wires used in SPI are :

  • MOSI, Master Output Slave Input : send data to slave.
  • MISO, Master Input Slave Output : receive data from slave.
  • SCLK, : Serial Clock signal used to synchronise the transmission. (In imx27 (apf27) maximum frequency of SCLK is 22.167MHz in master mode and 16.625 in slave mode.
  • SSx, Slave Select : used to select the slave for communication with master.

On APF27, the i.MX27 contains 3 SPI devices that can be configured in master or slave. APF9328 (i.MXL) contains 2 SPI.

Linux configuration

SPI is used by some kernel driver, then selecting it will naturally select the corresponding SPI. To use the SPI from user space you have to unsure that correct spi is selected in «make linux26-menuconfig»:

    Device Drivers  --->
        [*] SPI support  --->
            ...
            <*>   Freescale iMX SPI controller 
            [*]     CSPI1
            [*]     CSPI2
            [*]     CSPI3
            ...

And special user device option must be selected to :

    Device Drivers  --->
        [*] SPI support  --->
            ...
            *** SPI Protocol Masters ***
            <M>   User mode SPI device driver support
            ...

Linux user space C code

Tested SPI chips

Links