cands_interface/tranceiver/
rx_buffer.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const FIFOSIZE: usize = 1024;

/// Receive data buffer on user space
#[derive(Debug)]
pub struct RxData {
    pub fifo0: Vec<u8>,
    pub fifo1: Vec<u8>
}

impl RxData {
    pub fn new() -> Self {
        Self {
            fifo0: Vec::with_capacity(FIFOSIZE),
            fifo1: Vec::with_capacity(FIFOSIZE),
        }
    }

    pub fn reset(&mut self) {
        self.fifo0.clear();
        self.fifo1.clear();
    }
}