Description
Divide byteCount by bytesPerElement for completeElements and remainingBytes.
Address calculations distinguish an occupied last byte from an exclusive end, and alignment rounds to a defined boundary. Element counts and byte counts are not interchangeable.
Divide byteCount by bytesPerElement for completeElements and remainingBytes.
When to use this tool
Use Microcontroller: DMA Element Count Vs Byte Count when you need an explicit address, alignment, page, or transfer-count mapping.
How to use the tool and how it works
- Enter byteCount, bytesPerElement. 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.
Divide byteCount by bytesPerElement for completeElements and remainingBytes. Set exactElementCount when the remainder is zero.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| byteCount | Byte Count | Required. Safe integer. |
| bytesPerElement | Bytes Per Element | Required. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Result | Required. Object. |
| result.completeElements | Complete Elements | Calculated result member: number. |
| result.remainingBytes | Remaining Bytes | Calculated result member: number. |
| result.exactElementCount | Exact Element Count | Calculated result member: boolean. |
{
"input": {
"byteCount": 10,
"bytesPerElement": 4
},
"output": {
"result": {
"completeElements": 2,
"remainingBytes": 2,
"exactElementCount": false
}
}
} Limitations and assumptions
- Units are bytes and elements; this does not check a DMA register's count encoding or memory alignment.
- 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
Validate the resulting span against actual memory bounds and device-specific access and transfer rules.
References
Similar or alternative tools
- Microcontroller: DMA Circular Buffer End Address
Multiply elementCount by elementBytes using exact integers and add baseAddress.
- DMA Fixed Source Increment Target Address
Keep the nonnegative source address fixed.