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
|
/*
Copyright (C) 2011-2020, Dirk Krause
SPDX-License-Identifier: BSD-3-Clause
*/
/*
WARNING: This file was generated by the dkct program (see
http://dktools.sourceforge.net/ for details).
Changes you make here will be lost if dkct is run again!
You should modify the original source and run dkct on it.
Original source: dk3bits.ctr
*/
/** @file dk3bits.c The dk3bits module.
*/
#line 29 "dk3bits.ctr"
#include "dk3conf.h"
#include "dk3types.h"
#include "dk3bits.h"
/** Masks to set and retrieve single bits.
*/
static unsigned short const dk3bits_values[] = {
0x0001U,
0x0002U,
0x0004U,
0x0008U,
0x0010U,
0x0020U,
0x0040U,
0x0080U,
0x0100U,
0x0200U,
0x0400U,
0x0800U,
0x1000U,
0x2000U,
0x4000U,
0x8000U
};
unsigned short
dk3bits_get(size_t i)
{
unsigned short back = 0U;
if(i < 16) {
back = dk3bits_values[i];
}
return back;
}
|