3 #define DEBUG_REG printk
8 void ReadDataFromRegister(robo_info_t
*robo
, uint16 page_num
,uint16 addr_num
, uint16 len
, void* data
)
11 uint32 val32
= 0,val64
[2];
12 uint16 val16
=0,val48
[3];//,val32[2],val64[4];
16 DEBUG_REG("Read ioctl Page[0x%02x] Addr[0x%02x] len[%d].\n", page_num
, addr_num
, len
);
22 robo
->ops
->read_reg(robo
, page_num
, addr_num
, &val16
, len
);
23 DEBUG_REG("IRead 8/16 bit Page[0x%02x]addr[0x%02x]len[%d]val[0x%04x].\n",
24 page_num
, addr_num
, len
, val16
);
25 memcpy(data
,&val16
,2);
30 robo
->ops
->read_reg(robo
, page_num
, addr_num
, &val32
, len
);
31 DEBUG_REG("IRead 32bit Page[0x%02x]addr[0x%02x]len[%d]val[0x%08x].\n",
32 page_num
, addr_num
, len
, val32
);
33 memcpy(data
,&val32
,4);
38 robo
->ops
->read_reg(robo
, page_num
,addr_num
, &val48
, len
);
39 DEBUG_REG("IRead 48bit Page[0x%02x]addr[0x%02x]len[%d]val[0x%04x-0x%04x-0x%04x].\n",
40 page_num
, addr_num
, len
, val48
[0], val48
[1], val48
[2]);
41 memcpy(data
,&val48
,6);
46 robo
->ops
->read_reg(robo
, page_num
, addr_num
, &val64
, len
);
47 DEBUG_REG("IRead 64bit Page[0x%02x]addr[0x%02x]len[%d]val[0x%08x-0x%08x].\n",
48 page_num
, addr_num
, len
, val64
[0], val64
[1]);
49 memcpy(data
,&val64
,8);
57 void WriteDataToRegister(robo_info_t
*robo
,uint16 page_num
,uint16 addr_num
, uint16 len
, void* data
)
59 DEBUG_REG("Write ioctl Page[0x%02x]Addr[0x%02x]len[%d].\n",page_num
,addr_num
,len
);
65 DEBUG_REG("Write 2byte Page[0x%02x]addr[0x%02x]len[%d]val[0x%04x].\n",
66 page_num
, addr_num
, len
, *((uint16
*)data
));
67 robo
->ops
->write_reg(robo
, page_num
, addr_num
, data
, len
);
68 if (page_num
< 0x10 || page_num
> 0x17) {
69 robo
->ops
->read_reg(robo
, page_num
, addr_num
, data
, len
);
70 DEBUG_REG("Reload Page[0x%02x]addr[0x%02x]len[%d]val[0x%04x].\n",
71 page_num
, addr_num
, len
, *((uint16
*)data
));
77 DEBUG_REG("Write 4byte Page[0x%02x]addr[0x%02x]len[%d]val[0x%08x].\n",
78 page_num
, addr_num
, len
, *((uint32
*)data
));
79 robo
->ops
->write_reg(robo
, page_num
, addr_num
, data
, len
);
80 if (page_num
< 0x10 || page_num
> 0x17) {
81 robo
->ops
->read_reg(robo
, page_num
, addr_num
, data
, len
);
82 DEBUG_REG("Reload Page[0x%02x]addr[0x%02x]len[%d]val[0x%08x].\n",
83 page_num
, addr_num
, len
, *((uint32
*)data
));
89 DEBUG_REG("Write 6byte Page[0x%02x]addr[0x%02x]len[%d]val[0x%04x-0x%04x-0x%04x].\n",
90 page_num
, addr_num
, len
, *((uint16
*)data
),*((((uint16
*)data
)+1)),
91 *(((uint16
*)data
)+2));
92 robo
->ops
->write_reg(robo
, page_num
, addr_num
, data
, len
);
93 robo
->ops
->read_reg(robo
, page_num
, addr_num
, data
, len
);
94 DEBUG_REG("Reload Page[0x%02x]addr[0x%02x]len[%d]val[0x%04x-0x%04x-0x%04x].\n",
95 page_num
, addr_num
, len
,*((uint16
*)data
),*((((uint16
*)data
)+1)),
96 *(((uint16
*)data
)+2));
101 DEBUG_REG("Write 8byte Page[0x%02x]addr[0x%02x]len[%d]val[0x%08x-0x%08x].\n",
102 page_num
, addr_num
, len
, *((uint32
*)data
),*(((uint32
*)data
)+1));
103 robo
->ops
->write_reg(robo
, page_num
, addr_num
, data
, len
);
104 robo
->ops
->read_reg(robo
, page_num
, addr_num
, data
, len
);
105 DEBUG_REG("Reload Page[0x%x]addr[0x%x]len[%d]val[0x%08x-0x%08x].\n",
106 page_num
, addr_num
, len
,*((uint32
*)data
), *(((uint32
*)data
)+1));
This page took 0.062218 seconds and 5 git commands to generate.