|
OpenOCD
|

Go to the source code of this file.
Data Structures | |
| struct | ch347_bit_op |
| struct | ch347_cmd |
| struct | ch347_info |
| struct | ch347_scan |
| struct | ch347_swd_context |
| struct | ch347_swd_io |
Enumerations | |
| enum | ch347_variant { CH347T = 0 , CH347F = 1 , OTHER_PRODUCT_ID = 2 } |
| enum | pack_size { UNSET = -1 , STANDARD_PACK = 0 , LARGER_PACK = 1 } |
Functions | |
| static void | ch347_activity_led_set (bool led_state, bool flush_now) |
| Turn the activity LED on or off Errors are intentionally ignored. More... | |
| static int | ch347_adapter_init (uint8_t clock_index, bool *supports_larger_pack_mode) |
| Sends the CH347_CMD_JTAG_INIT (D0) command to get the JTAG interface initialized with the speed index or asking with special clock index 9 for the LARGER_PACK mode support. More... | |
| static int | ch347_adapter_set_speed (uint8_t clock_index) |
| Sends the CH347_CMD_JTAG_INIT (D0) command to get the JTAG interface initialized with the speed index. More... | |
| static int | ch347_adapter_supports_larger_pack_mode (bool *supports_larger_pack_mode) |
| Sends the CH347_CMD_JTAG_INIT (D0) command to ask the JTAG interface with special clock index 9 for the LARGER_PACK mode support. More... | |
| static int | ch347_check_gpio_unique (enum adapter_gpio_config_index gpio_idx, unsigned int *gpios_used) |
| static bool | ch347_chk_buf_size (uint8_t cmd, uint32_t ap_delay_clk) |
| static void | ch347_cmd_calc_reads (struct ch347_cmd *cmd) |
| calculates the amount of bits and bytes that should be read for this command More... | |
| static int | ch347_cmd_from_scratchpad (void) |
| copy the scratchpad content into a new command in the command queue More... | |
| static bool | ch347_cmd_has_variable_data_size (uint8_t type) |
| static int | ch347_cmd_start_next (uint8_t type) |
| starts the next command in the scratchpad. More... | |
| static int | ch347_cmd_transmit_queue (void) |
| Sends all queued commands and puts the data read back into the scan fields. More... | |
| static int | ch347_cmd_transmit_queue_inner (void) |
| Sends the write buffer via libusb and if LARGER_PACK mode is active read also data back. More... | |
| static int | ch347_execute_queue (struct jtag_command *cmd_queue) |
| Executes the command queue. More... | |
| static int | ch347_exit_gpio (enum adapter_gpio_config_index gpio_idx, uint8_t *gpios_data, uint8_t *bit_op) |
| static unsigned int | ch347_get_gpio_num_or_default (enum adapter_gpio_config_index gpio_idx) |
| static struct ch347_swd_io * | ch347_get_one_swd_io (void) |
| static uint8_t | ch347_gpio_drive_value (bool level, enum adapter_gpio_drive_mode drive) |
| Translates an output level into a GPIO command byte for a drive mode. More... | |
| static int | ch347_gpios_update (uint8_t *gpios_data, bool bit_op, bool flush_now) |
| Update GPIOS or JTAG_BIT_OP controlled outputs Avoid failing on the first error - the second part may succeed. More... | |
| static int | ch347_init (void) |
| CH347 Initialization function. More... | |
| static int | ch347_init_gpio (enum adapter_gpio_config_index gpio_idx, uint8_t *gpios_data, uint8_t *bit_op) |
| static int | ch347_init_pack_size (void) |
| inits ch347.pack_size and ch347.max_len More... | |
| static bool | ch347_is_single_cmd_type (uint8_t type) |
| static int | ch347_open_device (void) |
| opens the CH347 device via libusb driver More... | |
| static void | ch347_queues_discard (void) |
| Drops everything queued but not transmitted yet: the scratchpad, the command queue and the scan fields waiting for data. More... | |
| static int | ch347_quit (void) |
| CH347 Device Release Function. More... | |
| static int | ch347_read_data (uint8_t *data, int buf_length, int *length) |
| reads data from the CH347 via libusb driver See https://libusb.sourceforge.io/api-1.0/libusb_packetoverflow.html for explanation of avoiding LIBUSB_TRANSFER_OVERFLOW More... | |
| static int | ch347_read_scan (uint8_t *decoded_buf, int decoded_buf_len, int raw_read_len) |
| Reads data back from CH347 and decode it byte- and bitwise into the buffer. More... | |
| static void | ch347_read_swd_reg (uint8_t cmd) |
| static int | ch347_reset (int trst, int srst) |
| Control (assert/deassert) the signals SRST and TRST on the interface. More... | |
| static int | ch347_scan_data_to_fields (uint8_t *decoded_buf, int decoded_buf_len) |
| Used to put the data from the decoded buffer into the scan command fields. More... | |
| static int | ch347_scan_queue_fields (struct scan_field *scan_fields, int scan_fields_len) |
| queue the scan fields into the scan queue More... | |
| static int | ch347_scratchpad_add_byte (uint8_t byte) |
| adds one byte to the scratchpad if scratchpad is full after this byte the command will be created from the scratchpad and the scratchpad is cleared for the next command More... | |
| static int | ch347_scratchpad_add_bytes (uint8_t *bytes, int count) |
| adds bytes from a buffer to the scratchpad if scratchpad is full after this byte the command will be created from the scratchpad and the scratchpad is cleared for the next command More... | |
| static int | ch347_scratchpad_add_clock_tms (bool tms) |
| Function used to change the TMS value at the rising edge of TCK to switch its TAP state. More... | |
| static int | ch347_scratchpad_add_move_path (struct pathmove_command *cmd) |
| Obtain the current Tap status and switch to the status TMS value passed down by cmd. More... | |
| static int | ch347_scratchpad_add_move_state (enum tap_state state, int skip) |
| Toggle the tap state to the target state. More... | |
| static int | ch347_scratchpad_add_pin_byte (void) |
| adds the output pin byte to the scratchpad if scratchpad is full after this byte the command will be created from the scratchpad and the scratchpad is cleared for the next command More... | |
| static int | ch347_scratchpad_add_run_test (int cycles, enum tap_state state) |
| Toggle the Tap state to run test/idle. More... | |
| static int | ch347_scratchpad_add_scan (struct scan_command *cmd) |
| Switch to SHIFT-DR or SHIFT-IR status for scanning. More... | |
| static int | ch347_scratchpad_add_stableclocks (int count) |
| Function adds a certain amount of TCK pulses without changing the TMS pin. More... | |
| static int | ch347_scratchpad_add_tck_idle (void) |
| Return TCK to its low idle level, if it isn't there already. More... | |
| static int | ch347_scratchpad_add_tms_change (const uint8_t *tms_value, int step, int skip) |
| Function that performs state switching by changing the value of TMS. More... | |
| static int | ch347_scratchpad_add_write_read (struct scan_command *cmd, uint8_t *bits, int bits_len, enum scan_type scan) |
| CH347 Batch read/write function. More... | |
| static void | ch347_scratchpad_check_full (void) |
| checks if the scratchpad is full. More... | |
| static int | ch347_set_gpio (enum adapter_gpio_config_index gpio_idx, bool active, uint8_t *gpios_data, uint8_t *bit_op) |
| static int | ch347_single_read_get_byte (uint8_t *byte) |
| Function executes the single command and deliver one byte from the buffer that's read back from USB. More... | |
| static int | ch347_sleep (int us) |
| Flushes the command buffer and sleeps for a specific timespan. More... | |
| static int | ch347_speed_get (int speed_idx, int *khz) |
| returns the speed in kHz for the given speed index More... | |
| static int | ch347_speed_get_index (int khz, int *speed_idx) |
| converts the requested speed to a CH347 speed index More... | |
| static int | ch347_speed_set (int speed_index) |
| Initializes the JTAG interface and set CH347 TCK frequency. More... | |
| static int | ch347_srst_enable (void) |
| Enable the dedicated SRST output on CH347F devices. More... | |
| static int | ch347_swd_init (void) |
| Initialization for the swd mode. More... | |
| static int | ch347_swd_init_cmd (uint8_t clock_divisor) |
| swd init function More... | |
| static int | ch347_swd_queue_cmd (uint8_t cmd, uint32_t *dst, uint32_t data, uint32_t ap_delay_clk) |
| static int | ch347_swd_queue_flush (void) |
| static int | ch347_swd_read_reg (uint8_t cmd, uint32_t *value, uint32_t ap_delay_clk) |
| static int | ch347_swd_run_queue (void) |
| static int | ch347_swd_run_queue_inner (void) |
| static int | ch347_swd_send_idle (uint32_t ap_delay_clk) |
| static int | ch347_swd_switch_out (enum swd_special_seq seq, const uint8_t *out, unsigned int out_len) |
| static int | ch347_swd_switch_seq (enum swd_special_seq seq) |
| static int | ch347_swd_write_reg (uint8_t cmd, uint32_t value, uint32_t ap_delay_clk) |
| static unsigned int | ch347_trst_gpio (void) |
| GPIO number of the TRST pin. More... | |
| static int | ch347_write_data (uint8_t *data, int *length) |
| writes data to the CH347 via libusb driver More... | |
| static void | ch347_write_spec_seq (const uint8_t *out, uint8_t out_len) |
| static void | ch347_write_swd_reg (uint8_t cmd, const uint32_t out) |
| static void | log_buf_dump (const uint8_t *data, unsigned int size, bool recv) |
Variables | |
| static struct ch347_info | ch347 |
| struct adapter_driver | ch347_adapter_driver |
| static const struct command_registration | ch347_command_handlers [] |
| static bool | ch347_dedicated_srst_enabled |
| static struct libusb_device_handle * | ch347_handle |
| static struct jtag_interface | ch347_interface |
| static const int | ch347_larger_pack_clock_speeds [] |
| static const int | ch347_standard_pack_clock_speeds [] |
| static const struct swd_driver | ch347_swd |
| static struct ch347_swd_context | ch347_swd_context |
| static const struct ch347_bit_op | ch347f_gpio_to_bit_op [GPIO_CNT_EXT] |
| static const struct ch347_bit_op | ch347t_gpio_to_bit_op [GPIO_CNT_EXT] |
| static const uint16_t | default_ch347_pids [] |
| static const uint16_t | default_ch347_vids [] = {DEFAULT_VENDOR_ID, DEFAULT_VENDOR_ID, DEFAULT_VENDOR_ID, 0} |
| static bool | swd_mode |
| #define CH347_MAX_RECV_BUF (USBC_PACKET_USBHS - CH347_CMD_HEADER) |
| #define CH347_MAX_SEND_BUF UCMDPKT_DATA_MAX_BYTES_USBHS |
| #define CH347_SWD_CLOCK_MAX_DIVISOR (CH347_MAX_PROCESSING_US / swd_seq_dormant_to_swd_len) |
| enum ch347_variant |
|
static |
Turn the activity LED on or off Errors are intentionally ignored.
Definition at line 1659 of file ch347.c.
References ADAPTER_GPIO_IDX_LED, ch347, ch347_gpios_update(), ch347_set_gpio(), ERROR_OK, GPIO_CNT, gpios, and ch347_info::led_is_on.
Referenced by ch347_execute_queue(), ch347_swd_run_queue(), and ch347_swd_run_queue_inner().
|
static |
Sends the CH347_CMD_JTAG_INIT (D0) command to get the JTAG interface initialized with the speed index or asking with special clock index 9 for the LARGER_PACK mode support.
| clock_index | Clock index; special clock index 9 is used for checking if the device supports the LARGER_PACK mode |
| supports_larger_pack_mode | returns true if the device supports the LARGER_PACK mode for newer CH347 devices; false if the device supports only the older STANDARD_PACK mode |
Definition at line 1946 of file ch347.c.
References CH347_CMD_JTAG_INIT, ch347_cmd_start_next(), ch347_scratchpad_add_byte(), ch347_scratchpad_add_pin_byte(), ch347_single_read_get_byte(), ERROR_OK, and mode.
Referenced by ch347_adapter_set_speed(), and ch347_adapter_supports_larger_pack_mode().
|
static |
Sends the CH347_CMD_JTAG_INIT (D0) command to get the JTAG interface initialized with the speed index.
| clock_index | Clock index |
Definition at line 1995 of file ch347.c.
References ch347_adapter_init().
Referenced by ch347_speed_set().
|
static |
Sends the CH347_CMD_JTAG_INIT (D0) command to ask the JTAG interface with special clock index 9 for the LARGER_PACK mode support.
| supports_larger_pack_mode | returns true if the device supports the LARGER_PACK mode for newer CH347 devices; false if the device supports only the older STANDARD_PACK mode |
Definition at line 1983 of file ch347.c.
References ch347_adapter_init(), and CH347_CMD_INIT_GET_MODE_CLOCK_INDEX_VALUE.
Referenced by ch347_init_pack_size().
|
static |
Definition at line 1463 of file ch347.c.
References adapter_gpio_get_config(), adapter_gpio_get_name(), ADAPTER_GPIO_NOT_SET, BIT, ERROR_FAIL, ERROR_OK, GPIO_CNT_EXT, adapter_gpio_config::gpio_num, and LOG_ERROR.
Referenced by ch347_init().
|
static |
Definition at line 2372 of file ch347.c.
References CH347_MAX_RECV_BUF, CH347_MAX_SEND_BUF, cmd, DIV_ROUND_UP, ch347_swd_context::need_recv_len, ch347_swd_context::send_len, SWD_CMD_APNDP, and SWD_CMD_RNW.
Referenced by ch347_swd_queue_cmd().
|
static |
calculates the amount of bits and bytes that should be read for this command
| cmd | command for the calculation |
Definition at line 492 of file ch347.c.
References CH347_CMD_GPIO, CH347_CMD_INIT_READ_LEN, CH347_CMD_JTAG_BIT_OP_RD, CH347_CMD_JTAG_DATA_SHIFT_RD, CH347_CMD_JTAG_INIT, CH347_CMD_PIN_SET, CH347_CMD_SWD, CH347_CMD_SWD_INIT, cmd, ch347_swd_context::need_recv_len, and TCK_H.
Referenced by ch347_cmd_from_scratchpad().
|
static |
copy the scratchpad content into a new command in the command queue
| scan_fields | array of scan_field's for data from the device |
| scan_fields_len | array length |
Definition at line 536 of file ch347.c.
References ch347, ch347_cmd_calc_reads(), cmd, ch347_info::cmd_queue, ERROR_FAIL, ERROR_OK, list_add_tail(), LOG_ERROR, ch347_info::scratchpad, ch347_info::scratchpad_cmd_type, and ch347_info::scratchpad_idx.
Referenced by ch347_cmd_start_next(), ch347_cmd_transmit_queue_inner(), ch347_scratchpad_add_write_read(), and ch347_scratchpad_check_full().
|
inlinestatic |
Definition at line 310 of file ch347.c.
References CH347_CMD_JTAG_BIT_OP, CH347_CMD_JTAG_BIT_OP_RD, CH347_CMD_JTAG_DATA_SHIFT, CH347_CMD_JTAG_DATA_SHIFT_RD, and type.
Referenced by ch347_cmd_start_next(), ch347_cmd_transmit_queue_inner(), and ch347_scratchpad_add_bytes().
|
static |
starts the next command in the scratchpad.
If it's the same command type it can concat the data bytes. no need to make a new command for this case
| type | command type |
Definition at line 903 of file ch347.c.
References ch347, ch347_cmd_from_scratchpad(), ch347_cmd_has_variable_data_size(), ch347_cmd_transmit_queue(), ch347_is_single_cmd_type(), ERROR_OK, ch347_info::scratchpad_cmd_type, ch347_info::scratchpad_idx, and type.
Referenced by ch347_adapter_init(), ch347_gpios_update(), ch347_scratchpad_add_move_path(), ch347_scratchpad_add_stableclocks(), ch347_scratchpad_add_tck_idle(), ch347_scratchpad_add_tms_change(), ch347_scratchpad_add_write_read(), ch347_srst_enable(), ch347_swd_init_cmd(), and ch347_swd_queue_flush().
|
static |
Sends all queued commands and puts the data read back into the scan fields.
On error, everything not transmitted yet is discarded
Definition at line 888 of file ch347.c.
References ch347_cmd_transmit_queue_inner(), ch347_queues_discard(), and ERROR_OK.
Referenced by ch347_cmd_start_next(), ch347_execute_queue(), ch347_gpios_update(), ch347_single_read_get_byte(), ch347_sleep(), and ch347_swd_queue_flush().
|
static |
Sends the write buffer via libusb and if LARGER_PACK mode is active read also data back.
Definition at line 754 of file ch347.c.
References ch347, ch347_cmd_from_scratchpad(), CH347_CMD_GPIO, ch347_cmd_has_variable_data_size(), CH347_CMD_HEADER, ch347_read_scan(), ch347_scan_data_to_fields(), ch347_write_data(), cmd, ch347_info::cmd_queue, DIV_ROUND_UP, ERROR_FAIL, ERROR_OK, h_u16_to_le(), HW_TDO_BUF_SIZE, list_del(), list_empty(), list_for_each_entry, list_for_each_entry_safe, LOG_ERROR, ch347_info::max_len, NULL, and USBC_PACKET_USBHS.
Referenced by ch347_cmd_transmit_queue().
|
static |
Executes the command queue.
Definition at line 1719 of file ch347.c.
References ch347_activity_led_set(), ch347_cmd_transmit_queue(), ch347_queues_discard(), ch347_scratchpad_add_move_path(), ch347_scratchpad_add_move_state(), ch347_scratchpad_add_run_test(), ch347_scratchpad_add_scan(), ch347_scratchpad_add_stableclocks(), ch347_scratchpad_add_tck_idle(), ch347_scratchpad_add_tms_change(), ch347_sleep(), cmd, ERROR_FAIL, ERROR_OK, JTAG_PATHMOVE, JTAG_RUNTEST, JTAG_SCAN, JTAG_SLEEP, JTAG_STABLECLOCKS, JTAG_TLR_RESET, JTAG_TMS, and LOG_ERROR.
|
static |
Definition at line 1599 of file ch347.c.
References ADAPTER_GPIO_EXIT_STATE_ACTIVE, ADAPTER_GPIO_EXIT_STATE_INPUT, ADAPTER_GPIO_EXIT_STATE_NO_CHANGE, adapter_gpio_get_config(), adapter_gpio_get_name(), ch347, ch347_get_gpio_num_or_default(), ch347_set_gpio(), ch347_info::cmd_gpio_allowed, ERROR_OK, adapter_gpio_config::exit_state, GPIO_CNT, adapter_gpio_config::gpio_num, GPIO_SET_INPUT, and LOG_WARNING.
Referenced by ch347_quit().
|
static |
Definition at line 1484 of file ch347.c.
References adapter_gpio_get_config(), ADAPTER_GPIO_IDX_SRST, ADAPTER_GPIO_IDX_TRST, ADAPTER_GPIO_NOT_SET, ch347, adapter_gpio_config::gpio_num, ch347_info::srst_default_gpio, and ch347_info::trst_default_gpio.
Referenced by ch347_exit_gpio(), ch347_init_gpio(), and ch347_set_gpio().
|
static |
Definition at line 2275 of file ch347.c.
References CH347_CMD_SWD_SEQ_W, ch347_swd_io::cmd, ch347_swd_io::dst, ch347_swd_context::free_cmd_head, list_del_init(), list_empty(), list_entry, ch347_swd_io::list_entry, list_first_entry, NULL, and ch347_swd_io::usb_cmd.
Referenced by ch347_swd_queue_cmd(), ch347_swd_send_idle(), and ch347_swd_switch_out().
|
static |
Translates an output level into a GPIO command byte for a drive mode.
The CH347 has no open drain output driver, so it gets emulated by switching the pin to input instead of driving the inactive level. The line then relies on an external pull resistor or on the target driving it.
| level | true to output a high level, false for a low level |
| drive | output drive mode to emulate |
Definition at line 1449 of file ch347.c.
References ADAPTER_GPIO_DRIVE_MODE_OPEN_DRAIN, ADAPTER_GPIO_DRIVE_MODE_OPEN_SOURCE, ADAPTER_GPIO_DRIVE_MODE_PUSH_PULL, GPIO_SET_H, GPIO_SET_INPUT, and GPIO_SET_L.
Referenced by ch347_set_gpio().
|
static |
Update GPIOS or JTAG_BIT_OP controlled outputs Avoid failing on the first error - the second part may succeed.
Definition at line 1625 of file ch347.c.
References CH347_CMD_GPIO, CH347_CMD_JTAG_BIT_OP, ch347_cmd_start_next(), ch347_cmd_transmit_queue(), ch347_scratchpad_add_bytes(), ch347_scratchpad_add_pin_byte(), ERROR_OK, and GPIO_CNT.
Referenced by ch347_activity_led_set(), ch347_init(), ch347_quit(), and ch347_reset().
|
static |
CH347 Initialization function.
Definition at line 2164 of file ch347.c.
References ADAPTER_GPIO_IDX_LED, ADAPTER_GPIO_IDX_SRST, ADAPTER_GPIO_IDX_TRST, ADAPTER_GPIO_NOT_SET, BIT, ch347, ch347_check_gpio_unique(), ch347_dedicated_srst_enabled, ch347_gpios_update(), ch347_init_gpio(), ch347_init_pack_size(), ch347_open_device(), ch347_srst_enable(), ch347_swd_init_cmd(), ch347_trst_gpio(), CH347F, ch347f_gpio_to_bit_op, CH347F_SRST_FAKE_GPIO, ch347t_gpio_to_bit_op, ch347_info::chip_variant, ch347_info::cmd_queue, ERROR_OK, GPIO_CNT, GPIO_CNT_EXT, gpios, INIT_LIST_HEAD(), ch347_bit_op::jtag_use, LOG_DEBUG, LOG_ERROR, LOG_WARNING, ch347_info::pack_size, ch347_info::scan_queue, ch347_info::srst_default_gpio, SRST_H, ch347_info::srst_pin, swd_mode, ch347_bit_op::swd_use, TAP_RESET, tap_set_state, TCK_H, TCK_L, ch347_info::tck_pin, TDI_L, ch347_info::tdi_pin, TMS_H, TMS_L, ch347_info::tms_pin, ch347_info::trst_default_gpio, TRST_H, ch347_info::trst_pin, and UNSET.
|
static |
Definition at line 1582 of file ch347.c.
References adapter_gpio_get_config(), adapter_gpio_get_name(), ADAPTER_GPIO_INIT_STATE_ACTIVE, ADAPTER_GPIO_INIT_STATE_INPUT, ch347, ch347_get_gpio_num_or_default(), ch347_set_gpio(), ch347_info::cmd_gpio_allowed, ERROR_OK, GPIO_CNT, adapter_gpio_config::gpio_num, GPIO_SET_INPUT, adapter_gpio_config::init_state, and LOG_WARNING.
Referenced by ch347_init().
|
static |
inits ch347.pack_size and ch347.max_len
Definition at line 2054 of file ch347.c.
References ch347, ch347_adapter_supports_larger_pack_mode(), ERROR_OK, LARGER_PACK, LARGER_PACK_MAX_SIZE, ch347_info::max_len, ch347_info::pack_size, STANDARD_PACK, UNSET, USBC_PACKET_USBHS, and ch347_info::use_bitwise_mode.
Referenced by ch347_init(), and ch347_speed_get().
|
inlinestatic |
Definition at line 302 of file ch347.c.
References CH347_CMD_JTAG_INIT, CH347_CMD_PIN_SET, CH347_CMD_SWD_INIT, and type.
Referenced by ch347_cmd_start_next().
|
static |
opens the CH347 device via libusb driver
Definition at line 1779 of file ch347.c.
References adapter_usb_get_pids(), adapter_usb_get_product_name(), adapter_usb_get_vids(), BYTEWISE_MODE_VERSION, ch347, ch347_handle, CH347F, CH347F_MPHSI_INTERFACE, CH347T, CH347T_MPHSI_INTERFACE, ch347_info::chip_variant, ch347_info::cmd_gpio_allowed, default_ch347_pids, default_ch347_vids, device, ERROR_FAIL, ERROR_OK, jtag_libusb_close(), jtag_libusb_control_transfer(), jtag_libusb_open(), LOG_ERROR, LOG_INFO, LOG_WARNING, NULL, ch347_info::swclk_5mhz_supported, swd_mode, USB_WRITE_TIMEOUT, ch347_info::use_bitwise_mode, and VENDOR_VERSION.
Referenced by ch347_init().
|
static |
Drops everything queued but not transmitted yet: the scratchpad, the command queue and the scan fields waiting for data.
Used in error paths, so stale commands are not sent with the next queue and stale scan fields (owned by the already freed jtag_command queue) are not filled in later.
Definition at line 729 of file ch347.c.
References ch347, cmd, ch347_info::cmd_queue, list_del(), list_for_each_entry_safe, scan, ch347_info::scan_queue, ch347_info::scratchpad_cmd_type, and ch347_info::scratchpad_idx.
Referenced by ch347_cmd_transmit_queue(), ch347_execute_queue(), and ch347_swd_queue_flush().
|
static |
CH347 Device Release Function.
Definition at line 1919 of file ch347.c.
References ADAPTER_GPIO_IDX_LED, ADAPTER_GPIO_IDX_SRST, ADAPTER_GPIO_IDX_TRST, ch347_exit_gpio(), ch347_gpios_update(), ch347_handle, GPIO_CNT, gpios, jtag_libusb_close(), and LOG_DEBUG.
|
static |
reads data from the CH347 via libusb driver See https://libusb.sourceforge.io/api-1.0/libusb_packetoverflow.html for explanation of avoiding LIBUSB_TRANSFER_OVERFLOW
| data | Point to the data buffer |
| buf_length | Maximal length, aligned up to USB packet size |
| length | Minimal requested data length in and real read length out |
Definition at line 459 of file ch347.c.
References CH347_EPIN, ch347_handle, ERROR_OK, jtag_libusb_bulk_read(), length, log_buf_dump(), LOG_DEBUG_IO, LOG_ERROR, LOG_LEVEL_IS, LOG_LVL_DEBUG_IO, and USB_READ_TIMEOUT.
Referenced by ch347_read_scan().
|
static |
Reads data back from CH347 and decode it byte- and bitwise into the buffer.
| decoded_buf | Point to a buffer to place the data to be decoded; need to be sized to the decoded size length; not the raw_read_len |
| decoded_buf_len | length of the decoded_buf |
| raw_read_len | Data length in bytes that should be read via libusb; the decoded length can be shorter |
Definition at line 574 of file ch347.c.
References ALIGN_UP, BIT, ch347, CH347_CMD_GPIO, CH347_CMD_INIT_READ_LEN, CH347_CMD_JTAG_BIT_OP_RD, CH347_CMD_JTAG_DATA_SHIFT_RD, CH347_CMD_JTAG_INIT, CH347_CMD_PIN_SET, CH347_CMD_SWD, CH347_CMD_SWD_INIT, ch347_read_data(), DIV_ROUND_UP, ERROR_FAIL, ERROR_OK, GPIO_CNT, ch347_info::gpio_status_buf, ch347_info::init_result_buf, ch347_info::init_result_len, le_to_h_u16(), LOG_ERROR, ch347_cmd::read_len, ch347_swd_context::recv_buf, ch347_swd_context::recv_len, type, and USBC_PACKET_USBHS.
Referenced by ch347_cmd_transmit_queue_inner().
|
static |
Definition at line 2343 of file ch347.c.
References CH347_CMD_SWD_REG_R, cmd, ch347_swd_context::need_recv_len, ch347_swd_context::send_buf, ch347_swd_context::send_len, and ch347_swd_context::total_swd_clk.
Referenced by ch347_swd_queue_cmd().
|
static |
Control (assert/deassert) the signals SRST and TRST on the interface.
Employs 'adapter gpio' configuration for both signals. Avoid failing on the first error - the second part may succeed
| trst | 1 to assert TRST, 0 to deassert TRST. |
| srst | 1 to assert SRST, 0 to deassert SRST. |
Definition at line 1683 of file ch347.c.
References ADAPTER_GPIO_IDX_SRST, ADAPTER_GPIO_IDX_TRST, ch347_gpios_update(), ch347_set_gpio(), ERROR_OK, GPIO_CNT, gpios, and LOG_DEBUG_IO.
|
static |
Used to put the data from the decoded buffer into the scan command fields.
| decoded_buf | Point to a buffer for the decoded data |
| decoded_buf_len | length of the decoded_buf |
Definition at line 675 of file ch347.c.
References bit_offset, buf_cpy(), buf_set_buf(), buf_to_hex_str(), ch347, DIV_ROUND_UP, ERROR_FAIL, ERROR_OK, list_del(), list_for_each_entry_safe, LOG_DEBUG, LOG_DEBUG_IO, LOG_ERROR, LOG_LEVEL_IS, LOG_LVL_DEBUG_IO, scan, and ch347_info::scan_queue.
Referenced by ch347_cmd_transmit_queue_inner().
|
static |
queue the scan fields into the scan queue
| scan_fields | array of scan field's for data from the device |
| scan_fields_len | array length |
Definition at line 945 of file ch347.c.
References ch347, ERROR_FAIL, ERROR_OK, list_add_tail(), LOG_ERROR, scan, and ch347_info::scan_queue.
Referenced by ch347_scratchpad_add_write_read().
|
static |
adds one byte to the scratchpad if scratchpad is full after this byte the command will be created from the scratchpad and the scratchpad is cleared for the next command
| byte | add this byte |
Definition at line 1005 of file ch347.c.
References ch347, ch347_scratchpad_check_full(), ERROR_FAIL, ERROR_OK, LOG_ERROR, ch347_info::scratchpad, ch347_info::scratchpad_cmd_type, and ch347_info::scratchpad_idx.
Referenced by ch347_adapter_init(), and ch347_scratchpad_add_pin_byte().
|
static |
adds bytes from a buffer to the scratchpad if scratchpad is full after this byte the command will be created from the scratchpad and the scratchpad is cleared for the next command
| bytes | add this bytes |
| count | byte count |
Definition at line 1044 of file ch347.c.
References ch347, ch347_cmd_has_variable_data_size(), ch347_scratchpad_check_full(), count, ERROR_FAIL, ERROR_OK, LOG_ERROR, ch347_info::scratchpad, ch347_info::scratchpad_cmd_type, ch347_info::scratchpad_idx, and UCMDPKT_DATA_MAX_BYTES_USBHS.
Referenced by ch347_gpios_update(), ch347_scratchpad_add_write_read(), ch347_srst_enable(), ch347_swd_init_cmd(), and ch347_swd_queue_flush().
|
static |
Function used to change the TMS value at the rising edge of TCK to switch its TAP state.
| tms | TMS value to be changed; true = output TMS high; false = output TMS low |
Definition at line 1128 of file ch347.c.
References ch347, ch347_scratchpad_add_pin_byte(), ERROR_OK, TCK_H, TCK_L, ch347_info::tck_pin, TMS_H, TMS_L, and ch347_info::tms_pin.
Referenced by ch347_scratchpad_add_move_path(), ch347_scratchpad_add_stableclocks(), and ch347_scratchpad_add_tms_change().
|
static |
Obtain the current Tap status and switch to the status TMS value passed down by cmd.
| cmd | Upper layer transfer command parameters |
Definition at line 1212 of file ch347.c.
References CH347_CMD_JTAG_BIT_OP, ch347_cmd_start_next(), ch347_scratchpad_add_clock_tms(), cmd, ERROR_JTAG_TRANSITION_INVALID, ERROR_OK, LOG_DEBUG_IO, LOG_ERROR, tap_get_state(), tap_set_state, and tap_state_transition().
Referenced by ch347_execute_queue().
|
static |
Toggle the tap state to the target state.
| state | Pre switch target path |
| skip | Number of digits to skip |
Definition at line 1246 of file ch347.c.
References ch347_scratchpad_add_tms_change(), ERROR_OK, LOG_DEBUG_IO, state, tap_get_state(), tap_get_tms_path(), tap_get_tms_path_len(), TAP_RESET, tap_set_state, and tap_state_name().
Referenced by ch347_execute_queue(), ch347_scratchpad_add_run_test(), and ch347_scratchpad_add_scan().
|
static |
adds the output pin byte to the scratchpad if scratchpad is full after this byte the command will be created from the scratchpad and the scratchpad is cleared for the next command
Definition at line 1024 of file ch347.c.
References ch347, ch347_dedicated_srst_enabled, ch347_scratchpad_add_byte(), ch347_info::srst_pin, ch347_info::tck_pin, ch347_info::tdi_pin, ch347_info::tms_pin, and ch347_info::trst_pin.
Referenced by ch347_adapter_init(), ch347_gpios_update(), ch347_scratchpad_add_clock_tms(), ch347_scratchpad_add_tck_idle(), and ch347_scratchpad_add_write_read().
|
static |
Toggle the Tap state to run test/idle.
| cycles | how many clock cycles for output |
| state | JTAG end state |
Definition at line 1367 of file ch347.c.
References ch347_scratchpad_add_move_state(), ch347_scratchpad_add_stableclocks(), ERROR_OK, LOG_DEBUG_IO, state, tap_get_state(), and TAP_IDLE.
Referenced by ch347_execute_queue().
|
static |
Switch to SHIFT-DR or SHIFT-IR status for scanning.
| cmd | Upper layer transfer command parameters |
Definition at line 1390 of file ch347.c.
References buf_to_hex_str(), ch347_scratchpad_add_move_state(), ch347_scratchpad_add_write_read(), cmd, ERROR_OK, jtag_build_buffer(), jtag_scan_type(), LOG_DEBUG_IO, LOG_LEVEL_IS, LOG_LVL_DEBUG_IO, NULL, TAP_DRSHIFT, TAP_IRSHIFT, and type.
Referenced by ch347_execute_queue().
|
static |
Function adds a certain amount of TCK pulses without changing the TMS pin.
| count | Amount of L/H TCK pulses to add |
Definition at line 1146 of file ch347.c.
References ch347, CH347_CMD_JTAG_BIT_OP, ch347_cmd_start_next(), ch347_scratchpad_add_clock_tms(), count, ERROR_OK, TMS_H, and ch347_info::tms_pin.
Referenced by ch347_execute_queue(), and ch347_scratchpad_add_run_test().
|
static |
Return TCK to its low idle level, if it isn't there already.
Does not generate a clock cycle.
Definition at line 1168 of file ch347.c.
References ch347, CH347_CMD_JTAG_BIT_OP, ch347_cmd_start_next(), ch347_scratchpad_add_pin_byte(), ERROR_OK, TCK_L, and ch347_info::tck_pin.
Referenced by ch347_execute_queue(), ch347_scratchpad_add_write_read(), and ch347_sleep().
|
static |
Function that performs state switching by changing the value of TMS.
| tms_value | The TMS values that need to be switched form one byte of data in the switching order |
| step | The number of bit values that need to be read from the tms_value value |
| skip | Count from the skip bit of tms_value to step |
Definition at line 1189 of file ch347.c.
References BIT, CH347_CMD_JTAG_BIT_OP, ch347_cmd_start_next(), ch347_scratchpad_add_clock_tms(), ERROR_OK, LOG_DEBUG_IO, and step().
Referenced by ch347_execute_queue(), and ch347_scratchpad_add_move_state().
|
static |
CH347 Batch read/write function.
| cmd | The scan command |
| bits | Read and write data this time |
| bits_len | Incoming data length in bits |
| scan | The transmission method of incoming data to determine whether to perform data reading |
Definition at line 1272 of file ch347.c.
References BIT, bits, ch347, ch347_cmd_from_scratchpad(), CH347_CMD_JTAG_BIT_OP, CH347_CMD_JTAG_BIT_OP_RD, CH347_CMD_JTAG_DATA_SHIFT, CH347_CMD_JTAG_DATA_SHIFT_RD, ch347_cmd_start_next(), ch347_scan_queue_fields(), ch347_scratchpad_add_bytes(), ch347_scratchpad_add_pin_byte(), ch347_scratchpad_add_tck_idle(), cmd, ERROR_OK, MAX_BITS_PER_BIT_OP, NULL, scan, SCAN_IN, SCAN_IO, TCK_H, TCK_L, ch347_info::tck_pin, TDI_H, TDI_L, ch347_info::tdi_pin, TMS_H, TMS_L, ch347_info::tms_pin, and ch347_info::use_bitwise_mode.
Referenced by ch347_scratchpad_add_scan().
|
static |
checks if the scratchpad is full.
If it's full the function creates a command from it and puts it into the command queue
Definition at line 987 of file ch347.c.
References ch347, ch347_cmd_from_scratchpad(), ch347_info::scratchpad_cmd_type, ch347_info::scratchpad_idx, type, and UCMDPKT_DATA_MAX_BYTES_USBHS.
Referenced by ch347_scratchpad_add_byte(), and ch347_scratchpad_add_bytes().
|
static |
Definition at line 1497 of file ch347.c.
References adapter_gpio_config::active_low, adapter_gpio_get_config(), adapter_gpio_get_name(), ADAPTER_GPIO_IDX_LED, ADAPTER_GPIO_NOT_SET, bit, ch347_bit_op::bit, ch347_info::bit_op_log_once, ch347, ch347_get_gpio_num_or_default(), ch347_gpio_drive_value(), CH347F, ch347f_gpio_to_bit_op, ch347t_gpio_to_bit_op, ch347_info::chip_variant, ch347_info::cmd_gpio_allowed, adapter_gpio_config::drive, ERROR_FAIL, ERROR_OK, GPIO_CNT, GPIO_CNT_EXT, adapter_gpio_config::gpio_num, GPIO_SET_INPUT, ch347_info::led_log_once, LOG_ERROR, LOG_WARNING, and ch347_bit_op::ptr.
Referenced by ch347_activity_led_set(), ch347_exit_gpio(), ch347_init_gpio(), and ch347_reset().
|
static |
Function executes the single command and deliver one byte from the buffer that's read back from USB.
| byte | returns result byte |
Definition at line 967 of file ch347.c.
References ch347, ch347_cmd_transmit_queue(), ERROR_FAIL, ERROR_OK, ch347_info::init_result_buf, ch347_info::init_result_len, and LOG_ERROR.
Referenced by ch347_adapter_init(), ch347_srst_enable(), and ch347_swd_init_cmd().
|
static |
Flushes the command buffer and sleeps for a specific timespan.
| us | Sleep time in microseconds |
Definition at line 1704 of file ch347.c.
References ch347_cmd_transmit_queue(), ch347_scratchpad_add_tck_idle(), ERROR_OK, jtag_sleep(), and LOG_DEBUG_IO.
Referenced by ch347_execute_queue().
|
static |
returns the speed in kHz for the given speed index
| speed_idx | CH347 speed index (JTAG) or clock divisor (SWD) |
| khz | Output of the speed in kHz |
Definition at line 2080 of file ch347.c.
References ch347, ch347_init_pack_size(), ch347_larger_pack_clock_speeds, ch347_standard_pack_clock_speeds, CH347_SWD_CLOCK_BASE, CH347_SWD_CLOCK_MAX, DIV_ROUND_UP, ERROR_OK, ch347_info::pack_size, STANDARD_PACK, and swd_mode.
|
static |
converts the requested speed to a CH347 speed index
If possible, selects the highest supported speed not exceeding the requested one.
| khz | Speed in kHz |
| speed_idx | Output of the CH347 speed index (JTAG) or clock divisor (SWD) |
|
static |
Initializes the JTAG interface and set CH347 TCK frequency.
| speed_index | speed index for JTAG_INIT command |
Definition at line 2035 of file ch347.c.
References ch347_adapter_set_speed(), ch347_swd_init_cmd(), ERROR_OK, LOG_ERROR, and swd_mode.
|
static |
Enable the dedicated SRST output on CH347F devices.
The 0xE2 command and its payload come from WCH's fork, commit 4fd5026aabb6 ("feat: Add CH347F SRST configuration"): https://github.com/WCHSoftGroup/ch347/commit/4fd5026aabb62b941317b5d156d0eeaef4c43108 That packet is {0xe2, 0x08, 0x00, 0x00, 0x81, ...}. The command queue adds the command and the length, so only the eight payload bytes are sent here. Bit 0 of the second payload byte selects the mode: 0x81 enables it and 0x80 disables it. Disabling does not tristate pin 8, so 0x80 is never sent.
The byte read back from PIN_SET has no documented meaning, so it is logged and does not decide whether initialization succeeded.
Pin 8 strongly drives low after the adapter powers up. PIN_SET only selects the dedicated output; a JTAG pin byte should follow to set the level.
Definition at line 1099 of file ch347.c.
References ARRAY_SIZE, CH347_CMD_PIN_SET, ch347_cmd_start_next(), ch347_dedicated_srst_enabled, ch347_scratchpad_add_bytes(), ch347_single_read_get_byte(), ERROR_OK, and LOG_DEBUG.
Referenced by ch347_init().
|
static |
Initialization for the swd mode.
Definition at line 2256 of file ch347.c.
References ch347_swd_context::ch347_cmd_buf, CH347_MAX_CMD_BUF, ERROR_OK, ch347_swd_context::free_cmd_head, INIT_LIST_HEAD(), list_add_tail(), ch347_swd_io::list_entry, LOG_INFO, ch347_swd_context::need_recv_len, ch347_swd_context::send_cmd_head, ch347_swd_context::send_len, and swd_mode.
|
static |
swd init function
| clock_divisor | Divisor of base SWD frequency 1 MHz or 0 for fast 5 MHz clock |
Definition at line 2007 of file ch347.c.
References ARRAY_SIZE, ch347_cmd_start_next(), CH347_CMD_SWD_INIT, ch347_scratchpad_add_bytes(), ch347_single_read_get_byte(), ch347_swd_context::clk_divisor, ERROR_OK, and LOG_DEBUG.
Referenced by ch347_init(), and ch347_speed_set().
|
static |
Definition at line 2640 of file ch347.c.
References ch347_chk_buf_size(), CH347_CMD_SWD_REG_R, CH347_CMD_SWD_REG_W, ch347_get_one_swd_io(), CH347_MAX_PROCESSING_US, ch347_read_swd_reg(), ch347_swd_run_queue_inner(), ch347_swd_send_idle(), ch347_write_swd_reg(), ch347_swd_context::clk_divisor, ch347_swd_io::cmd, cmd, ch347_swd_io::dst, ERROR_FAIL, ERROR_OK, list_add_tail(), ch347_swd_io::list_entry, LOG_DEBUG_IO, LOG_ERROR, NULL, ch347_swd_context::send_cmd_head, ch347_swd_context::sent_cmd_count, SWD_CMD_PARK, SWD_CMD_RNW, SWD_CMD_START, ch347_swd_context::total_swd_clk, ch347_swd_io::usb_cmd, and ch347_swd_io::value.
Referenced by ch347_swd_read_reg().
|
static |
Definition at line 2290 of file ch347.c.
References ch347_cmd_start_next(), CH347_CMD_SWD, ch347_cmd_transmit_queue(), ch347_queues_discard(), ch347_scratchpad_add_bytes(), ERROR_FAIL, ERROR_OK, LOG_ERROR, ch347_swd_context::need_recv_len, ch347_swd_context::recv_len, ch347_swd_context::send_buf, and ch347_swd_context::send_len.
Referenced by ch347_swd_run_queue_inner().
|
static |
Definition at line 2729 of file ch347.c.
References ch347_swd_queue_cmd(), cmd, SWD_CMD_RNW, and ch347_swd_io::value.
|
static |
Definition at line 2622 of file ch347.c.
References ch347_activity_led_set(), ch347_swd_run_queue_inner(), ch347_swd_send_idle(), and ERROR_OK.
|
static |
Definition at line 2498 of file ch347.c.
References buf_get_u32(), ch347, ch347_activity_led_set(), CH347_CMD_SWD_REG_R, CH347_CMD_SWD_REG_W, CH347_CMD_SWD_SEQ_W, ch347_swd_queue_flush(), ch347_swd_io::cmd, ch347_swd_io::dst, ERROR_FAIL, ERROR_OK, ERROR_SWD_FAIL, ch347_swd_context::free_cmd_head, ch347_info::led_is_on, list_add_tail(), list_del_init(), list_empty(), list_entry, ch347_swd_io::list_entry, list_for_each_safe, LOG_CUSTOM_LEVEL, LOG_DEBUG_IO, LOG_ERROR, LOG_LVL_DEBUG, LOG_LVL_DEBUG_IO, ch347_swd_context::need_recv_len, parity(), parity_u32(), ch347_swd_context::recv_buf, ch347_swd_context::recv_len, ch347_swd_context::send_cmd_head, ch347_swd_context::send_len, ch347_swd_context::sent_cmd_count, SWD_ACK_FAULT, SWD_ACK_OK, swd_ack_to_error_code(), SWD_ACK_WAIT, SWD_CMD_A32, SWD_CMD_APNDP, swd_cmd_returns_ack(), SWD_CMD_RNW, ch347_swd_context::total_swd_clk, ch347_swd_io::usb_cmd, and ch347_swd_io::value.
Referenced by ch347_swd_queue_cmd(), ch347_swd_run_queue(), and ch347_swd_send_idle().
|
static |
Definition at line 2419 of file ch347.c.
References ch347_get_one_swd_io(), CH347_MAX_PROCESSING_US, CH347_MAX_RECV_BUF, CH347_MAX_SEND_BUF, ch347_swd_run_queue_inner(), ch347_write_spec_seq(), ch347_swd_context::clk_divisor, DIV_ROUND_UP, ERROR_FAIL, ERROR_OK, list_add_tail(), ch347_swd_io::list_entry, LOG_DEBUG_IO, LOG_ERROR, ch347_swd_context::need_recv_len, NULL, ch347_swd_context::send_cmd_head, ch347_swd_context::send_len, ch347_swd_context::sent_cmd_count, and ch347_swd_context::total_swd_clk.
Referenced by ch347_swd_queue_cmd(), and ch347_swd_run_queue().
|
static |
Definition at line 2354 of file ch347.c.
References ch347_get_one_swd_io(), CH347_MAX_RECV_BUF, CH347_MAX_SEND_BUF, ch347_write_spec_seq(), DIV_ROUND_UP, ERROR_FAIL, ERROR_OK, list_add_tail(), ch347_swd_io::list_entry, ch347_swd_context::need_recv_len, ch347_swd_context::send_cmd_head, and ch347_swd_context::send_len.
Referenced by ch347_swd_switch_seq().
|
static |
Definition at line 2699 of file ch347.c.
References ch347_swd_switch_out(), DORMANT_TO_JTAG, DORMANT_TO_SWD, ERROR_FAIL, JTAG_TO_DORMANT, JTAG_TO_SWD, LINE_RESET, LOG_DEBUG, LOG_ERROR, swd_seq_dormant_to_jtag, swd_seq_dormant_to_jtag_len, swd_seq_dormant_to_swd, swd_seq_dormant_to_swd_len, swd_seq_jtag_to_dormant, swd_seq_jtag_to_dormant_len, swd_seq_jtag_to_swd, swd_seq_jtag_to_swd_len, swd_seq_line_reset, swd_seq_line_reset_len, swd_seq_swd_to_dormant, swd_seq_swd_to_dormant_len, swd_seq_swd_to_jtag, swd_seq_swd_to_jtag_len, SWD_TO_DORMANT, and SWD_TO_JTAG.
|
static |
|
inlinestatic |
GPIO number of the TRST pin.
Definition at line 1433 of file ch347.c.
References ch347, CH347F, CH347F_TRST_GPIO, CH347T_TRST_GPIO, and ch347_info::chip_variant.
Referenced by ch347_init().
|
static |
writes data to the CH347 via libusb driver
| data | Point to the data buffer |
| length | Data length in and out |
Definition at line 419 of file ch347.c.
References CH347_EPOUT, ch347_handle, ERROR_OK, jtag_libusb_bulk_write(), length, log_buf_dump(), LOG_DEBUG_IO, LOG_ERROR, LOG_LEVEL_IS, LOG_LVL_DEBUG_IO, and USB_WRITE_TIMEOUT.
Referenced by ch347_cmd_transmit_queue_inner().
|
static |
Definition at line 2331 of file ch347.c.
References CH347_CMD_SWD_SEQ_W, DIV_ROUND_UP, ch347_swd_context::need_recv_len, ch347_swd_context::send_buf, ch347_swd_context::send_len, and ch347_swd_context::total_swd_clk.
Referenced by ch347_swd_send_idle(), and ch347_swd_switch_out().
|
static |
Definition at line 2316 of file ch347.c.
References CH347_CMD_SWD_REG_W, cmd, h_u32_to_le(), ch347_swd_context::need_recv_len, parity_u32(), ch347_swd_context::send_buf, ch347_swd_context::send_len, and ch347_swd_context::total_swd_clk.
Referenced by ch347_swd_queue_cmd().
|
static |
Definition at line 316 of file ch347.c.
References CH347_CMD_SWD, CH347_CMD_SWD_REG_R, CH347_CMD_SWD_REG_W, CH347_CMD_SWD_SEQ_W, cmd, DIV_ROUND_UP, hexify(), le_to_h_u16(), LOG_DEBUG_IO, size, and swd_cmd().
Referenced by ch347_read_data(), and ch347_write_data().
|
static |
Definition at line 275 of file ch347.c.
Referenced by ch347_activity_led_set(), ch347_cmd_from_scratchpad(), ch347_cmd_start_next(), ch347_cmd_transmit_queue_inner(), ch347_exit_gpio(), ch347_get_gpio_num_or_default(), ch347_init(), ch347_init_gpio(), ch347_init_pack_size(), ch347_open_device(), ch347_queues_discard(), ch347_read_scan(), ch347_scan_data_to_fields(), ch347_scan_queue_fields(), ch347_scratchpad_add_byte(), ch347_scratchpad_add_bytes(), ch347_scratchpad_add_clock_tms(), ch347_scratchpad_add_pin_byte(), ch347_scratchpad_add_stableclocks(), ch347_scratchpad_add_tck_idle(), ch347_scratchpad_add_write_read(), ch347_scratchpad_check_full(), ch347_set_gpio(), ch347_single_read_get_byte(), ch347_speed_get(), ch347_swd_run_queue_inner(), and ch347_trst_gpio().
| struct adapter_driver ch347_adapter_driver |
|
static |
|
static |
Definition at line 275 of file ch347.c.
Referenced by ch347_init(), ch347_scratchpad_add_pin_byte(), and ch347_srst_enable().
|
static |
Definition at line 277 of file ch347.c.
Referenced by ch347_open_device(), ch347_quit(), ch347_read_data(), and ch347_write_data().
|
static |
|
static |
Definition at line 181 of file ch347.c.
Referenced by ch347_speed_get().
|
static |
Definition at line 171 of file ch347.c.
Referenced by ch347_speed_get().
|
static |
|
static |
|
static |
Definition at line 277 of file ch347.c.
Referenced by ch347_init(), and ch347_set_gpio().
|
static |
Definition at line 277 of file ch347.c.
Referenced by ch347_init(), and ch347_set_gpio().
|
static |
|
static |
Definition at line 268 of file ch347.c.
Referenced by ch347_open_device().
|
static |
Definition at line 266 of file ch347.c.
Referenced by ch347_init(), ch347_open_device(), ch347_speed_get(), ch347_speed_set(), and ch347_swd_init().