|
简单来说,只需要在platform.c中找到“static struct spi_board_info ls1x_spi0_devices[]”,加入类似
[cpp] view plain copy
<span style="font-size:18px;"><strong><span style="color:#6633FF;"><span style="background-color: rgb(255, 255, 255);">#ifdef CONFIG_SPI_MCP3201
{
.modalias = "mcp3201",
.bus_num = 0,
.chip_select = SPI0_CS3,
.max_speed_hz = 1000000,
},
#endif</span></span></strong></span>
就可以使用spi_read(),spi_write()和spi_write_then_read()来收发数据了。就这么简单
更详细的内容请参考
http://blog.csdn.net/caogos/article/details/52997867
|
|