#[repr(C)]pub struct uart_bitrate_res_t {
pub low_period: u32,
pub high_period: u32,
pub pos_period: u32,
pub neg_period: u32,
pub edge_cnt: u32,
pub clk_freq_hz: u32,
}Expand description
@brief Structure to store the measurement results for UART bitrate detection within the measurement period
Formula to calculate the bitrate: If the signal is ideal, bitrate = clk_freq_hz * 2 / (low_period + high_period) If the signal is weak along falling edges, then you may use bitrate = clk_freq_hz * 2 / pos_period If the signal is weak along rising edges, then you may use bitrate = clk_freq_hz * 2 / neg_period
Fields§
§low_period: u32< Stores the minimum tick count of a low-level pulse
high_period: u32< Stores the minimum tick count of a high-level pulse
pos_period: u32< Stores the minimum tick count between two positive edges
neg_period: u32< Stores the minimum tick count between two negative edges
edge_cnt: u32< Stores the count of RX edge changes (10-bit counter, be careful, it could overflow)
clk_freq_hz: u32< The frequency of the tick being used to count the measurement results, in Hz
Trait Implementations§
Source§impl Clone for uart_bitrate_res_t
impl Clone for uart_bitrate_res_t
Source§fn clone(&self) -> uart_bitrate_res_t
fn clone(&self) -> uart_bitrate_res_t
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for uart_bitrate_res_t
impl Debug for uart_bitrate_res_t
Source§impl Default for uart_bitrate_res_t
impl Default for uart_bitrate_res_t
Source§fn default() -> uart_bitrate_res_t
fn default() -> uart_bitrate_res_t
impl Copy for uart_bitrate_res_t
Auto Trait Implementations§
impl Freeze for uart_bitrate_res_t
impl RefUnwindSafe for uart_bitrate_res_t
impl Send for uart_bitrate_res_t
impl Sync for uart_bitrate_res_t
impl Unpin for uart_bitrate_res_t
impl UnsafeUnpin for uart_bitrate_res_t
impl UnwindSafe for uart_bitrate_res_t
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)