A20_can_BUS 使用

1,kernel_driver

/driver/net/sunxi_can/sun7i_can.c


a,  /driver/net/sunxi_can/Makefile

      #add by jiangdou
obj-$(CONFIG_CAN_SUN7I) += sun7i_can.o

b:   /driver/net/sunxi_can/Kconfig

 #add by jiangdou for sunxi_can

config CAN_SUN7I
        tristate "Sun7i CAN bus controller"
        default n
        help
        This is the Sun7i CAN BUS driver for android system by peter chen.

1:    /driver/net/can/Kconfig

#add by jiangdou for sunxi_can

source "drivers/net/can/sunxi_can/Kconfig"


2:  driver/net/can/Makefile

 #add by jiangdou for sunxi_can
obj-$(CONFIG_CAN_SUN7I) += sunxi_can/


B:  modify   sys_config.fex

[can_para]
can_used = 1
can_tx              = port:PH20<4><default><default><default>
can_rx              = port:PH21<4><default><default><default>


C:  test

 root@sunxi#  ifconfig can0 up

<3>can0: bit-timing not yet defined
can0: bit-timing not yet defined
SIOCSIFFLAGS: Invalid argument


root@sunxi#  ip link set can0 type can bitrate 125000 triple-sampling on       //first  run

root@sunxi#  ifconfig can0 up               //then run




root@sunxi#  ifconfig 

can0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          UP RUNNING NOARP  MTU:16  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:10 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:58 

eth0      Link encap:Ethernet  HWaddr 02:c8:0b:41:f5:73  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:87 Base address:0x2000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:384 errors:0 dropped:0 overruns:0 frame:0
          TX packets:384 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:25728 (25.1 KiB)  TX bytes:25728 (25.1 KiB)




3,


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值