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
Run the bit.bitand() function.
Description
- This function performs a bitwise logical AND operation on two numbers.
TSP Syntax
| 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.
|
bitor
Run the bit.bitor() function.
Description
- This function performs a bitwise logical OR operation on two numbers.
TSP Syntax
| 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.
|
bitxor
Run the bit.bitxor() function.
Description
- This function performs a bitwise logical XOR (exclusive OR) operation on two numbers.
TSP Syntax
| 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.
|
clear
Run the bit.clear() function.
Description
- This function clears a bit at a specified index position.
TSP Syntax
| Parameters: |
-
value
(str)
–
-
index
(int)
–
One-based bit position within value to clear.
|
| Returns: |
-
str
–
The result of the function call.
|
get
Run the bit.get() function.
Description
- This function retrieves the weighted value of a bit at a specified index position.
TSP Syntax
| Parameters: |
-
value
(str)
–
-
index
(int)
–
One-based bit position within value to get.
|
| Returns: |
-
str
–
The result of the function call.
|
getfield
Run the bit.getfield() function.
Description
- This function returns a field of bits from the value starting at the specified index
position.
TSP Syntax
| Parameters: |
-
value
(str)
–
-
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.
|
set_
Run the bit.set() function.
Description
- This function sets a bit at the specified index position.
TSP Syntax
| Parameters: |
-
value
(str)
–
-
index
(int)
–
One-based bit position within value to set.
|
| Returns: |
-
str
–
The result of the function call.
|
setfield
Run the bit.setfield() function.
Description
- This function overwrites a bit field at a specified index position.
TSP Syntax
| Parameters: |
-
value
(str)
–
-
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.
|
test
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
| Parameters: |
-
value
(str)
–
-
index
(int)
–
One-based bit position within value to test.
|
| Returns: |
-
str
–
The result of the function call.
|
toggle
Run the bit.toggle() function.
Description
- This function toggles the value of a bit at a specified index position.
TSP Syntax
| Parameters: |
-
value
(str)
–
-
index
(int)
–
One-based bit position within value to toggle.
|
| Returns: |
-
str
–
The result of the function call.
|