ReduxLib C++ 2025.0.0-beta2
|
Functions | |
constexpr uint8_t | getDeviceType (uint32_t fullId) |
constexpr uint8_t | getApiPage (uint32_t fullId) |
constexpr uint8_t | getApiIndex (uint32_t fullId) |
constexpr uint8_t | getDeviceId (uint32_t fullId) |
constexpr bool | idMatches (uint32_t idToCompare, uint8_t deviceType, uint8_t devId) |
constexpr uint32_t | constructMessageId (uint8_t deviceType, uint16_t devId, uint8_t msgId) |
constexpr std::chrono::duration< double, std::ratio< 1LL, 1LL > > | toChronoSeconds (units::second_t seconds) |
constexpr void | memcpyLE (void *dst, void *src, size_t len) |
constexpr uint8_t | extractU8 (uint64_t data, uint8_t width, uint8_t offset) |
constexpr uint16_t | extractU16 (uint64_t data, uint8_t width, uint8_t offset) |
constexpr uint32_t | extractU32 (uint64_t data, uint8_t width, uint8_t offset) |
constexpr uint64_t | extractU64 (uint64_t data, uint8_t width, uint8_t offset) |
constexpr int8_t | extractI8 (uint64_t data, uint8_t width, uint8_t offset) |
constexpr int16_t | extractI16 (uint64_t data, uint8_t width, uint8_t offset) |
constexpr int32_t | extractI32 (uint64_t data, uint8_t width, uint8_t offset) |
constexpr int64_t | extractI64 (uint64_t data, uint8_t width, uint8_t offset) |
constexpr float | extractF24 (uint64_t data, uint8_t offset) |
constexpr float | extractF32 (uint64_t data, uint8_t offset) |
constexpr double | extractF64 (uint64_t data) |
constexpr bool | extractBool (uint64_t data, uint8_t offset) |
constexpr uint64_t | packUInt (uint64_t data, uint8_t width, uint8_t offset) |
constexpr uint64_t | packInt (int64_t data, uint8_t width, uint8_t offset) |
constexpr uint64_t | packF24 (float data, uint8_t offset) |
constexpr uint64_t | packF32 (float data, uint8_t offset) |
constexpr uint64_t | packF64 (double data, uint8_t offset) |
constexpr uint64_t | packBool (bool data, uint8_t offset) |
template<typename E > | |
constexpr std::underlying_type< E >::type | to_underlying (E e) noexcept |
Series of utility functions for CAN messaging and bit manipulation.
For more information, see https://docs.wpilib.org/en/stable/docs/software/can-devices/can-addressing.html
|
constexpr |
Construct a CAN message id to send to a Redux device.
deviceType | the device id code |
devId | CAN device id |
msgId | API message id |
|
constexpr |
Extracts a boolean from a bitfield.
data | bitfield to extract from |
offset | the offset of the boolean bit in the bitfield |
|
constexpr |
Extracts a 24-bit float.
24-bit floats have 1 sign bit, 8 exponent bits, and 15 mantissa bits.
data | bitfield to extract from |
offset | bit offset of the float to extract |
|
constexpr |
Extracts a 32-bit single-precision float.
data | bitfield to extract from |
offset | bit offset of the float to extract |
|
constexpr |
Extracts a 64-bit double-precision float.
data | bitfield to extract from |
|
constexpr |
Extracts a signed integer up to 16 bits wide, performing a sign extension if necessary.
data | bitfield to extract from |
width | width of integer in bits. Values larger than 16 are undefined behavior. |
offset | bit offset of the integer to extract |
|
constexpr |
Extracts a signed integer up to 32 bits wide, performing a sign extension if necessary.
data | bitfield to extract from |
width | width of integer in bits. Values larger than 32 are undefined behavior. |
offset | bit offset of the integer to extract |
|
constexpr |
Extracts a signed integer up to 64 bits wide, performing a sign extension if necessary.
data | bitfield to extract from |
width | width of integer in bits. Values larger than 64 are undefined behavior. |
offset | bit offset of the integer to extract |
|
constexpr |
Extracts a signed integer up to 8 bits wide, performing a sign extension if necessary.
data | bitfield to extract from |
width | width of integer in bits. Values larger than 8 are undefined behavior. |
offset | bit offset of the integer to extract |
|
constexpr |
Extracts an unsigned integer up to 16 bits wide.
data | bitfield to extract from |
width | width of integer in bits. Values larger than 16 are undefined behavior. |
offset | bit offset of the integer to extract |
|
constexpr |
Extracts an unsigned integer up to 32 bits wide.
data | bitfield to extract from |
width | width of integer in bits. Values larger than 32 are undefined behavior. |
offset | bit offset of the integer to extract |
|
constexpr |
Extracts an unsigned integer up to 64 bits wide.
data | bitfield to extract from |
width | width of integer in bits. Values larger than 64 are undefined behavior. |
offset | bit offset of the integer to extract |
|
constexpr |
Extracts an unsigned integer up to 8 bits wide.
data | bitfield to extract from |
width | width of integer in bits. Values larger than 8 are undefined behavior. |
offset | bit offset of the integer to extract |
|
constexpr |
Extracts the 8-bit API index from a full message id. Instead of doing a 6bit/4bit split for api class/api index, we use 2bit/8bit.
fullId | the full 29-bit message id |
|
constexpr |
Extracts 2-bit product id/API class from a full message id. Instead of doing a 6bit/4bit split for api class/api index, we use 2bit/8bit.
fullId | the full 29-bit message id |
|
constexpr |
Extracts 6-bit device id from a full message id This is the "CAN id" that end users will see and care about.
fullId | the full 29-bit message id |
|
constexpr |
Extracts 5-bit device type code from a full message id
fullId | the full 29-bit message id |
|
constexpr |
Checks if a full CAN id will match against device type, product id, and device id We use this to determine if a message is intended for a specific device.
idToCompare | full 29-bit id |
deviceType | device id code |
devId | device id |
|
constexpr |
Converts a byte buffer to a little endian buffer.
dst | destination ptr |
src | source ptr |
len | the length of the data in bytes. If less than 8, the unused bit-space will be zeros. |
|
constexpr |
Packs a boolean as a single bit into a 64-bit field.
data | the boolean value |
offset | the 0-indexed offset of the bit in the bitfield |
|
constexpr |
Packs a float into a 24-bit field. This is accomplished by ignoring the least significant 8 bits of the mantissa.
data | the float to pack |
offset | the 0-indexed offset of the float in the bitfield |
|
constexpr |
Packs a float into a 32-bit field.
data | the float to pack |
offset | the 0-indexed offset of the float in the bitfield |
|
constexpr |
Packs a double into a 64-bit field.
data | the double to pack |
offset | the 0-indexed offset of the double in the bitfield |
|
constexpr |
Packs a signed integer of variable length into a bitfield as twos complement.
data | the signed integer to pack |
width | the width of the signed integer |
offset | the 0-indexed offset of the integer in the bitfield |
|
constexpr |
Packs an unsigned integer of variable length into a bitfield.
data | the unsigned integer to pack |
width | the width of the unsigned integer |
offset | the 0-indexed offset of the integer in the bitfield |
|
constexprnoexcept |
Converts an enum to an underlying type
e | value to convert |
|
constexpr |
Converts seconds from the units library to seconds in std::chrono::duration.
Useful for condition variables.
seconds | in units::second_t terms |