pub unsafe fn buf_as_slice_mut(&mut self, length: usize) -> &mut [u8] {
        let x = self.tdidx;

        // Set address in descriptor
        self.td[x].tdes0 = ptr::addr_of!(self.tbuf[x]) as u32; // Buffer 1

        // Set length in descriptor
        let len = core::cmp::min(length, ETH_BUF_SIZE);
        self.td[x].tdes2 = (length as u32) & EMAC_TDES2_B1L;

        // Create a raw pointer in place without an intermediate reference. Use
        // this to return a slice from the packed buffer
        let addr = ptr::addr_of_mut!(self.tbuf[x]) as *mut _;
        core::slice::from_raw_parts_mut(addr, len)
    }
/// Access the buffer pointed to by the next TDes
Access the buffer pointed to by the next TDes
Access the buffer pointed to by the next TDes
pub unsafe fn buf_as_slice_mut(&mut self, length: usize) -> &mut [u8] {
        let x = self.tdidx;
        // Set address in descriptor
        self.td[x].tdes0 = ptr::addr_of!(self.tbuf[x]) as u32; // Buffer 1
        // Set length in descriptor
        let len = core::cmp::min(length, ETH_BUF_SIZE);
        self.td[x].tdes2 = (length as u32) & EMAC_TDES2_B1L;
        // Create a raw pointer in place without an intermediate reference. Use
        // this to return a slice from the packed buffer
        let addr = ptr::addr_of_mut!(self.tbuf[x]) as *mut _;
        core::slice::from_raw_parts_mut(addr, len)
    }
pub unsafe fn buf_as_slice_mut ( & mut self , length : usize ) -> & mut [ u8 ] { let x = self . tdidx ; // Set address in descriptor self . td [ x ] . tdes0 = ptr :: addr_of ! ( self tbuf [ x ] ) as u32 ; // Buffer 1 // Set length in descriptor let len = core :: cmp :: min ( length , ETH_BUF_SIZE ) ; self . td [ x ] . tdes2 = ( length as u32 ) & EMAC_TDES2_B1L ; // Create a raw pointer in place without an intermediate reference. Use // this to return a slice from the packed buffer let addr = ptr :: addr_of_mut ! ( self tbuf [ x ] ) as * mut _ ; core :: slice :: from_raw_parts_mut ( addr , len ) }
Access the buffer pointed to by the next TDes
Access the buffer pointed to by the next TDes
&mut self
length
usize
&mut self
length
usize