mirror of
https://github.com/ttrftech/NanoVNA.git
synced 2025-12-06 03:31:59 +01:00
- replace binary constants with hex, the notation 0b01010101 is not supported by the C-language (neither in C11, nor in C99 nor in C89)
202 lines
9.9 KiB
C
202 lines
9.9 KiB
C
/*
|
|
* Copyright (c) 2019, qrp73 - https://github.com/qrp73
|
|
* All rights reserved.
|
|
*
|
|
* This is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 3, or (at your option)
|
|
* any later version.
|
|
*
|
|
* The software is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with GNU Radio; see the file COPYING. If not, write to
|
|
* the Free Software Foundation, Inc., 51 Franklin Street,
|
|
* Boston, MA 02110-1301, USA.
|
|
*
|
|
*
|
|
* The notation 0b01010101 is not supported by the C-language
|
|
* (neither in C11, nor in C99, nor in C89)
|
|
* This file allows to translate used binary constants for C11/C99/C89 C compilers
|
|
*
|
|
*/
|
|
|
|
#ifndef __BIN2HEX__
|
|
#define __BIN2HEX__
|
|
|
|
#define b00000000000000000000000000000000 0x00000000
|
|
#define b11111111111111111111111111111111 0xFFFFFFFF
|
|
#define b00000111111111000000100000000000 0x07FC0800
|
|
#define b00011111111111110000000000000000 0x1FFF0000
|
|
#define b00111111111111111000000000000000 0x3FFF8000
|
|
#define b01111111111111111100000000000000 0x7FFFC000
|
|
#define b01111110000011111100000000000000 0x7E0FC000
|
|
#define b11111100000001111110000000000000 0xFC07E000
|
|
#define b11111000000000111110000000000000 0xF803E000
|
|
#define b00000000011111000000100000000000 0x007C0800
|
|
#define b00000000111111000000000000000000 0x00FC0000
|
|
#define b00000001111111000000000000000000 0x01FC0000
|
|
#define b00000111111111000000000000000000 0x07FC0000
|
|
#define b00011111111111000000000000000000 0x1FFC0000
|
|
#define b00011111011111000000000000000000 0x1F7C0000
|
|
#define b00000000011111000000000000000000 0x007C0000
|
|
#define b00000011111110000000100000000000 0x03F80800
|
|
#define b00001111111111100000000000000000 0x0FFE0000
|
|
#define b11111000000001111110000000000000 0xF807E000
|
|
#define b00000000000011111110000000000000 0x000FE000
|
|
#define b00000000001111111100000000000000 0x003FC000
|
|
#define b00000000111111111000000000000000 0x00FF8000
|
|
#define b00000011111111100000000000000000 0x03FE0000
|
|
#define b00001111111110000000000000000000 0x0FF80000
|
|
#define b00011111111000000000000000000000 0x1FE00000
|
|
#define b00111111100000000000000000000000 0x3F800000
|
|
#define b01111111000000000000000000000000 0x7F000000
|
|
#define b11111110000000000000000000000000 0xFE000000
|
|
#define b11111100000000000000000000000000 0xFC000000
|
|
#define b11111111111111111110000000000000 0xFFFFE000
|
|
#define b00000000000011111100000000000000 0x000FC000
|
|
#define b00000000111111111100000000000000 0x00FFC000
|
|
#define b00000000111111110000000000000000 0x00FF0000
|
|
#define b11111110000001111110000000000000 0xFE07E000
|
|
#define b00001111111111110000000000000000 0x0FFF0000
|
|
#define b00000001111110000000100000000000 0x01F80800
|
|
#define b00000000000011110000100000000000 0x000F0800
|
|
#define b00000000000111110000000000000000 0x001F0000
|
|
#define b00000000001111110000000000000000 0x003F0000
|
|
#define b00000000011111110000000000000000 0x007F0000
|
|
#define b00000001111111110000000000000000 0x01FF0000
|
|
#define b00000011111111110000000000000000 0x03FF0000
|
|
#define b00000111111111110000000000000000 0x07FF0000
|
|
#define b00001111110111110000000000000000 0x0FDF0000
|
|
#define b00011111100111110000000000000000 0x1F9F0000
|
|
#define b00111111000111110000000000000000 0x3F1F0000
|
|
#define b01111110000111110000000000000000 0x7E1F0000
|
|
#define b11111100000111110000000000000000 0xFC1F0000
|
|
#define b11111000000111110000000000000000 0xF81F0000
|
|
#define b11111111111111111110100000000000 0xFFFFE800
|
|
#define b11110000000000000000000000000000 0xF0000000
|
|
#define b11110011111110000000000000000000 0xF3F80000
|
|
#define b11111111111111110000000000000000 0xFFFF0000
|
|
#define b11111111111111111000000000000000 0xFFFF8000
|
|
#define b11111111111111111100000000000000 0xFFFFC000
|
|
#define b11111110000011111100000000000000 0xFE0FC000
|
|
#define b00000000000001111110000000000000 0x0007E000
|
|
#define b00000000000000111110000000000000 0x0003E000
|
|
#define b11111110000111111110000000000000 0xFE1FE000
|
|
#define b00000011111111100000100000000000 0x03FE0800
|
|
#define b00011111111111111000000000000000 0x1FFF8000
|
|
#define b00111111111111111100000000000000 0x3FFFC000
|
|
#define b01111110000001111100000000000000 0x7E07C000
|
|
#define b11111000000000000000000000000000 0xF8000000
|
|
#define b11111011111110000000000000000000 0xFBF80000
|
|
#define b11111110000111111100000000000000 0xFE1FC000
|
|
#define b11111110000011111110000000000000 0xFE0FE000
|
|
#define b00000000000111111000000000000000 0x001F8000
|
|
#define b00000000011111100000000000000000 0x007E0000
|
|
#define b00000000111110000000000000000000 0x00F80000
|
|
#define b00000001111110000000000000000000 0x01F80000
|
|
#define b00000001111100000000000000000000 0x01F00000
|
|
#define b00000011111100000000000000000000 0x03F00000
|
|
#define b00000011111000000000000000000000 0x03E00000
|
|
#define b01111100000001111100000000000000 0x7C07C000
|
|
#define b11111100000000111110000000000000 0xFC03E000
|
|
#define b01111111111111111110000000000000 0x7FFFE000
|
|
#define b00111111111111111110000000000000 0x3FFFE000
|
|
#define b00001111111111111110000000000000 0x0FFFE000
|
|
#define b00000011111111111110000000000000 0x03FFE000
|
|
#define b11111100000011111100000000000000 0xFC0FC000
|
|
#define b01111111111111111000000000000000 0x7FFF8000
|
|
#define b00111111111111110000000000000000 0x3FFF0000
|
|
#define b00001111111111000000100000000000 0x0FFC0800
|
|
#define b00000000000000000000100000000000 0x00000800
|
|
#define b00000001110000000000000000000000 0x01C00000
|
|
#define b00000000000000011110000000000000 0x0001E000
|
|
#define b00110000011000111110000000000000 0x3063E000
|
|
#define b11111000111100111110000000000000 0xF8F3E000
|
|
#define b01111101111000111110000000000000 0x7DE3E000
|
|
#define b00011111110000111110000000000000 0x1FC3E000
|
|
#define b00001111100000111110000000000000 0x0F83E000
|
|
#define b00111101111000111110000000000000 0x3DE3E000
|
|
#define b01111000111100111110000000000000 0x78F3E000
|
|
#define b00110000011000111110100000000000 0x3063E800
|
|
#define b01111100000000000000100000000000 0x7C000800
|
|
#define b01111100000000000000000000000000 0x7C000000
|
|
#define b01111100000111111000000000000000 0x7C1F8000
|
|
#define b01111100001111110000000000000000 0x7C3F0000
|
|
#define b01111100011111100000000000000000 0x7C7E0000
|
|
#define b01111100111111000000000000000000 0x7CFC0000
|
|
#define b01111101111110000000000000000000 0x7DF80000
|
|
#define b01111111111100000000000000000000 0x7FF00000
|
|
#define b01111111111000000000000000000000 0x7FE00000
|
|
#define b01111111110000000000000000000000 0x7FC00000
|
|
#define b01111100000111111000100000000000 0x7C1F8800
|
|
#define b11111000000000111110100000000000 0xF803E800
|
|
#define b11111111000111111110000000000000 0xFF1FE000
|
|
#define b11111111101111111110000000000000 0xFFBFE000
|
|
#define b11111011111110111110000000000000 0xFBFBE000
|
|
#define b11111001111100111110000000000000 0xF9F3E000
|
|
#define b11111000111000111110000000000000 0xF8E3E000
|
|
#define b11111000000111111110000000000000 0xF81FE000
|
|
#define b01111110000011111110000000000000 0x7E0FE000
|
|
#define b00011111111111111110000000000000 0x1FFFE000
|
|
#define b00000111111110111110100000000000 0x07FBE800
|
|
#define b00000000001000000000000000000000 0x00200000
|
|
#define b00000000011000000000000000000000 0x00600000
|
|
#define b00000000111000000000000000000000 0x00E00000
|
|
#define b00000001111000000000000000000000 0x01E00000
|
|
#define b00000111111111111110000000000000 0x07FFE000
|
|
#define b00000000001000000000100000000000 0x00200800
|
|
#define b00000111100011110000000000000000 0x078F0000
|
|
#define b00001111110111111000000000000000 0x0FDF8000
|
|
#define b00011111110111111100000000000000 0x1FDFC000
|
|
#define b00111000111100011100000000000000 0x38F1C000
|
|
#define b01111000111000011110000000000000 0x78E1E000
|
|
#define b01110000011000001110000000000000 0x7060E000
|
|
#define b01111000011100011110000000000000 0x7871E000
|
|
#define b00111111101111111100000000000000 0x3FBFC000
|
|
#define b00011111101111111000000000000000 0x1FBF8000
|
|
#define b00001111000111100000000000000000 0x0F1E0000
|
|
#define b00000011101111110000000000000000 0x03BF0000
|
|
#define b00000011101111111000000000000000 0x03BF8000
|
|
#define b00000011101111111100000000000000 0x03BFC000
|
|
#define b00000011101110011110000000000000 0x03B9E000
|
|
#define b00000011101110001110000000000000 0x03B8E000
|
|
#define b00111111101110011110000000000000 0x3FB9E000
|
|
#define b01111111101111111110000000000000 0x7FBFE000
|
|
#define b11111111101111111000000000000000 0xFFBF8000
|
|
#define b11110011101111111100000000000000 0xF3BFC000
|
|
#define b11100011101110011110000000000000 0xE3B9E000
|
|
#define b11100011101110001110000000000000 0xE3B8E000
|
|
#define b11110011101110011110000000000000 0xF3B9E000
|
|
#define b01111111101111111100000000000000 0x7FBFC000
|
|
#define b00111101101111110000100000000000 0x3DBF0800
|
|
#define b00000000000000111000000000000000 0x00038000
|
|
#define b00000000000001111000000000000000 0x00078000
|
|
#define b00000000000011011000000000000000 0x000D8000
|
|
#define b00000000000110011000000000000000 0x00198000
|
|
#define b00000000001100011000000000000000 0x00318000
|
|
#define b00011111111000011000000000000000 0x1FE18000
|
|
#define b00011111110000011000000000000000 0x1FC18000
|
|
#define b00011000110000011000000000000000 0x18C18000
|
|
#define b00110000011000001100000000000000 0x3060C000
|
|
#define b00011000011000011000000000000000 0x18618000
|
|
#define b00001100011000110000000000000000 0x0C630000
|
|
#define b00000110011001100000000000000000 0x06660000
|
|
#define b00000011011011000000000000000000 0x036C0000
|
|
#define b00000000111100000000000000000000 0x00F00000
|
|
#define b00000000011000000000100000000000 0x00600800
|
|
#define b00111101111011110000000000000000 0x3DEF0000
|
|
#define b01111001111111000000000000000000 0x79FC0000
|
|
#define b01111111111111110000000000000000 0x7FFF0000
|
|
#define b01111000000000111100000000000000 0x7803C000
|
|
#define b01111000000000111100100000000000 0x7803C800
|
|
#define b00111101111111000000000000000000 0x3DFC0000
|
|
#define b00111111000001111100000000000000 0x3F07C000
|
|
#define b00111110000000111100000000000000 0x3E03C000
|
|
#define b00111100000000000000000000000000 0x3C000000
|
|
#define b00111100000000000000100000000000 0x3C000800
|
|
|
|
#endif //__BIN2HEX__
|