|
【已解决】SPI2 驱动mcp2515有人实现过吗?
发表于 2019-3-5 08:33:51
浏览:14318
|
回复:9
打印
只看该作者
[复制链接]
楼主
本帖最后由 hiking 于 2019-5-23 09:00 编辑
1、设备树
&spi2 {
status = "okay";
can0: can@0{
status = "okay";
compatible = "microchip,mcp2515";
pinctrl-names = "default";
pinctrl-0 = <&can0_pins>;
reg = <0>;
clocks = <&clk16m>;
spi-max-frequency = <10000000>;
interrupt-parent = <&gpio4>;
interrupts = <28 IRQ_TYPE_EDGE_FALLING>;
};
};
2、内核已经配置MCP251x
Linux Kernel Configuration
Networking support
CAN bus subsystem support
CAN device drivers
Platform CAN drivers with Netlink support
CAN bit-timing calculation
Microchip MCP251x SPI CAN controller
还需要哪里配置吗?
ls /sys/class/net/和busybox ifconfig 看不到can0
解决:
1.8电平的问题,使用转换模块转换一下;
|
|