pub fn left_justify(data: u32, data_length: u8)-> [u8; 3]{
    let left_shift = 24 - data_length; // Remember 8 leftmost bits are discarded.
    let justified_data = data << left_shift;
    u24_to_bytes(justified_data)
}
/// Justify at top left given data.
///
/// Leftmost 8 bits are discarded, because although an u32 is entered an u24 is returned
/// distributed in 3 bytes.
///
/// # Parameters:
/// * data: u32 containing data.
/// * data_length: How many bits are actually useful data.
///
/// # Returns:
/// * An array of three bytes. Returned u24 leftmost bits are returned in first byte.
///
/// # Example:
/// ```ignore
/// let data = 0b_11_u32;
/// let returned_data = left_justify(data, 2);
/// assert_eq!(0b_1100_0000_u8, returned_data[0]);
/// ```
Justify at top left given data.
Leftmost 8 bits are discarded, because although an u32 is entered an u24 is returned
distributed in 3 bytes.
Justify at top left given data . Leftmost 8 bits are discarded because although an u32 is entered an u24 is returned distributed in 3 bytes .
pub fn left_justify(data: u32, data_length: u8)-> [u8; 3]{
    let left_shift = 24 - data_length; // Remember 8 leftmost bits are discarded.
    let justified_data = data << left_shift;
    u24_to_bytes(justified_data)
}
pub fn left_justify ( data : u32 , data_length : u8 ) -> [ u8 ; 3 ] { let left_shift = 24 - data_length ; // Remember 8 leftmost bits are discarded. let justified_data = data << left_shift ; u24_to_bytes ( justified_data ) }
Justify at top left given data.
Justify at top left given data .
data
u32
data_length
u8
data
u32
data_length
u8
parameters:
u32 containing data.
data_length: How many bits are actually useful data.
u32 containing data . data_length : How many bits are actually useful data .
returns:
An array of three bytes. Returned u24 leftmost bits are returned in first byte.
An array of three bytes . Returned u24 leftmost bits are returned in first byte .
example:
None