bit

The bit commands module.

These commands are used in the following models: MP5103

THIS FILE IS AUTO-GENERATED, IT SHOULD NOT BE MANUALLY MODIFIED.

Please report an issue if one is found.

Attributes and Functions
- bit.bitand()
- bit.bitor()
- bit.bitxor()
- bit.clear()
- bit.get()
- bit.getfield()
- bit.set()
- bit.setfield()
- bit.test()
- bit.toggle()

Bit

Bases: BaseTSPCmd

The bit command tree.

Properties and methods
  • .bitand(): The bit.bitand() function.
  • .bitor(): The bit.bitor() function.
  • .bitxor(): The bit.bitxor() function.
  • .clear(): The bit.clear() function.
  • .get(): The bit.get() function.
  • .getfield(): The bit.getfield() function.
  • .set(): The bit.set() function.
  • .setfield(): The bit.setfield() function.
  • .test(): The bit.test() function.
  • .toggle(): The bit.toggle() function.

bitand

bitand(value1: str, value2: str) -> str

Run the bit.bitand() function.

Description
  • This function performs a bitwise logical AND operation on two numbers.
TSP Syntax
- bit.bitand()
Parameters:
  • value1 (str) –

    Operand for the logical AND operation; cannot be a negative number.

  • value2 (str) –

    Operand for the logical AND operation; cannot be a negative number.

Returns:
  • str

    The result of the function call.

Raises:

bitor

bitor(value1: str, value2: str) -> str

Run the bit.bitor() function.

Description
  • This function performs a bitwise logical OR operation on two numbers.
TSP Syntax
- bit.bitor()
Parameters:
  • value1 (str) –

    Operand for the logical OR operation; cannot be a negative number.

  • value2 (str) –

    Operand for the logical OR operation; cannot be a negative number.

Returns:
  • str

    The result of the function call.

Raises:

bitxor

bitxor(value1: str, value2: str) -> str

Run the bit.bitxor() function.

Description
  • This function performs a bitwise logical XOR (exclusive OR) operation on two numbers.
TSP Syntax
- bit.bitxor()
Parameters:
  • value1 (str) –

    Operand for the logical XOR operation; cannot be a negative number.

  • value2 (str) –

    Operand for the logical XOR operation; cannot be a negative number.

Returns:
  • str

    The result of the function call.

Raises:

clear

clear(value: str, index: int) -> str

Run the bit.clear() function.

Description
  • This function clears a bit at a specified index position.
TSP Syntax
- bit.clear()
Parameters:
  • value (str) –

    Specified number.

  • index (int) –

    One-based bit position within value to clear.

Returns:
  • str

    The result of the function call.

Raises:

get

get(value: str, index: int) -> str

Run the bit.get() function.

Description
  • This function retrieves the weighted value of a bit at a specified index position.
TSP Syntax
- bit.get()
Parameters:
  • value (str) –

    Specified number.

  • index (int) –

    One-based bit position within value to get.

Returns:
  • str

    The result of the function call.

Raises:

getfield

getfield(value: str, index: int, width: int) -> str

Run the bit.getfield() function.

Description
  • This function returns a field of bits from the value starting at the specified index position.
TSP Syntax
- bit.getfield()
Parameters:
  • value (str) –

    Specified number.

  • index (int) –

    One-based bit position within value to get.

  • width (int) –

    The number of bits to include in the field.

Returns:
  • str

    The result of the function call.

Raises:

set_

set_(value: str, index: int) -> str

Run the bit.set() function.

Description
  • This function sets a bit at the specified index position.
TSP Syntax
- bit.set()
Parameters:
  • value (str) –

    Specified number.

  • index (int) –

    One-based bit position within value to set.

Returns:
  • str

    The result of the function call.

Raises:

setfield

setfield(value: str, index: int, width: int, field_value: str) -> str

Run the bit.setfield() function.

Description
  • This function overwrites a bit field at a specified index position.
TSP Syntax
- bit.setfield()
Parameters:
  • value (str) –

    Specified number.

  • index (int) –

    One-based bit position in value to set.

  • width (int) –

    The number of bits to include in the field.

  • field_value (str) –

    Value to write to the field.

Returns:
  • str

    The result of the function call.

Raises:

test

test(value: str, index: int) -> str

Run the bit.test() function.

Description
  • This function returns the Boolean value (true or false) of a bit at the specified index posiion.
TSP Syntax
- bit.test()
Parameters:
  • value (str) –

    Specified number.

  • index (int) –

    One-based bit position within value to test.

Returns:
  • str

    The result of the function call.

Raises:

toggle

toggle(value: str, index: int) -> str

Run the bit.toggle() function.

Description
  • This function toggles the value of a bit at a specified index position.
TSP Syntax
- bit.toggle()
Parameters:
  • value (str) –

    Specified number.

  • index (int) –

    One-based bit position within value to toggle.

Returns:
  • str

    The result of the function call.

Raises: