comparison libutil/bitfunc.c @ 0:35c0d9f03c0a

beginning with sipout-test-voice, a copy of sip-manual-out from themwi-system-sw
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 03 Mar 2024 23:20:19 -0800
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:35c0d9f03c0a
1 /*
2 * Some bit manipulation functions.
3 */
4
5 #include <stdint.h>
6 #include "osmo_bits.h"
7
8 void uint16_to_bits(uint16_t word, ubit_t *out, unsigned nbits)
9 {
10 unsigned n;
11
12 for (n = 0; n < nbits; n++)
13 out[n] = (word >> (nbits-n-1)) & 1;
14 }