;spi configuration
;-------------------------------------------------------------------------------
[spi0_para]
spi_used = 1
spi_cs_bitmap = 1
spi_cs0 = port:PI10<2><default><default><default>
spi_cs1 = port:PI14<2><default><default><default>
spi_sclk = port:PI11<2><default><default><default>
spi_mosi = port:PI12<2><default><default><default>
spi_miso = port:PI13<2><default><default><default>
;mcp2515_int ->PH19 -> = port:PH19<2><0><default><default>
;MCP2515_RESET ->PI9 -> = port:PI09<2><1><2><default>
;MCP2515_CS ->PI10
;MCP2515_SCK ->PI11
;MCP2515_SI ->PI12
;MCP2515_SO ->PI13
[spi_devices]
spi_dev_num = 1
[spi_board0]
modalias = "spidev"
max_speed_hz = 12000000
bus_num = 0
chip_select = 0
mode = 3
full_duplex = 0
manual_cs = 0
配置
private static final String mPathstr ="/sys/class/gpio_sw/P";
private static final String mDataName = "/data";
private static final String mPullName = "/pull";
private static final String mDrvLevelName = "/drv_level";
private static final String mMulSelName ="/mul_sel";
修改Kconfig
comment "SPI Protocol Masters"
config SPI_SPIDEV
tristate "User mode SPI device driver support"
#depends on EXPERIMENTAL
default y
help
This supports user mode SPI protocol drivers.
Note that this application programming interface is EXPERIMENTAL
and hence SUBJECT TO CHANGE WITHOUT NOTICE while it stabilizes.
adb shell
#cd dev
# ls ->如下:
3,编译Linux/\\192.168.94.129\jiang_dou\a20\A20-420-V12\lichee\linux-3.3\Documentation\spi/spidev-test.c
#adb push D:\spidev-test /
#adb shell
#chmod 777 spidev-test
# ./spidev-test -D /dev/spidev0.0
如下图: