Do you have an example context in which you'd use these? I've never thought to do this and am curious about the possibilities and use cases.
Here an excerpt. Of course, it's not _necessary_ to do it like that. It's just flavor.
┏━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┳┅┅
┃ Chunk 1 Header │ Chunk 1 Body ┃ Chunk 2 Header │ Chunk 2 Body ┃
┗━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┻┅┅
Chunk Header:
┌───────────┬─────────────────┐
│ Magic Nr. │ Chunk Body Size │
│ 4 Byte │ 4 Byte │
└───────────┴─────────────────┘EG the TI bq25155[1] battery charge controller PCHRGCTRL register (page 52) is divided into 3 fields. It can be quite helpful to show the layout before code to set the range.
/*
* ┌───────────────┬──────────┬─────────┐
* │ ICHARGE_RANGE │ RESERVED │ IPRECHG │
* │ 7 │ 6-5 | 4-0 |
* └───────────────┴──────────┴─────────┘
* This function sets the precharge current
* and fast-charge current step size the
* nearest 1.25mA (<= 318.75mA) or
* 2.5mA (<= 500mA).
*/
etc, etc.