VSF Documented
esp_bit_defs.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2026 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18/*
19 * Clean-room re-implementation of ESP-IDF public API "esp_bit_defs.h".
20 *
21 * Baseline: ESP-IDF v5.1 public API.
22 */
23
24#ifndef __VSF_ESPIDF_ESP_BIT_DEFS_H__
25#define __VSF_ESPIDF_ESP_BIT_DEFS_H__
26
27/* 32-bit bitmask constants */
28#define BIT31 0x80000000u
29#define BIT30 0x40000000u
30#define BIT29 0x20000000u
31#define BIT28 0x10000000u
32#define BIT27 0x08000000u
33#define BIT26 0x04000000u
34#define BIT25 0x02000000u
35#define BIT24 0x01000000u
36#define BIT23 0x00800000u
37#define BIT22 0x00400000u
38#define BIT21 0x00200000u
39#define BIT20 0x00100000u
40#define BIT19 0x00080000u
41#define BIT18 0x00040000u
42#define BIT17 0x00020000u
43#define BIT16 0x00010000u
44#define BIT15 0x00008000u
45#define BIT14 0x00004000u
46#define BIT13 0x00002000u
47#define BIT12 0x00001000u
48#define BIT11 0x00000800u
49#define BIT10 0x00000400u
50#define BIT9 0x00000200u
51#define BIT8 0x00000100u
52#define BIT7 0x00000080u
53#define BIT6 0x00000040u
54#define BIT5 0x00000020u
55#define BIT4 0x00000010u
56#define BIT3 0x00000008u
57#define BIT2 0x00000004u
58#define BIT1 0x00000002u
59#define BIT0 0x00000001u
60
61/* 64-bit bitmask constants */
62#define BIT63 (0x80000000ull << 32)
63#define BIT62 (0x40000000ull << 32)
64#define BIT61 (0x20000000ull << 32)
65#define BIT60 (0x10000000ull << 32)
66#define BIT59 (0x08000000ull << 32)
67#define BIT58 (0x04000000ull << 32)
68#define BIT57 (0x02000000ull << 32)
69#define BIT56 (0x01000000ull << 32)
70#define BIT55 (0x00800000ull << 32)
71#define BIT54 (0x00400000ull << 32)
72#define BIT53 (0x00200000ull << 32)
73#define BIT52 (0x00100000ull << 32)
74#define BIT51 (0x00080000ull << 32)
75#define BIT50 (0x00040000ull << 32)
76#define BIT49 (0x00020000ull << 32)
77#define BIT48 (0x00010000ull << 32)
78#define BIT47 (0x00008000ull << 32)
79#define BIT46 (0x00004000ull << 32)
80#define BIT45 (0x00002000ull << 32)
81#define BIT44 (0x00001000ull << 32)
82#define BIT43 (0x00000800ull << 32)
83#define BIT42 (0x00000400ull << 32)
84#define BIT41 (0x00000200ull << 32)
85#define BIT40 (0x00000100ull << 32)
86#define BIT39 (0x00000080ull << 32)
87#define BIT38 (0x00000040ull << 32)
88#define BIT37 (0x00000020ull << 32)
89#define BIT36 (0x00000010ull << 32)
90#define BIT35 (0x00000008ull << 32)
91#define BIT34 (0x00000004ull << 32)
92#define BIT33 (0x00000002ull << 32)
93#define BIT32 (0x00000001ull << 32)
94
95#ifndef BIT
96#define BIT(nr) (1ul << (nr))
97#endif
98#ifndef BIT64
99#define BIT64(nr) (1ull << (nr))
100#endif
101
102#endif // __VSF_ESPIDF_ESP_BIT_DEFS_H__
Generated from commit: vsfteam/vsf@699cdec