MIP_SDK
v3.0.0-187-g93c7302
MicroStrain Communications Library for embedded systems
|
#include <type_traits>
#include <limits>
#include <stdint.h>
#include <assert.h>
Go to the source code of this file.
Namespaces | |
microstrain | |
microstrain::detail | |
Functions | |
template<typename T > | |
constexpr T | microstrain::bitmaskFirstN (unsigned int nbits) |
Creates a bitmask with 1s in the first N bits, i.e. bits [0..N). More... | |
template<typename T > | |
constexpr T | microstrain::bitmaskN (unsigned int bitI, unsigned int nbits) |
Creates a bitmask with N '1' bits starting at bit I. More... | |
template<typename T > | |
constexpr T | microstrain::bitmaskItoJ (unsigned int bitI, unsigned int bitJ) |
Creates a bitmask with bits [bitI..bitJ) set to 1 (excludes bit J). More... | |
template<typename T > | |
constexpr T | microstrain::bitmaskIthruJ (unsigned int bitI, unsigned int bitJ) |
Creates a bitmask with bits [bitI..bitJ] set to 1 (includes bit J). More... | |
template<typename RegType > | |
constexpr bool | microstrain::testBit (RegType reg, unsigned int bit) |
Checks if a specific bit in a value is set. More... | |
template<typename RegType > | |
constexpr void | microstrain::setBit (RegType ®, unsigned int bit, bool value=true) |
Sets a specific bit in a variable to a specified value. More... | |
template<typename RegType > | |
constexpr RegType | microstrain::getBitsN (RegType reg, unsigned int bitI, unsigned int nbits) |
Extracts a bitfield from a variable value. More... | |
template<typename RegType > | |
constexpr RegType | microstrain::getBitsItoJ (RegType reg, unsigned int bitI, unsigned int bitJ) |
Extracts a bitfield from a variable value. More... | |
template<typename RegType > | |
constexpr RegType | microstrain::getBitsIthruJ (RegType reg, unsigned int bitI, unsigned int bitJ) |
Extracts a bitfield from a variable value. More... | |
template<typename RegType > | |
constexpr void | microstrain::setBitsN (RegType ®, unsigned int bitI, unsigned int nbits) |
Sets a series of consecutive bits in a variable to 1. More... | |
template<typename RegType > | |
constexpr void | microstrain::setBitsItoJ (RegType ®, unsigned int bitI, unsigned int bitJ) |
Sets a series of consecutive bits in a variable to 1. More... | |
template<typename RegType > | |
constexpr void | microstrain::setBitsIthruJ (RegType ®, unsigned int bitI, unsigned int bitJ) |
Sets a series of consecutive bits in a variable to 1. More... | |
template<typename RegType > | |
constexpr void | microstrain::clearBitsN (RegType ®, unsigned int bitI, unsigned int nbits) |
Sets a series of consecutive bits in a variable to 0. More... | |
template<typename RegType > | |
constexpr void | microstrain::clearBitsItoJ (RegType ®, unsigned int bitI, unsigned int bitJ) |
Sets a series of consecutive bits in a variable to 0. More... | |
template<typename RegType > | |
constexpr void | microstrain::clearBitsIthruJ (RegType ®, unsigned int bitI, unsigned int bitJ) |
Sets a series of consecutive bits in a variable to 0. More... | |
template<typename RegType , typename ValType > | |
constexpr void | microstrain::setBitsN (RegType ®, unsigned int bitI, unsigned int nbits, ValType value) |
Writes a value to a specific set of bits in a variable as if it were a bitfield. More... | |
template<typename RegType , typename ValType > | |
constexpr void | microstrain::setBitsItoJ (RegType ®, unsigned int bitI, unsigned int bitJ, ValType value) |
Writes a value to a specific set of bits in a variable as if it were a bitfield. More... | |
template<typename RegType , typename ValType > | |
constexpr void | microstrain::modifyBitsIthruJ (RegType ®, unsigned int bitI, unsigned int bitJ, ValType value) |
Writes a value to a specific set of bits in a variable as if it were a bitfield. More... | |