int dummy_register_commands(struct command_context_s *cmd_ctx);\r
int dummy_init(void);\r
int dummy_quit(void);\r
+static int dummy_khz(int khz, int *jtag_speed);\r
+static int dummy_speed_div(int speed, int *khz);\r
\r
-/* The dummy driver is used to easily check the code path \r
+\r
+/* The dummy driver is used to easily check the code path\r
* where the target is unresponsive.\r
*/\r
-jtag_interface_t dummy_interface = \r
+jtag_interface_t dummy_interface =\r
{\r
.name = "dummy",\r
- \r
+\r
.execute_queue = bitbang_execute_queue,\r
\r
- .speed = dummy_speed, \r
+ .speed = dummy_speed,\r
.register_commands = dummy_register_commands,\r
+ .khz = dummy_khz,\r
+ .speed_div = dummy_speed_div,\r
+\r
.init = dummy_init,\r
.quit = dummy_quit,\r
};\r
{\r
}\r
\r
+static int dummy_khz(int khz, int *jtag_speed)\r
+{\r
+ if (khz==0)\r
+ {\r
+ *jtag_speed=0;\r
+ }\r
+ else\r
+ {\r
+ *jtag_speed=64000/khz;\r
+ }\r
+ return ERROR_OK;\r
+}\r
+\r
+static int dummy_speed_div(int speed, int *khz)\r
+{\r
+ if (speed==0)\r
+ {\r
+ *khz = 0;\r
+ }\r
+ else\r
+ {\r
+ *khz=64000/speed;\r
+ }\r
+\r
+ return ERROR_OK;\r
+}\r
+\r
int dummy_speed(int speed)\r
{\r
return ERROR_OK;\r
\r
int dummy_init(void)\r
{\r
- bitbang_interface = &dummy_bitbang; \r
+ bitbang_interface = &dummy_bitbang;\r
\r
return ERROR_OK;\r
}\r