1
0
forked from fsfw/fsfw

set deser test complete

new bitutility file
This commit is contained in:
2021-02-28 16:34:11 +01:00
parent 714f11f117
commit 940bbf47e4
6 changed files with 81 additions and 40 deletions

View File

@ -0,0 +1,18 @@
#ifndef FSFW_GLOBALFUNCTIONS_BITUTIL_H_
#define FSFW_GLOBALFUNCTIONS_BITUTIL_H_
#include <cstdint>
namespace bitutil {
/* Helper functions for manipulating the individual bits of a byte.
Position refers to n-th bit of a byte, going from 0 (most significant bit) to
7 (least significant bit) */
void bitSet(uint8_t* byte, uint8_t position);
void bitToggle(uint8_t* byte, uint8_t position);
void bitClear(uint8_t* byte, uint8_t position);
bool bitGet(const uint8_t* byte, uint8_t position);
}
#endif /* FSFW_GLOBALFUNCTIONS_BITUTIL_H_ */