Package org.km3net.clb.remote
Class CmdDebug
- java.lang.Object
-
- org.km3net.clb.remote.Control.CommandGroup
-
- org.km3net.clb.remote.CmdDebug
-
public class CmdDebug extends Control.CommandGroup
This class encapsulates encoding and decoding of all debugging commands.
-
-
Field Summary
Fields Modifier and Type Field Description static intFLASH_READ_SIZEstatic intI2C1CLB I2C interface 1static intI2C2CLB I2C interface 2static intI2C3CLB I2C interface 3static intUART_MAXstatic intUART1CLB UART 1static intUART2CLB UART 2static intUART3CLB UART 3static intUART4CLB UART 4-
Fields inherited from class org.km3net.clb.remote.Control.CommandGroup
ctl, msg
-
-
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 interfaceResponse<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 flashResponse<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.
-
-
-
Field Detail
-
I2C1
public static final int I2C1
CLB I2C interface 1- See Also:
- Constant Field Values
-
I2C2
public static final int I2C2
CLB I2C interface 2- See Also:
- Constant Field Values
-
I2C3
public static final int I2C3
CLB I2C interface 3- See Also:
- Constant Field Values
-
UART1
public static final int UART1
CLB UART 1- See Also:
- Constant Field Values
-
UART2
public static final int UART2
CLB UART 2- See Also:
- Constant Field Values
-
UART3
public static final int UART3
CLB UART 3- See Also:
- Constant Field Values
-
UART4
public static final int UART4
CLB UART 4- See Also:
- Constant Field Values
-
UART_MAX
public static final int UART_MAX
- See Also:
- Constant Field Values
-
FLASH_READ_SIZE
public static int FLASH_READ_SIZE
-
-
Method Detail
-
busRead
public Response<int[]> busRead(long address, int len)
Reads one of more words from memory.- Parameters:
address- The offset addresslen- 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 addressdata- 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 addressdata- 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* constantsadr- 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* constantsadr- 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* constantsmessage- 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 supportedaddr- The address in flash, FLASH_READ_SIZE bytes aligned- Returns:
- A response with FLASH_READ_SIZE bytes of flash content
-
-