13 static constexpr
auto invalid_string =
"invalid";
14 static constexpr
auto max_14bit = 16384;
16 constexpr std::byte
status_byte_for( std::byte status_byte, std::uint8_t channel ) noexcept
18 return status_byte | std::byte{channel};
23 return ( message_byte & status_byte ) == status_byte;
26 constexpr std::array< std::uint8_t, 3 >
29 return {
static_cast< std::uint8_t
>( message[ 0 ] & std::byte{0x0F} ),
30 static_cast< std::uint8_t >( message[ 1 ] ),
31 static_cast< std::uint8_t
>( message[ 2 ] )};
34 constexpr std::pair< std::byte, std::byte >
uint16_to_lsb_msb( std::uint16_t value ) noexcept
38 ? std::pair( std::byte{
static_cast< std::uint8_t
>( value )}, std::byte{0x00} )
39 : std::make_pair( std::byte{
static_cast< std::uint8_t
>( value % 128 )},
40 std::byte{
static_cast< std::uint8_t
>( value / 128 )} );
43 constexpr std::uint16_t
46 return static_cast< std::uint8_t
>( two_bytes.second ) * std::uint16_t( 128 ) +
47 static_cast< std::uint8_t
>( two_bytes.first );
constexpr bool check_status_byte(std::byte status_byte, std::byte message_byte)
Definition: util.hpp:21
std::conditional_t< greater_than< number_of_bytes, 0 >::value, std::array< std::byte, number_of_bytes >, std::vector< std::byte > > message_t
Definition: message_type.hpp:18
#define SEQUENCER_ASSERT(cond)
Definition: assert.hpp:8
constexpr std::array< std::uint8_t, 3 > read_channel_with_two_7bit_values(const message_t< 3 > &message) noexcept
Definition: util.hpp:27
constexpr std::uint16_t lsb_msb_to_uint16(const std::pair< std::byte, std::byte > &two_bytes) noexcept
Definition: util.hpp:44
constexpr std::byte status_byte_for(std::byte status_byte, std::uint8_t channel) noexcept
Definition: util.hpp:16
constexpr std::pair< std::byte, std::byte > uint16_to_lsb_msb(std::uint16_t value) noexcept
Definition: util.hpp:34