Lines Matching +full:data +full:- +full:bits

5  * SPDX-License-Identifier: Apache-2.0
24 * @brief Population count: Count the number of bits set to 1
29 * @param octets Data to count over
38 while (octets_len--) { in util_ones_count_get()
43 bite &= (bite - 1); in util_ones_count_get()
54 * - It shall have no more than six consecutive zeros or ones.
55 * - It shall not be the advertising channel packets' Access Address.
56 * - It shall not be a sequence that differs from the advertising channel
58 * - It shall not have all four octets equal.
59 * - It shall have no more than 24 transitions.
60 * - It shall have a minimum of two transitions in the most significant six
61 * bits.
64 * - It shall have at least three ones in the least significant 8 bits.
65 * - It shall have no more than eleven transitions in the least significant 16
66 * bits.
85 return -EFAULT; in util_aa_le32()
87 retry--; in util_aa_le32()
100 while (bit_idx--) { in util_aa_le32()
131 * significant six bits. in util_aa_le32()
150 ones_count_lsb8--; in util_aa_le32()
186 * significant 16 bits. in util_aa_le32()
194 aa &= ~(BIT(bit_idx + 1) - 1); in util_aa_le32()
196 aa |= (BIT(bit_idx + 1) - 1); in util_aa_le32()
231 uint8_t bits; in util_saa_le32() local
262 /* For any pair of BIGs transmitted by the same device, the SAA 15-0 in util_saa_le32()
263 * values shall differ in at least two bits. in util_saa_le32()
264 * - Find the number of bits required to support 3 times the maximum in util_saa_le32()
266 * - Clear those number many bits in util_saa_le32()
267 * - Set the value that is 3 times the handle so that consecutive values in util_saa_le32()
268 * differ in at least two bits. in util_saa_le32()
270 bits = find_msb_set(CONFIG_BT_CTLR_ADV_ISO_SET * 0x03); in util_saa_le32()
271 saa &= ~BIT_MASK(bits); in util_saa_le32()
289 /* 8-bits for d is enough due to wrapping math and requirement to do in util_bis_aa_le32()
294 /* Most significant 6 bits of DW are bit extension of least significant in util_bis_aa_le32()
303 /* Set the bits 25 to 17 of DW */ in util_bis_aa_le32()
307 /* Most significant 16-bits of SAA XOR DW, least significant 16-bit are in util_bis_aa_le32()
320 * @param data Pointer to bytes containing the requested value
321 * @param bit_offs Bit offset into data[0] for value LSB
322 * @param num_bits Number of bits to extract and convert to value
324 uint32_t util_get_bits(uint8_t *data, uint8_t bit_offs, uint8_t num_bits) in util_get_bits() argument
327 uint8_t shift, byteIdx, bits; in util_get_bits() local
334 bits = MIN(num_bits, 8 - bit_offs); in util_get_bits()
335 value |= ((data[byteIdx] >> bit_offs) & BIT_MASK(bits)) << shift; in util_get_bits()
336 shift += bits; in util_get_bits()
337 num_bits -= bits; in util_get_bits()
346 * Converts a value up to 32 bits to a bitset in a byte array.
348 * @param data Pointer to bytes in which to place the value
349 * @param bit_offs Bit offset into data[0] for value LSB
350 * @param num_bits Number of bits to set in data
352 void util_set_bits(uint8_t *data, uint8_t bit_offs, uint8_t num_bits, in util_set_bits() argument
355 uint8_t byteIdx, bits; in util_set_bits() local
360 bits = MIN(num_bits, 8 - bit_offs); in util_set_bits()
361 data[byteIdx] = (data[byteIdx] & ~(BIT_MASK(bits) << bit_offs)) | in util_set_bits()
362 ((value & BIT_MASK(bits)) << bit_offs); in util_set_bits()
363 value >>= bits; in util_set_bits()
364 num_bits -= bits; in util_set_bits()