12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- #ifndef _CIRCULARBITBUFFER_H_
- #define _CIRCULARBITBUFFER_H_
-
- #include <avr/io.h>
- #include <stdbool.h>
- #include <LUFA/Common/Common.h>
-
- #if (defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB647__) || \
- defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__)) || defined(__DOXYGEN__)
-
- #define MAX_BITS 8192
- #else
- #define MAX_BITS 1024
- #endif
-
-
- typedef struct
- {
- uint8_t* CurrentByte;
- uint8_t ByteMask;
- } BitBufferPointer_t;
-
- typedef struct
- {
- uint8_t Data[MAX_BITS / 8];
- uint16_t Elements;
- BitBufferPointer_t In;
- BitBufferPointer_t Out;
- } BitBuffer_t;
-
-
- void BitBuffer_Init(BitBuffer_t* const Buffer) ATTR_NON_NULL_PTR_ARG(1);
-
- void BitBuffer_StoreNextBit(BitBuffer_t* const Buffer,
- const bool Bit) ATTR_NON_NULL_PTR_ARG(1);
-
- bool BitBuffer_GetNextBit(BitBuffer_t* const Buffer) ATTR_NON_NULL_PTR_ARG(1);
- #endif
|