-
Notifications
You must be signed in to change notification settings - Fork 4
/
Utils.h
59 lines (54 loc) · 1.64 KB
/
Utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// SPDX-License-Identifier: GPL-2.0-only
/*
* Digital Voice Modem - Hotspot Firmware
* GPLv2 Open Source. Use is subject to license terms.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright (C) 2015,2016,2020 Jonathan Naylor, G4KLX
* Copyright (C) 2017 Andy Uribe, CA6JAU
*
*/
/**
* @file Utils.h
* @ingroup hotspot_fw
* @file Utils.cpp
* @ingroup hotspot_fw
*/
#if !defined(__UTILS_H__)
#define __UTILS_H__
#if defined(STM32F10X_MD)
#include "stm32f10x.h"
#elif defined(STM32F4XX)
#include "stm32f4xx.h"
#elif defined(STM32F7XX)
#include "stm32f7xx.h"
#endif
#include "Defines.h"
// ---------------------------------------------------------------------------
// Global Functions
// ---------------------------------------------------------------------------
/**
* @brief Returns the count of bits in the passed 8 byte value.
* @param bits uint8_t to count bits for.
* @returns uint8_t Count of bits in passed value.
*/
DSP_FW_API uint8_t countBits8(uint8_t bits);
/**
* @brief Returns the count of bits in the passed 16 byte value.
* @param bits uint16_t to count bits for.
* @returns uint8_t Count of bits in passed value.
*/
DSP_FW_API uint8_t countBits16(uint16_t bits);
/**
* @brief Returns the count of bits in the passed 32 byte value.
* @param bits uint32_t to count bits for.
* @returns uint8_t Count of bits in passed value.
*/
DSP_FW_API uint8_t countBits32(uint32_t bits);
/**
* @brief Returns the count of bits in the passed 64 byte value.
* @param bits ulong64_t to count bits for.
* @returns uint8_t Count of bits in passed value.
*/
DSP_FW_API uint8_t countBits64(ulong64_t bits);
#endif // __UTILS_H__