opentitanlib::test_utils::bitbanging::uart

Function compute_parity

Source
pub fn compute_parity(data: u8, parity_bit: Option<bool>) -> bool
Expand description

Count the number of 1s in the data (& an optional parity bit). Return true if there is an even number of 1s, and false otherwise.