51 int8_t frame_sys_message(uint8_t* dest,
Magics::SYS sys_type);
61 int8_t frame_cmd_type_message(uint8_t* dest,
const uint8_t type);
80 int8_t frame_cmd_modes_message(uint8_t* dest,
const uint8_t modes,
81 const uint8_t modes_visible);
92 int8_t frame_cmd_speed_message(uint8_t* dest,
const uint32_t speed);
102 int8_t frame_cmd_select_message(uint8_t* dest,
const uint8_t mode);
114 int8_t frame_cmd_write_message(uint8_t* dest,
const uint8_t* data,
133 int8_t frame_info_message_name(uint8_t* dest,
const uint8_t mode,
158 int8_t frame_info_message_span(uint8_t* dest,
const uint8_t mode,
160 const float lower,
const float upper);
180 int8_t frame_info_message_symbol(uint8_t* dest,
const uint8_t mode,
212 int8_t frame_info_message_format(uint8_t* dest,
const uint8_t mode,
215 const uint8_t decimals);
232 int8_t frame_data_message(uint8_t* dest,
const uint8_t mode,
244 uint8_t checksum(
const uint8_t* buf,
const uint8_t len);
256 constexpr uint8_t
log2(uint8_t val) {
257 return (0x1f - __builtin_clz(val)) +
258 (val - (0x01 << (0x1f -__builtin_clz(val))) != 0 ? 1 : 0);
271 return log2(len) << 0x03;
284 uint8_t insert_padding(uint8_t* dest, uint8_t len);
constexpr uint8_t log2(uint8_t val)
constexpr uint8_t PAYLOAD_EV3_TO_SENSOR_MAX
Maximum size of any payload sent in the EV3 UART sensor protocol, in bytes, from the EV3 to the senso...
constexpr uint8_t PAYLOAD_SENSOR_TO_EV3_MAX
Maximum size of any payload sent in the EV3 UART sensor protocol, in bytes, to the EV3...
constexpr uint8_t BUFFER_MIN
Minimum size of the buffer (in bytes) that the user has to provide to each of the framing functions...
constexpr uint8_t PAYLOAD_MIN
Minimum size of any payload sent in the EV3 UART sensor protocol, regardless of direction, in bytes.
constexpr uint8_t length_code(uint8_t len)
constexpr uint8_t SYMBOL_MAX
Maximum length of the string representation (ASCII) of any symbol referencing a the SI unit used to r...