1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! JTAG boundary scanning module.
//!
//! **WARNING**: This tool may damage your hardware in `EXTEST` mode, especially when the target
//! is not a development board: to reduce the risk, do not enable the output of any pin with
//! unknown functionality for a long time (the duration should be as short as possible).
//!
//! ## Usage
//!
//! ### Building the `PinScanner`
//! - Check for [compatible debug adapters](jtag_taps::cable), connect the adapter to the target,
//! connect the adapter to the PC and power on the target;
//! - With the `backend-jtag-taps` feature of `jtag-scanner` enabled, construct and configure a
//! [Cable](jtag_taps::cable::Cable) instance;
//! - Create a [`PinScannerBuilder`] with the `Cable` instance, and (optionally) check the result of
//! [get_id_codes](PinScannerBuilder::get_id_codes) to make sure the TAP chain is working;
//! - With the builder, call [scan_tap_info](PinScannerBuilder::scan_tap_info) with a directory path
//! for scanning BSDL files, then call [build](PinScannerBuilder::build) to build the [`PinScanner`].
//!
//! ### Using the `PinScanner`
//! - Enumerate in [tap_infos](PinScanner::tap_infos) to get the index of the TAP that you want to control.
//! - Get [`PinId`] values via [get_pin_id](PinScanner::get_pin_id), providing the port name as the argument;
//! or iterate through [pin_ids_for_tap](PinScanner::pin_ids_for_tap).
//! - Set the TAP to `SAMPLE` or `EXTEST` mode by [set_tap_state](PinScanner::set_tap_state).
//! - Call [get_pin_state](PinScanner::get_pin_state) or [set_pin_state](PinScanner::set_pin_state), and then
//! [update](PinScanner::update) or [write_update](PinScanner::write_update).
//! - Check [`PinScanner::batch`] if higher transmission efficiency is required.
//!
//! ### Creating bitbang IO interface adapters
//! Some adapters (e.g. I2C, NOR and NAND flash) may be added in the future. These adapters should
//! depend on [`PinGroup`] instead of using [`PinScanner`] directly; they are all under `protocols`
//! feature gate.
pub use ;