OpenOCD
|
Implementation of the OpenULINK communication protocol. More...
Go to the source code of this file.
Functions | |
void | command_loop (void) |
Forever wait for commands and execute them as they arrive. More... | |
bool | execute_command (void) |
Executes one command and updates global command indexes. More... | |
void | execute_set_led_command (void) |
Execute a SET_LEDS command. More... | |
Variables | |
volatile uint8_t | cmd_id_index |
Index in EP2 Bulk-OUT data buffer that contains the current command ID. More... | |
volatile uint8_t | payload_index_in |
Number of data bytes already in EP2 Bulk-IN buffer. More... | |
Implementation of the OpenULINK communication protocol.
The OpenULINK protocol uses one OUT and one IN endpoint. These two endpoints are configured to use the maximum packet size for full-speed transfers, 64 bytes. Commands always start with a command ID (see msgtypes.h for command ID definitions) and contain zero or more payload data bytes in both transfer directions (IN and OUT). The payload
Almost all commands contain a fixed number of payload data bytes. The number of payload data bytes for the IN and OUT direction does not need to be the same.
Multiple commands may be sent in one EP2 Bulk-OUT packet. Because the OpenULINK firmware does not perform bounds checking for EP2 Bulk-IN packets, the host MUST ensure that the commands sent in the OUT packet require a maximum of 64 bytes of IN data.
Definition in file protocol.c.
void command_loop | ( | void | ) |
Forever wait for commands and execute them as they arrive.
Definition at line 193 of file protocol.c.
References CLEAR_COM_LED, cmd_id_index, EP2_in, EP2_out, execute_command(), payload_index_in, and SET_COM_LED.
Referenced by main().
bool execute_command | ( | void | ) |
Executes one command and updates global command indexes.
Definition at line 70 of file protocol.c.
References CMD_CLOCK_TCK, CMD_CLOCK_TMS, CMD_CONFIGURE_TCK_FREQ, CMD_GET_SIGNALS, cmd_id_index, CMD_SCAN_IN, CMD_SCAN_IO, CMD_SCAN_OUT, CMD_SET_LEDS, CMD_SET_SIGNALS, CMD_SLEEP_MS, CMD_SLEEP_US, CMD_SLOW_CLOCK_TCK, CMD_SLOW_CLOCK_TMS, CMD_SLOW_SCAN_IN, CMD_SLOW_SCAN_IO, CMD_SLOW_SCAN_OUT, CMD_TEST, count, delay_ms(), delay_us(), execute_set_led_command(), jtag_clock_tck(), jtag_clock_tms(), jtag_configure_tck_delay(), jtag_get_signals(), jtag_scan_in(), jtag_scan_io(), jtag_scan_out(), jtag_set_signals(), jtag_slow_clock_tck(), jtag_slow_clock_tms(), jtag_slow_scan_in(), jtag_slow_scan_io(), jtag_slow_scan_out(), and payload_index_in.
Referenced by command_loop().
void execute_set_led_command | ( | void | ) |
Execute a SET_LEDS command.
Definition at line 46 of file protocol.c.
References CLEAR_COM_LED, CLEAR_RUN_LED, cmd_id_index, COM_LED_OFF, COM_LED_ON, RUN_LED_OFF, RUN_LED_ON, SET_COM_LED, and SET_RUN_LED.
Referenced by execute_command().
volatile uint8_t cmd_id_index |
Index in EP2 Bulk-OUT data buffer that contains the current command ID.
Definition at line 38 of file protocol.c.
Referenced by command_loop(), execute_command(), and execute_set_led_command().
volatile uint8_t payload_index_in |
Number of data bytes already in EP2 Bulk-IN buffer.
Definition at line 41 of file protocol.c.
Referenced by command_loop(), and execute_command().