 (资料图片)
(资料图片)
CONFIG_CAN=yCONFIG_CAN_DEV=yCONFIG_CAN_ROCKCHIP=yCONFIG_CANFD_ROCKCHIP=ycd kernelmake ARCH=arm64 menuconfigmake savedefconfiginterrupts = ;
转换完成,产生中断信号。
clock
时钟属性,用于驱动开关clk,reset属性,用于每次复位总线。
pinctrl
can1: can@fea60000 {            compatible = "rockchip,can-2.0";            reg = < 0x0 0xfea60000 0x0 0x1000 >;            interrupts = < GIC_SPI 342 IRQ_TYPE_LEVEL_HIGH >;            clocks = < &cru CLK_CAN1 >, < &cru PCLK_CAN1 >;            clock-names = "baudclk", "apb_pclk";            resets = < &cru SRST_CAN1 >, < &cru SRST_P_CAN1 >;            reset-names = "can", "can-apb";            pinctrl-names = "default";            pinctrl-0 = < &can1m0_pins >;            tx-fifo-depth = < 1 >;            rx-fifo-depth = < 6 >;            status = "disabled";    };/* can1 */&can1 {        status = "okay";        assigned-clocks = < &cru CLK_CAN1 >;        assigned-clock-rates = < 200000000 >;        pinctrl-names = "default";        pinctrl-0 = < &can1m1_pins >;      //根据原理图配置};ifconfig -aip link set can0 down   //关闭CANip link set can0 type can bitrate 500000   //设置⽐特率500KHzip -details -statistics link show can0    //打印can0信息ip link set can0 up     //启动CANcansend can0 123#DEADBEEF            //发送(标准帧,数据帧,ID:123,date:DEADBEEF)cansend can0 123#R                            //发送(标准帧,远程帧,ID:123)cansend can0 00000123#12345678    //发送(扩展帧,数据帧,ID:00000123,date:DEADBEEF)cansend can0 00000123#R                 //发送(扩展帧,远程帧,ID:00000123)candump can0       //candump can0审核编辑:汤梓红
X 关闭
Copyright © 2015-2022 人人安防网版权所有 备案号:粤ICP备18023326号-36 联系邮箱:8557298@qq.com