Class CmdDebug


  • public class CmdDebug
    extends Control.CommandGroup
    This class encapsulates encoding and decoding of all debugging commands.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Response<int[]> busRead​(long address, int len)
      Reads one of more words from memory.
      Response<int[]> busRmw​(int address, int[] data, int[] mask)
      Read, modify, write and readback an array.
      Response<java.lang.Void> busWrite​(long address, int[] data)
      Write one of more words from memory.
      Response<byte[]> i2cRead​(int ifc, int adr, int len)
      Reads bytes from an I2C interface
      Response<java.lang.Void> i2cWrite​(int ifc, int adr, byte[] data)
      Writes data to and I2C device.
      Response<byte[]> readFlash​(int chip, long addr)
      Reads FLASH_READ_SIZE bytes of flash
      Response<java.lang.String> uartRx​(int uartNo)
      Reads data from a UART buffer.
      Response<java.lang.Void> uartTx​(int uartNo, java.lang.String message)
      Writes data to a UART buffer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • busRead

        public Response<int[]> busRead​(long address,
                                       int len)
        Reads one of more words from memory.
        Parameters:
        address - The offset address
        len - The number of consecutive words to read
        Returns:
        A response with the words received as signed integer. AND with 0xFFFFFFFFL to get the unsigned value.
      • busWrite

        public Response<java.lang.Void> busWrite​(long address,
                                                 int[] data)
        Write one of more words from memory.
        Parameters:
        address - The offset address
        data - The data to write.
        Returns:
        A response with the words received as signed integer. AND with 0xFFFFFFFFL to get the unsigned value.
      • busRmw

        public Response<int[]> busRmw​(int address,
                                      int[] data,
                                      int[] mask)
        Read, modify, write and readback an array.
        Parameters:
        address - The offset address
        data - The data to write.
        mask - The mask to apply.
        Returns:
        A response with the words received as signed integer. AND with 0xFFFFFFFFL to get the unsigned value.
      • i2cRead

        public Response<byte[]> i2cRead​(int ifc,
                                        int adr,
                                        int len)
        Reads bytes from an I2C interface
        Parameters:
        ifc - The interface, see I2C* constants
        adr - The I2C device address without read/write bit (i.e. 7 bits)
        len - Number of bytes to read
        Returns:
        A response object yielding the read response as bytes.
      • i2cWrite

        public Response<java.lang.Void> i2cWrite​(int ifc,
                                                 int adr,
                                                 byte[] data)
        Writes data to and I2C device.
        Parameters:
        ifc - The interface, see I2C* constants
        adr - The I2C device address without read/write bit (i.e. 7 bits)
        data - The data to write to the I2C device.
        Returns:
        A void response.
      • uartRx

        public Response<java.lang.String> uartRx​(int uartNo)
        Reads data from a UART buffer.
        Parameters:
        uartNo - The uart, see UART*
        Returns:
        A response object yielding the response as a string.
      • uartTx

        public Response<java.lang.Void> uartTx​(int uartNo,
                                               java.lang.String message)
        Writes data to a UART buffer.
        Parameters:
        uartNo - The interface, see I2C* constants
        message - The message to send to the UART.
        Returns:
        A void response.
      • readFlash

        public Response<byte[]> readFlash​(int chip,
                                          long addr)
        Reads FLASH_READ_SIZE bytes of flash
        Parameters:
        chip - The flash chip index, currently just 0 is supported
        addr - The address in flash, FLASH_READ_SIZE bytes aligned
        Returns:
        A response with FLASH_READ_SIZE bytes of flash content