Coder Social home page Coder Social logo

ardutap's Introduction

Build with PlatformIO

ArduTAP: Simple Library for Working with JTAG TAP

ArduTAP is an Arduino library designed to facilitate communication with devices using the JTAG protocol and based on ArduJTAG library. It provides an intuitive and straightforward interface for interfacing with JTAG Test Access Ports (TAPs).

Features

  • Simple and easy-to-use API for interacting with JTAG devices.
  • Supports basic JTAG operations such as reading from and writing to instruction and data registers.
  • Allows setting up and controlling the JTAG communication speed and other parameters.

Install

  • Clone this repository into Arduino/Libraries or use the built-in Arduino IDE Library manager to install a copy of this library.

  • Include in your sketch

#include "TAP.hpp"

Install Using PlatformIO

Install ArduTAP using the platformio library manager in your editor, or using the PlatformIO Core CLI, or by adding it to your platformio.ini as shown below:

[env]
lib_deps =
    ArduTAP
[env]
lib_deps =
    https://github.com/Zamuhrishka/ArduTAP.git

Dependencies

Usage

Instruction structure

For current library any JTAG instruction must be rerpresent by next structure:

struct Instruction
{
  uint16_t code;    // Instruction code
  uint16_t ir_len;  // Length of the instruction register
  uint16_t dr_len;  // Length of the data register
};

For example if you want to execute IDCODE instruction then you need create next variable:

Instruction_s IDCODE = {.code = 0x1FE, .ir_len = 9, .dr_len = 32};

And use this variable as argument for TAP methods.

Read data from the TAP

For reading data, the following function is used:

/**
   * \brief Read data from the device by applying the given instruction and
   * storing the output
   *
   * \param instruction Instruction structure containing the code and lengths
   * \param data Pointer to a buffer where the output data will be stored
   */
  void read(const Instruction_s &instruction, uint8_t *data);

The data array will be store readded bits from TAP. Format of this bits are same as for ArduJTAG, please see accordig paragraph of the ArduJTAG README.md file.

Write data to the TAP

For writing data, the following function is used:

/**
   * \brief Write data to the device using the given instruction
   *
   * \param instruction Instruction structure containing the code and lengths
   * \param data Pointer to the data to be written
   */
  void write(const Instruction_s &instruction, /*const*/ uint8_t *data);

The data array will be store bits for write to TAP. Format of this bits are same as for ArduJTAG, please see accordig paragraph of the ArduJTAG README.md file.

Execute instruction

For executing, the following function is used:

/**
   * \brief Execute a JTAG operation given an instruction, input data, and an
   * output buffer
   *
   * \param instruction Instruction structure containing the code and lengths
   * \param input Pointer to the input data
   * \param output Pointer to the buffer where the output data will be stored
   */
  void execute(const Instruction_s &instruction, /*const*/ uint8_t *input, uint8_t *output);

The main feature of this function is that it give possibility wtite data to the TAP and read data from the TAP in same moment.

Raw read

If you need just read data from DR register without executing any instruction then you need use function:

/**
   * \brief Read raw data of specified length from the device
   *
   * \param input Pointer to the input data
   * \param data Pointer to a buffer where the output data will be stored
   * \param len Length of the data to read
   */
  void read_raw(uint8_t *input, uint8_t *data, uint16_t len);

More examples of using this library can be found in examples.

Contributing

Bug reports and/or pull requests are welcome.

Disclaimer

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

ardutap's People

Contributors

zamuhrishka avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.