GNSS-SDR  0.0.13
An Open Source GNSS Software Defined Receiver
bits.h
Go to the documentation of this file.
1 /*!
2  * \file bits.h
3  * \brief Utilities for bit manipulation of the libswiftnav library
4  * \author Fergus Noble <fergus@swift-nav.com>
5  *
6  * -----------------------------------------------------------------------------
7  * This file was originally borrowed from libswiftnav
8  * <https://github.com/swift-nav/libswiftnav>,
9  * a portable C library implementing GNSS related functions and algorithms,
10  * and then modified by J. Arribas and C. Fernandez
11  *
12  * Copyright (C) 2013, 2016 Swift Navigation Inc.
13  * Contact: Fergus Noble <fergus@swift-nav.com>
14  *
15  * GNSS-SDR is a software defined Global Navigation
16  * Satellite Systems receiver
17  *
18  * This file is part of GNSS-SDR.
19  *
20  * SPDX-License-Identifier: LGPL-3.0-only
21  *.
22  */
23 
24 #ifndef GNSS_SDR_BITS_H
25 #define GNSS_SDR_BITS_H
26 
27 #include "swift_common.h"
28 
29 uint8_t parity(uint32_t x);
30 uint32_t getbitu(const uint8_t *buff, uint32_t pos, uint8_t len);
31 int32_t getbits(const uint8_t *buff, uint32_t pos, uint8_t len);
32 void setbitu(uint8_t *buff, uint32_t pos, uint32_t len, uint32_t data);
33 void setbits(uint8_t *buff, uint32_t pos, uint32_t len, int32_t data);
34 void bitcopy(void *dst, uint32_t dst_index,
35  const void *src, uint32_t src_index, uint32_t count);
36 void bitshl(void *buf, uint32_t size, uint32_t shift);
37 uint8_t count_bits_u64(uint64_t v, uint8_t bv);
38 uint8_t count_bits_u32(uint32_t v, uint8_t bv);
39 uint8_t count_bits_u16(uint16_t v, uint8_t bv);
40 uint8_t count_bits_u8(uint8_t v, uint8_t bv);
41 
42 #endif /* GNSS_SDR_BITS_H_ */
Common definitions used throughout the libswiftnav library.