pub fn u24_to_bytes(int: u32)-> [u8; 3]{
    let lower_byte = (int & mask::<u32>(8, false)) as u8;
    let middle_byte = ((int >> 8) & mask::<u32>(8, false)) as u8;
    let upper_byte = ((int >> 16) & mask::<u32>(8, false)) as u8;
    [upper_byte, middle_byte, lower_byte]
}
/// Convert a 24 bit long integer into an array of 3 bytes.
///
/// Most significant bits are stored at first byte while least significant
/// bits are left at last byte.
///
/// If given int is longer than 24 bits then exceeding bits are discarded.
///
/// # Parameters:
/// * int: u32 to be split in bytes. As we split only 3 bytes bits from 25 position to 32
/// are discarded.
///
/// # Returns:
/// * Array of 3 bytes.
Convert a 24 bit long integer into an array of 3 bytes.
Most significant bits are stored at first byte while least significant
bits are left at last byte.

If given int is longer than 24 bits then exceeding bits are discarded.
Convert a 24 bit long integer into an array of 3 bytes . Most significant bits are stored at first byte while least significant bits are left at last byte . If given int is longer than 24 bits then exceeding bits are discarded .
pub fn u24_to_bytes(int: u32)-> [u8; 3]{
    let lower_byte = (int & mask::<u32>(8, false)) as u8;
    let middle_byte = ((int >> 8) & mask::<u32>(8, false)) as u8;
    let upper_byte = ((int >> 16) & mask::<u32>(8, false)) as u8;
    [upper_byte, middle_byte, lower_byte]
}
pub fn u24_to_bytes ( int : u32 ) -> [ u8 ; 3 ] { let lower_byte = ( int & mask :: < u32 > ( 8 , false ) ) as u8 ; let middle_byte = ( ( int >> 8 ) & mask :: < u32 > ( 8 , false ) ) as u8 ; let upper_byte = ( ( int >> 16 ) & mask :: < u32 > ( 8 , false ) ) as u8 ; [ upper_byte , middle_byte , lower_byte ] }
Convert a 24 bit long integer into an array of 3 bytes.
Convert a 24 bit long integer into an array of 3 bytes .
int
u32
int
u32
parameters:
u32 to be split in bytes. As we split only 3 bytes bits from 25 position to 32
are discarded.
u32 to be split in bytes . As we split only 3 bytes bits from 25 position to 32 are discarded .
returns:
Array of 3 bytes.
Array of 3 bytes .