Miscellaneous features.
More...
#include <cstdint>
#include <type_traits>
Go to the source code of this file.
|
| namespace | m5 |
| | Top level namespace of M5.
|
| |
|
|
bool | m5::utility::isValidI2CAddress (const uint16_t addr) |
| | Valid I2C address?
|
| |
|
uint8_t | m5::utility::reverseBitOrder (const uint8_t u8) |
| | Reversing the bit order.
|
| |
|
uint16_t | m5::utility::reverseBitOrder (const uint16_t u16) |
| | Reversing the bit order.
|
| |
| bool | m5::utility::parity (const uint8_t u8) |
| | Is the number of set bits odd?
|
| |
| uint8_t | m5::utility::oddParityBit (const uint8_t u8) |
| | Gets the bit that makes the byte odd parity.
|
| |
◆ oddParityBit()
| uint8_t m5::utility::oddParityBit |
( |
const uint8_t | u8 | ) |
|
|
inline |
Gets the bit that makes the byte odd parity.
- Parameters
-
- Returns
- 1 if the byte has an even number of set bits, 0 otherwise
- Note
- The bit to append in protocols that specify odd parity, such as NFC-A
◆ parity()
| bool m5::utility::parity |
( |
const uint8_t | u8 | ) |
|
|
inline |
Is the number of set bits odd?
- Parameters
-
- Returns
- True if the byte has an odd number of set bits