|
发表于 2022-7-18 13:46:11
|
显示全部楼层
只要目录/dev/spidev1.1下生成了节点,内核驱动就没有问题了;飞凌提供的测试程序是自发自收的,您要用的话请把接收和发送部分开;
片选信号的修改:arch/arm/mach-omap2/board-am335xevm-xs.c
如下定义中am335x_spi1_slave_info
#elif defined(CONFIG_SPI_SPIDEV)
{ .modalias = "spidev",
.max_speed_hz = 48000000,//48Mbps
.bus_num = 2,
.chip_select = 0,
.mode = SPI_MODE_1,
},
#endif
};
根据所选的引脚配置 .chip_select,主要是mcasp0_ahclkr.spi1_cs0这个引脚,这个要选cpu有cs功能复用的引脚
static struct pinmux_config spi1_pin_mux[] =
{
#if defined(CONFIG_CAN_MCP251X)
{"gpmc_ad13.gpio1_13",OMAP_MUX_MODE7 | AM33XX_PIN_INPUT},
#endif
{"mcasp0_aclkx.spi1_sclk", OMAP_MUX_MODE3 | AM33XX_PULL_ENBL| AM33XX_INPUT_EN},
{"mcasp0_fsx.spi1_d0", OMAP_MUX_MODE3 | AM33XX_PULL_ENBL| AM33XX_PULL_UP | AM33XX_INPUT_EN},
{"mcasp0_axr0.spi1_d1", OMAP_MUX_MODE3 | AM33XX_PULL_ENBL| AM33XX_INPUT_EN},
{"mcasp0_ahclkr.spi1_cs0", OMAP_MUX_MODE3 | AM33XX_PULL_ENBL| AM33XX_PULL_UP | AM33XX_INPUT_EN},
{NULL, 0},
};
|
|