fn handle_read(&mut self, offset: u8) -> u8 {
        match offset as u8 {
            DLAB_LOW if self.is_dlab_set() => self.baud_divisor as u8,
            DLAB_HIGH if self.is_dlab_set() => (self.baud_divisor >> 8) as u8,
            DATA => {
                self.del_intr_bit(IIR_RECV_BIT);
                if self.in_buffer.len() <= 1 {
                    self.line_status &= !LSR_DATA_BIT;
                }
                self.in_buffer.pop_front().unwrap_or_default()
            }
            IER => self.interrupt_enable,
            IIR => {
                let v = self.interrupt_identification | IIR_FIFO_BITS;
                self.iir_reset();
                v
            }
            LCR => self.line_control,
            MCR => self.modem_control,
            LSR => self.line_status,
            MSR => self.modem_status,
            SCR => self.scratch,
            _ => 0,
        }
    }
// Handles a read request from the driver.
Handles a read request from the driver.
Handles a read request from the driver .
fn handle_read(&mut self, offset: u8) -> u8 {
        match offset as u8 {
            DLAB_LOW if self.is_dlab_set() => self.baud_divisor as u8,
            DLAB_HIGH if self.is_dlab_set() => (self.baud_divisor >> 8) as u8,
            DATA => {
                self.del_intr_bit(IIR_RECV_BIT);
                if self.in_buffer.len() <= 1 {
                    self.line_status &= !LSR_DATA_BIT;
                }
                self.in_buffer.pop_front().unwrap_or_default()
            }
            IER => self.interrupt_enable,
            IIR => {
                let v = self.interrupt_identification | IIR_FIFO_BITS;
                self.iir_reset();
                v
            }
            LCR => self.line_control,
            MCR => self.modem_control,
            LSR => self.line_status,
            MSR => self.modem_status,
            SCR => self.scratch,
            _ => 0,
        }
    }
fn handle_read ( & mut self , offset : u8 ) -> u8 { match offset as u8 { DLAB_LOW if self . is_dlab_set ( ) => self . baud_divisor as u8 , DLAB_HIGH if self . is_dlab_set ( ) => ( self . baud_divisor >> 8 ) as u8 , DATA => { self . del_intr_bit ( IIR_RECV_BIT ) ; if self . in_buffer . len ( ) <= 1 { self . line_status &= ! LSR_DATA_BIT ; } self . in_buffer . pop_front ( ) . unwrap_or_default ( ) } IER => self . interrupt_enable , IIR => { let v = self . interrupt_identification | IIR_FIFO_BITS ; self . iir_reset ( ) ; v } LCR => self . line_control , MCR => self . modem_control , LSR => self . line_status , MSR => self . modem_status , SCR => self . scratch , _ => 0 , } }
Handles a read request from the driver.
Handles a read request from the driver .
&mut self
offset
u8