1#ifndef BIG_ENDIAN_BIT_MAN_H
2#define BIG_ENDIAN_BIT_MAN_H
3/*
4Copyright (c) 2015-2015 Cisco Systems, Inc.
5
6Licensed under the Apache License, Version 2.0 (the "License");
7you may not use this file except in compliance with the License.
8You may obtain a copy of the License at
9
10    http://www.apache.org/licenses/LICENSE-2.0
11
12Unless required by applicable law or agreed to in writing, software
13distributed under the License is distributed on an "AS IS" BASIS,
14WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15See the License for the specific language governing permissions and
16limitations under the License.
17*/
18
19#include "bitMan.h"
20
21inline void setMaskBit8(uint8_t & a,
22                        int           startbit,
23                        int           stopbit,
24                        uint8_t newVal )
25{
26    btSetMaskBitBigE8(a, startbit, stopbit, newVal);
27}
28
29
30inline void setMaskBit16(uint16_t & a,
31                         int           startbit,
32                         int           stopbit,
33                         uint16_t newVal )
34{
35    btSetMaskBitBigE16(a, startbit, stopbit, newVal);
36}
37
38
39inline void setMaskBit32(uint32_t   & a,
40                         int           startbit,
41                         int           stopbit,
42                         uint32_t newVal )
43{
44    btSetMaskBitBigE32(a, startbit, stopbit, newVal);
45}
46
47
48
49
50inline unsigned char getMaskBit8(uint8_t   a,
51                                 int             startbit,
52                                 int             stopbit) {
53     return btGetMaskBitBigE8(a,startbit,stopbit);
54}
55
56
57inline unsigned short getMaskBit16(uint16_t a,
58                                  int            startbit,
59                                  int            stopbit) {
60     return btGetMaskBitBigE16(a,startbit,stopbit);
61}
62
63
64inline unsigned long   getMaskBit32(uint32_t   a,
65                                 int             startbit,
66                                 int             stopbit) {
67     return btGetMaskBitBigE32(a,startbit,stopbit);
68}
69
70
71#endif // BIG_ENDIAN_BIT_MAN_H
72
73
74