|
MIP_SDK
v4.0.0-237-g9879cb72
MicroStrain Communications Library for embedded systems
|
Namespaces | |
| C | |
| connections | |
| detail | |
| extras | |
| serialization | |
| strings | |
Classes | |
| struct | ArrayView |
| Represents a view over a contiguous array of objects, similar to std::span, and is implemented as a pointer and length. More... | |
| struct | ArrayView< T, DYNAMIC_EXTENT > |
| struct | BitfieldMemberIthruJ |
| A class which represents part of a bitfield (see BitfieldMemberN) More... | |
| struct | BitfieldMemberItoJ |
| A class which represents part of a bitfield (see BitfieldMemberN) More... | |
| struct | BitfieldMemberN |
| A class which represents part of a bitfield. More... | |
| class | Connection |
| Represents a type of connection. More... | |
| class | Id |
| Representes an ID number ranging from 1..N including N. More... | |
| class | Index |
| Represents an index ranging from 0..N excluding N. More... | |
| struct | IntegerWithBits |
| Helper type to get an integer of at least N bits in size. More... | |
| struct | IntegerWithBytes |
| Helper type to get an integer of at least N bytes in size. More... | |
| struct | IntegerWithBytes< 1 > |
| struct | IntegerWithBytes< 2 > |
| struct | IntegerWithBytes< 3 > |
| struct | IntegerWithBytes< 4 > |
| struct | IntegerWithBytes< 5 > |
| struct | IntegerWithBytes< 6 > |
| struct | IntegerWithBytes< 7 > |
| struct | IntegerWithBytes< 8 > |
| class | SaturatingInt |
| A class representing an integer that saturates instead of overflowing. More... | |
| class | Serializer |
| Serializes or deserializes data to/from a byte buffer. More... | |
| class | SerializerBase |
| Represents a view of a buffer of bytes of known capacity. More... | |
Typedefs | |
| template<class T > | |
| using | ConstArrayView = ArrayView< const T > |
| using | U8ArrayView = ArrayView< uint8_t > |
| using | ConstU8ArrayView = ConstArrayView< uint8_t > |
| using | CharArrayView = ArrayView< char > |
| using | ConstCharArrayView = ConstArrayView< char > |
| using | EmbeddedTimestamp = C::microstrain_embedded_timestamp |
| using | EmbeddedTimeout = C::microstrain_embedded_timeout |
| using | BigEndianSerializer = Serializer< serialization::Endian::big > |
| using | LittleEndianSerializer = Serializer< serialization::Endian::little > |
Functions | |
| template<typename T > | |
| constexpr T | 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 | bitmaskN (unsigned int bitI, unsigned int nbits) |
| Creates a bitmask with N '1' bits starting at bit I. More... | |
| template<typename T > | |
| constexpr T | 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 | 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 | testBit (RegType reg, unsigned int bit) |
| Checks if a specific bit in a value is set. More... | |
| template<typename RegType > | |
| constexpr void | 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 | getBitsN (RegType reg, unsigned int bitI, unsigned int nbits) |
| Extracts a bitfield from a variable value. More... | |
| template<typename RegType > | |
| constexpr RegType | getBitsItoJ (RegType reg, unsigned int bitI, unsigned int bitJ) |
| Extracts a bitfield from a variable value. More... | |
| template<typename RegType > | |
| constexpr RegType | getBitsIthruJ (RegType reg, unsigned int bitI, unsigned int bitJ) |
| Extracts a bitfield from a variable value. More... | |
| template<typename RegType > | |
| constexpr void | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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... | |
| template<class T > | |
| constexpr T | add_sat (T x, T y) noexcept |
| template<class T > | |
| constexpr T | sub_sat (T x, T y) noexcept |
| template<class T , class U > | |
| constexpr T | saturate_cast (U x) noexcept |
| Convert an integral value to a different integral type while preventing overflow. More... | |
| template<class T , class U > | |
| constexpr void | assign_sat (T &destination, U value) |
| Assign an integral value to a destination variable, clamping its value to the range of the destination type. More... | |
| template<class T , class U > | |
| constexpr T & | accum_sat (T &counter, U amount) |
| Add a value to an accumulator and prevent it from overflowing. More... | |
| template<class T , class U > | |
| constexpr T & | reduce_sat (T &counter, U amount) |
| Subtract a value from an accumulator and prevent it from overflowing. More... | |
| constexpr bool | operator== (Id l, Index r) |
| constexpr bool | operator== (Index l, Id r) |
| template<class Container > | |
| auto * | indexOrNull (Container &container, Index index) |
| template<class Container , typename Value > | |
| auto | indexOrDefault (Container &container, Index index, Value default_) |
| template<serialization::Endian E, class T > | |
| std::enable_if< std::is_arithmetic< T >::value, size_t >::type | insert (Serializer< E > &buffer, T value) |
| Inserts a numeric value to a Serializer. More... | |
| template<serialization::Endian E, class T > | |
| std::enable_if< std::is_arithmetic< T >::value, size_t >::type | extract (Serializer< E > &buffer, T &value) |
| Reads a numeric value from a Serializer. More... | |
| template<serialization::Endian E, class T > | |
| std::enable_if< std::is_enum< T >::value, size_t >::type | insert (Serializer< E > &buffer, T value) |
Writes an enum to a Serializer. For this to work properly, the enum must have its underlying type specified, i.e., like enum Foo : uint32_t { /*...*/ }; More... | |
| template<serialization::Endian E, class T > | |
| std::enable_if< std::is_enum< T >::value, size_t >::type | extract (Serializer< E > &buffer, T &value) |
Reads an enum from a Serializer. For this to work properly, the enum must have its underlying type specified, i.e., like enum Foo : uint32_t { /*...*/ }; More... | |
| template<serialization::Endian E, class T , decltype &::insert = nullptr> | |
| std::enable_if< std::is_class< T >::value, size_t >::type | insert (microstrain::Serializer< E > &serializer, const T &object) |
Writes a class object to a Serializer. This overload is available to any class which defines a method insert. It shall take a Serializer reference as the sole parameter. More... | |
| template<serialization::Endian E, class T , decltype &::extract = nullptr> | |
| std::enable_if< std::is_class< T >::value, size_t >::type | extract (microstrain::Serializer< E > &serializer, T &object) |
Reads a class object from a Serializer. This overload is available to any class which defines a method extract. It shall take a Serializer reference as the sole parameter. More... | |
| template<serialization::Endian E, class T > | |
| size_t | insert (Serializer< E > &serializer, const T *values, size_t count) |
| Writes an array to a Serializer. More... | |
| template<serialization::Endian E, class T > | |
| size_t | extract (Serializer< E > &serializer, T *values, size_t count) |
| Reads an array from a Serializer. More... | |
| template<serialization::Endian E, class T > | |
| size_t | insert (Serializer< E > &serializer, microstrain::ArrayView< const T > values) |
| Writes an array to a Serializer via a Span. More... | |
| template<serialization::Endian E, class T > | |
| size_t | extract (Serializer< E > &serializer, microstrain::ConstArrayView< T > values) |
| Reads an array from a Serializer via an ArrayView. More... | |
| template<serialization::Endian E, class T , size_t N> | |
| size_t | insert (Serializer< E > &serializer, const T(&values)[N]) |
| Writes a fixed-size array to a Serializer. More... | |
| template<serialization::Endian E, class T , size_t N> | |
| size_t | extract (Serializer< E > &serializer, T(&values)[N]) |
| Reads a fixed-size array from a Serializer. More... | |
| template<serialization::Endian E, class T , size_t N> | |
| size_t | insert (Serializer< E > &serializer, const std::array< T, N > &values) |
| Writes a std::array to a Serializer. More... | |
| template<serialization::Endian E, class T , size_t N> | |
| size_t | extract (Serializer< E > &serializer, const std::array< T, N > &values) |
| Reads a std::array from a Serializer. More... | |
| template<serialization::Endian E, typename T0 , typename T1 , typename... Ts> | |
| size_t | insert (Serializer< E > &serializer, const T0 &value0, const T1 &value1, Ts... values) |
| Writes multiple values to a Serializer. More... | |
| template<serialization::Endian E, typename T0 , typename T1 , typename... Ts> | |
| size_t | extract (Serializer< E > &serializer, T0 &value0, T1 &value1, Ts &... values) |
| Reads multiple values from a Serializer. More... | |
| template<serialization::Endian E, class T > | |
| bool | insert (const T &value, uint8_t *buffer, size_t buffer_length, size_t offset=0, bool exact_size=false) |
| Serializes a value to a raw byte buffer. More... | |
| template<serialization::Endian E, class T > | |
| bool | extract (T &value, const uint8_t *buffer, size_t buffer_length, size_t offset=0, bool exact_size=false) |
| Deserializes a value from a raw byte buffer. More... | |
| template<serialization::Endian E, class T > | |
| bool | insert (T value, microstrain::ArrayView< uint8_t > buffer, size_t offset=0, bool exact_size=false) |
| Serializes a value to a raw byte buffer (ArrayView version). More... | |
| template<serialization::Endian E, class T > | |
| bool | extract (T &value, microstrain::ConstU8ArrayView buffer, size_t offset=0, bool exact_size=false) |
| Deserializes a value from a raw byte buffer (ArrayView version). More... | |
Variables | |
| static constexpr size_t | DYNAMIC_EXTENT = SIZE_MAX |
| using microstrain::ConstArrayView = typedef ArrayView<const T> |
| using microstrain::U8ArrayView = typedef ArrayView<uint8_t> |
| using microstrain::ConstU8ArrayView = typedef ConstArrayView<uint8_t> |
| using microstrain::CharArrayView = typedef ArrayView<char> |
| using microstrain::ConstCharArrayView = typedef ConstArrayView<char> |
| using microstrain::EmbeddedTimestamp = typedef C::microstrain_embedded_timestamp |
| using microstrain::EmbeddedTimeout = typedef C::microstrain_embedded_timeout |
|
constexpr |
| T | An unsigned integral type. |
| nbits | The number of 1 bits starting at location 0. Must not exceed the number of bits in T (e.g. nbits <= 32 for T=uint32_t). |
|
constexpr |
If bitI == bitJ, then the result will have exactly one bit set.
| T | An unsigned integral type. |
| bitI | The 0-based index of the first 1 bit. Must be LESS than the number of bits in T (and not equal). |
| bitJ | The 0-based index of the the last 1 bit. Must be greater than or equal to bitI and cannot exceed the number of bits in T. |
|
constexpr |
| T | An unsigned integral type. |
| bitI | The 0-based index of the first 1 bit. Must not exceed the number of bits in T. |
| bitJ | The 0-based index of the first 0 bit after the last 1 bit. Must be greater than or equal to bitI and cannot exceed the number of bits in T. |
|
constexpr |
If bitI == bitJ, then the result will have exactly one bit set.
| T | An unsigned integral type. |
| bitI | The 0-based index of the first 1 bit. Must not exceed the number of bits in T. |
| bitJ | The 0-based index of the the last 1 bit. Must be greater than or equal to bitI and cannot exceed the number of bits in T. |
|
constexpr |
| RegType | An integral type. Let the compiler deduce this in most cases. |
| reg | Value containing the bit to check. |
| bit | The 0-based index of the bit to check in val. Must be less than the number of bits in RegType. |
|
constexpr |
| RegType | An integral type. Let the compiler deduce this. |
| reg | Value to be modified. |
| bit | The 0-based index of the bit to modify. Must be less than the number of bits in RegType. |
| value | Sets the bit to this value. Default true. |
|
constexpr |
| RegType | An unsigned integral type. Let the compiler deduce this. |
| reg | Register value. |
| bitI | The 0-based index of the first bit to extract. Must be less than the number of bits in RegType. |
| nbits | How many consecutive bits to extract. |
|
constexpr |
| RegType | An unsigned integral type. Let the compiler deduce this. |
| reg | Register value. |
| bitI | The 0-based index of the first bit to extract. Must be less than the number of bits in RegType. |
| bitJ | The 0-based index of the bit after last bit to extract. Must be greater than or equal to bitI and cannot exceed the number of bits in RegType. |
|
constexpr |
| RegType | An unsigned integral type. Let the compiler deduce this. |
| reg | Register value. |
| bitI | The 0-based index of the first bit to extract. Must be less than the number of bits in RegType. |
| bitJ | The 0-based index of the last bit to extract. Must be greater than or equal to bitI and less than the number of bits in RegType. |
|
constexpr |
| RegType | An unsigned integral type. Let the compiler deduce this. |
| reg | Value to be modified. |
| bitI | The 0-based index of the first affected bit. |
| nbits | Number of consecutive bits to set to '1'. |
|
constexpr |
| RegType | An unsigned integral type. Let the compiler deduce this. |
| reg | Value to be modified. |
| bitI | The 0-based index of the first affected bit. |
| bitJ | The 0-based index of the bit after the last affected bit. |
|
constexpr |
| RegType | An unsigned integral type. Let the compiler deduce this. |
| reg | Value to be modified. |
| bitI | The 0-based index of the first affected bit. |
| bitJ | The 0-based index of the last affected bit. |
|
constexpr |
| RegType | An unsigned integral type. Let the compiler deduce this. |
| reg | Value to be modified. |
| bitI | The 0-based index of the first affected bit. |
| nbits | Number of consecutive bits to set to '0'. |
|
constexpr |
| RegType | An unsigned integral type. Let the compiler deduce this. |
| reg | Value to be modified. |
| bitI | The 0-based index of the first affected bit. |
| bitJ | The 0-based index of the bit after the last affected bit. |
|
constexpr |
| RegType | An unsigned integral type. Let the compiler deduce this. |
| reg | Value to be modified. |
| bitI | The 0-based index of the first affected bit. |
| bitJ | The 0-based index of the last affected bit. |
|
constexpr |
| RegType | An unsigned integral type. Let the compiler deduce this. |
| ValType | An integral type used for the input value. Let the compiler deduce this. |
| reg | Value to be modified. |
| bitI | The 0-based index of the first bit of value in reg. |
| nbits | Number of consecutive bits used to represent the value in reg. |
| value | Value to insert into reg at bit I. |
|
constexpr |
| RegType | An unsigned integral type. Let the compiler deduce this. |
| ValType | An integral type used for the input value. Let the compiler deduce this. |
| reg | Value to be modified. |
| bitI | The 0-based index of the first bit of value in reg. |
| bitJ | The 0-based index of the bit after the last affected bit. |
| value | Value to insert into reg at bit I. |
|
constexpr |
| RegType | An unsigned integral type. Let the compiler deduce this. |
| ValType | An integral type used for the input value. Let the compiler deduce this. |
| reg | Value to be modified. |
| bitI | The 0-based index of the first bit of value in reg. |
| bitJ | The 0-based index of the last bit of value in reg. |
| value | Value to insert into reg at bit I. |
|
constexprnoexcept |
|
constexprnoexcept |
|
constexprnoexcept |
See https://en.cppreference.com/w/cpp/numeric/saturate_cast
| T | Result type. |
| U | Source type. Let the compiler deduce this. |
| x | Value to cast. |
|
constexpr |
| T | Destination type. Let the compiler deduce this. |
| U | Source type. Let the compiler deduce this. |
| [out] | destination | Variable in which to store the value. |
| [in] | value | Value to store in destination. |
|
constexpr |
| T | Type of the accumulator. Let the compiler deduce this. |
| U | Type of the value being added. Let the compiler deduce this. |
| [out] | counter | Accumulator variable to modify. |
| [in] | value | Value to add to counter. |
|
constexpr |
| T | Type of the accumulator. Let the compiler deduce this. |
| U | Type of the value being subtracted. Let the compiler deduce this. |
| [out] | counter | Accumulator variable to modify. |
| [in] | value | Value to subtract from counter. |
| auto* microstrain::indexOrNull | ( | Container & | container, |
| Index | index | ||
| ) |
| auto microstrain::indexOrDefault | ( | Container & | container, |
| Index | index, | ||
| Value | default_ | ||
| ) |
| std::enable_if<std::is_enum<T>::value, size_t>::type microstrain::insert | ( | Serializer< E > & | buffer, |
| T | value | ||
| ) |
| E | Endianness of buffer. Automatically deduced from the serializer parameter. |
| T | Type of the enum. Automatically deduced from the underlying type of the enum. |
| buffer | Serializer object pointing to the destination buffer. |
| value | The enum value to write to the buffer. |
| std::enable_if<std::is_enum<T>::value, size_t>::type microstrain::extract | ( | Serializer< E > & | buffer, |
| T & | value | ||
| ) |
| E | Endianness of buffer. Automatically deduced from the serializer parameter. |
| T | Type of the enum. Automatically deduced from the underlying type of the enum. |
| buffer | Serializer object pointing to the source buffer. | |
| [out] | value | The value will be stored in this variable. |
|
staticconstexpr |
1.8.17