A20_can_BUS 使用
2015-10-18 15:31
615 查看
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,
/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,
相关文章推荐
- UI - JSONParser
- HibernateQueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken
- 关于LigerUI表单元素的动态替换
- <PY> Python Zen
- 关于Fragment里面调取startActivityForResult 调取onActivityResult不执行原因
- 4.Xamarin.Forms中的几种页面
- Redis GEO 测试
- 可编辑的 ListCtrl 封装整合
- 【黑马训练营】IOS C语言指针
- 求和为0的最长序列
- 在KEIL中建立了工程之后,编译就出现这样的提示can't execute 'C:\Keil\C51\BIN\A51.EXE'
- Swift - 操作SQLite数据库(引用SQLite3库)
- MFC中的Invalidate、OnDraw、OnPaint函数的作用、区别和联系
- 2016-我的求职之路
- 使用JNDI连接数据库
- c_select 调用参数说明
- Handler的简单使用介绍
- Redis GEO 特性简介
- geohash算法原理及实现方式
- oracle的单行函数以及多行函数(聚合函数、分组函数)的使用