pub fn open_reading_pipe<T: Into<DataPipe>>(
        &mut self,
        pipe: T,
        mut addr: &[u8],
    ) -> Result<(), TransferError<SPIErr, PinErr>> {
        let pipe = pipe.into();
        if addr.len() > Self::MAX_ADDR_WIDTH {
            addr = &addr[0..Self::MAX_ADDR_WIDTH];
        }

        // Get the memory map address corresponding to the data pipe.
        let rx_address_reg: Register = pipe.into();
        match pipe {
            DataPipe::DP0 | DataPipe::DP1 => self.write_register(rx_address_reg, addr)?,
            _ => self.write_register(rx_address_reg, addr[0])?,
        }

        // Enable corresponding RX Addr
        let old_reg = self.read_register(Register::EN_RXADDR)?; // Read old value
        self.write_register(Register::EN_RXADDR, old_reg | (1 << pipe.pipe()))?; // Update

        Ok(())
    }
/// Opens a reading pipe for reading data on an address.
///
/// # Examples
/// ```rust
/// chip.open_reading_pipe(DataPipe::DP0, b"Node1")?;
/// ```
///
/// `pipe` can either be an instance of the type [`DataPipe`] or an integer.
/// Note that if an integer is provided, numbers higher than 5 will default to reading pipe 0.
///
/// # Warnings
/// You have to call this before calling [`start_listening()`](#method.start_listening).
Opens a reading pipe for reading data on an address.
Opens a reading pipe for reading data on an address .
pub fn open_reading_pipe<T: Into<DataPipe>>(
        &mut self,
        pipe: T,
        mut addr: &[u8],
    ) -> Result<(), TransferError<SPIErr, PinErr>> {
        let pipe = pipe.into();
        if addr.len() > Self::MAX_ADDR_WIDTH {
            addr = &addr[0..Self::MAX_ADDR_WIDTH];
        }
        // Get the memory map address corresponding to the data pipe.
        let rx_address_reg: Register = pipe.into();
        match pipe {
            DataPipe::DP0 | DataPipe::DP1 => self.write_register(rx_address_reg, addr)?,
            _ => self.write_register(rx_address_reg, addr[0])?,
        }
        // Enable corresponding RX Addr
        let old_reg = self.read_register(Register::EN_RXADDR)?; // Read old value
        self.write_register(Register::EN_RXADDR, old_reg | (1 << pipe.pipe()))?; // Update
        Ok(())
    }
pub fn open_reading_pipe < T : Into < DataPipe > > ( & mut self , pipe : T , mut addr : & [ u8 ] , ) -> Result < ( ) , TransferError < SPIErr , PinErr > > { let pipe = pipe . into ( ) ; if addr . len ( ) > Self :: MAX_ADDR_WIDTH { addr = & addr [ 0 .. Self :: MAX_ADDR_WIDTH ] ; } // Get the memory map address corresponding to the data pipe. let rx_address_reg : Register = pipe . into ( ) ; match pipe { DataPipe :: DP0 | DataPipe :: DP1 => self . write_register ( rx_address_reg , addr ) ? , _ => self . write_register ( rx_address_reg , addr [ 0 ] ) ? , } // Enable corresponding RX Addr let old_reg = self . read_register ( Register :: EN_RXADDR ) ? ; // Read old value self . write_register ( Register :: EN_RXADDR , old_reg | ( 1 << pipe . pipe ( ) ) ) ? ; // Update Ok ( ( ) ) }
Opens a reading pipe for reading data on an address.
Opens a reading pipe for reading data on an address .
&mut self
pipe
T
addr
&[u8]
&mut self
pipe
T
addr
&[u8]
examples
```rust
chip.open_reading_pipe(DataPipe::DP0, b"Node1")?;
```

`pipe` can either be an instance of the type [`DataPipe`] or an integer.
Note that if an integer is provided, numbers higher than 5 will default to reading pipe 0.
` ` ` rust chip . open_reading_pipe ( DataPipe :: DP0 b " Node1 " ) ? ; ` ` ` ` pipe ` can either be an instance of the type [ ` DataPipe ` ] or an integer . Note that if an integer is provided numbers higher than 5 will default to reading pipe 0 .
warnings
You have to call this before calling [`start_listening()`](#method.start_listening).
You have to call this before calling [ ` start_listening () ` ] ( #method . start_listening ) .