This is an old revision of the document!
Table of Contents
SPI
This page introduces how you can interface your SPI devices to ODROID-C1/C1+/C0.
H/W connection
SPI (/dev/spidev0.0)
Pin Number | Net Name | Export Number |
---|---|---|
C0/C1/C1+ | ||
19 | SPI-MOSI(GPIOX.10) | 107 |
21 | SPI-MISO(GPIOX.9) | 106 |
23 | SPI-SCLK(GPIOX.8) | 105 |
24 | SPI-CEN0(GPIOX.20) | 117 |
Loading SPI driver
Dedicated pins for SPI are configured for GPIO, these pins can be configured as I2C bus while change the pin configuration. In order to change the configuration, you must load the driver.
$ modprobe spicc
SPIDEV Test
spidev 8 bits per word, clock speed = 1Mhz
$ sudo ./spidev_test -D /dev/spidev0.0 -s 1000000 -b 8
spidev 16 bits per word, clock speed = 1Mhz
$ sudo ./spidev_test -D /dev/spidev0.0 -s 1000000 -b 8
spidev 32 bits per word, clock speed = 1Mhz
$ sudo ./spidev_test -D /dev/spidev0.0 -s 1000000 -b 8
#include <stdio.h>