- * data - a byte array with size at least startPos + numBits.
- * value - the value to set in the bit field.
- * startPos - the starting index of the bit field (beginning from 0).
+ * For example:
+ *
+ * uint8_t source[4] = {0x11, 0x22, 0x33, 0x44};
+ * uint8_t destination[4] = {0};
+ * copy_bits_right_aligned(source, sizeof(source), 8, 8, destination,
+ * sizeof(destination));
+ * // destination[0] == 0x0
+ * // destination[1] == 0x0
+ * // destination[2] == 0x0
+ * // destination[3] == 0x22
+ *
+ * int value = (int)destination;
+ * // value == 0x22 == 32
+ *
+ * The arguments are the same as copy_bits, but without the destination_offset
+ * option - that's set automatically to right align the result.
+ *
+ * Returns true if the copy was successful and false if the range exceeded the
+ * size of the source or destination, or if the range size negative or 0.