vdr  2.2.0
bitbuffer.h
Go to the documentation of this file.
1 /**********************************************************************
2  *
3  * HDFF firmware command interface library
4  *
5  * Copyright (C) 2011 Andreas Regel
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the
19  * Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  *********************************************************************/
23 
24 #ifndef BITBUFFER_H
25 #define BITBUFFER_H
26 
27 #include <stdint.h>
28 
29 typedef struct BitBuffer_t
30 {
31  uint8_t * Data;
32  uint32_t MaxLength;
33  uint32_t BitPos;
34 } BitBuffer_t;
35 
36 void BitBuffer_Init(BitBuffer_t * BitBuffer,
37  uint8_t * Data, uint32_t MaxLength);
38 
39 void BitBuffer_SetBits(BitBuffer_t * BitBuffer, int NumBits, uint32_t Data);
40 
41 uint32_t BitBuffer_GetByteLength(BitBuffer_t * BitBuffer);
42 
43 #endif /* BITBUFFER_H */
void BitBuffer_SetBits(BitBuffer_t *BitBuffer, int NumBits, uint32_t Data)
Definition: bitbuffer.c:37
struct BitBuffer_t BitBuffer_t
uint32_t BitPos
Definition: bitbuffer.h:33
uint32_t BitBuffer_GetByteLength(BitBuffer_t *BitBuffer)
Definition: bitbuffer.c:76
uint32_t MaxLength
Definition: bitbuffer.h:32
void BitBuffer_Init(BitBuffer_t *BitBuffer, uint8_t *Data, uint32_t MaxLength)
Definition: bitbuffer.c:28
uint8_t * Data
Definition: bitbuffer.h:31