Description
Calculate aliasOffset = byteOffset × 32 + bit × 4 for a byte offset within a one-megabyte region and bit in 0-7.
A register mask selects bits within a fixed width. Read-clear and write-one-to-clear semantics describe state transitions that differ from ordinary assignment.
Calculate aliasOffset = byteOffset × 32 + bit × 4 for a byte offset within a one-megabyte region and bit in 0-7.
When to use this tool
Use Microcontroller: GPIO Register Bit Band Offset when you need a deterministic fixed-width field or register-state calculation.
How to use the tool and how it works
- Enter byteOffset, bit. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read result. Expand result to inspect the returned fields.
Calculate aliasOffset = byteOffset × 32 + bit × 4 for a byte offset within a one-megabyte region and bit in 0-7.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| byteOffset | Byte Offset | Required. Safe integer. |
| bit | Bit | Required. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Result | Required. Object. |
| result.aliasOffset | Alias Offset | Calculated result member: number. |
{
"input": {
"byteOffset": 2,
"bit": 3
},
"output": {
"result": {
"aliasOffset": 76
}
}
} Limitations and assumptions
- This returns an offset rather than an absolute alias address; bit-band availability and region bases are device specific.
- Outputs are nested inside result. Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Use the device's access semantics and account for concurrent hardware changes before applying a register operation.
References
Similar or alternative tools
- ADC Code Left Alignment Register Mask
Multiply code by 2^(registerBits - bits) to left-align it; apply the same shift to an all-ones code mask.
- Flash Erased Word Zero Bit Flag
Parse a width-bounded unsigned decimal word.