Function to set bits in a byte buffer. This function allows the efficient use of an array to implement bitfields. The array used for storing the bits must always be a multiple of two bytes. Up to eight bits can be set or cleared in one operation.
ucBits[2] = {0, 0};
// Set bit 4 to 1 (read: set 1 bit starting at bit offset 4 to value 1)
xMBUtilSetBits( ucBits, 4, 1, 1 );
// Set bit 7 to 1 and bit 8 to 0.
xMBUtilSetBits( ucBits, 7, 2, 0x01 );
// Set bits 8 - 11 to 0x05 and bits 12 - 15 to 0x0A;
xMBUtilSetBits( ucBits, 8, 8, 0x5A);