TQ2440
----------------------------------------------------------
以总线驱动at24c
[root@EmbedSky nfs]# ./test-at24.elf
ioctl write addr 0, return :1
ioctl write addr 1, return :1
ioctl write addr 2, return :1
ioctl write address, return :1
ioctl read, return :1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: 33 33 33 33 33 33 33 33 09 09 09 09 09 09 09 00
10: 04 04 04 04 04 04 04 04 18 19 1a 1b 1c 1d 1e 1f
20: fc fc fc fc fc fc fc fc 28 29 2a 2b 2c 2d 2e 2f
30: 40 40 40 40 40 40 40 40 50 50 50 3b 50 50 50 50
40: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f
50: 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f
60: 6b 34 37 63 64 65 62 61 68 69 6a 6b 6c 6d 6e 6f
70: 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f
open CHIP failed
<---- 没有加载设备,所以失败
----------------------------------------------------------
加载设备
[root@EmbedSky nfs]# insmod client.ko
get adapter : s3c2410-i2c
加载驱动
[root@EmbedSky nfs]# insmod at24.ko
at24_probe():432
at24 0-0050: 1024 byte at24 EEPROM (writable)
at24 0-0050: page_size 16, num_addresses 4, write_max 16
---------------------------------------------------------
以总线驱动和设备驱动方式读写at24c
[root@EmbedSky nfs]# ./test-at24.elf
ioctl write addr 0, return :1
ioctl write addr 1, return :1
ioctl write addr 2, return :1
ioctl write address, return :1
ioctl read, return :1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: 33 33 33 33 33 33 33 33 09 09 09 09 09 09 09 00
10: 04 04 04 04 04 04 04 04 18 19 1a 1b 1c 1d 1e 1f
20: fc fc fc fc fc fc fc fc 28 29 2a 2b 2c 2d 2e 2f
30: 40 40 40 40 40 40 40 40 50 50 50 3b 50 50 50 50
40: 40 41 42 43 44 45 44 26 47 48 49 4a 4b 4c 4d 4e 4f
50: 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f
60: 6b 34 37 63 64 65 62 61 68 69 6a 6b 6c 6d 6e 6f
70: 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: 33 33 33 33 09 09 09 09 09 09 09 00 04 04 04 04
10: 04 04 04 04 18 19 1a 1b 1c 1d 1e 1f fc fc fc fc
20: fc fc fc fc 28 29 2a 2b 2c 2d 2e 2f 40 40 40 40
30: 40 40 40 40 50 50 50 3b 50 50 50 50 40 41 42 43
40: 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53
50: 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 6b 34 37 63
60: 64 65 62 61 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73
70: 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83
本帖最后由 lzwml 于 2015-12-15 17:03 编辑