This is the multi-page printable view of this section. Click here to print...

Return to the regular view of this page

As of 2025-07-24

pack_bits()

Set bits to 1 at specified positions
    Sets bits to 1 at the specified positions.
    constexpr uint32_t pack_bits(...)

    Parameters are specified as variadic arguments, each indicating a bit position (integer from 0 to 31). For example, pack_bits(1,3,6) returns ((1UL<<1)|(1UL<<3)|(1UL<<6)).

    Background

    This function simplifies the notation in situations where values are referenced or set in various bitmaps such as IO port (DI, DO) states.