Updating docs
This commit is contained in:
parent
30293b65a5
commit
4afe9f6724
1 changed files with 10 additions and 2 deletions
|
|
@ -27,8 +27,7 @@ impl<SpiBus: Bus> RawDevice<SpiBus> {
|
||||||
bus.write_frame(socket.register(), register::socketn::RXBUF_SIZE, &[0])?;
|
bus.write_frame(socket.register(), register::socketn::RXBUF_SIZE, &[0])?;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configure the chip in MACRAW mode with MAC filtering + Multicast blocking + IPv6
|
// Configure the chip in MACRAW mode with MAC filtering.
|
||||||
// Blocking + Broadcast blocking.
|
|
||||||
let mode: u8 = (1 << 7) | // MAC address filtering
|
let mode: u8 = (1 << 7) | // MAC address filtering
|
||||||
(register::socketn::Protocol::MacRaw as u8);
|
(register::socketn::Protocol::MacRaw as u8);
|
||||||
|
|
||||||
|
|
@ -38,6 +37,15 @@ impl<SpiBus: Bus> RawDevice<SpiBus> {
|
||||||
Ok(Self { bus, raw_socket })
|
Ok(Self { bus, raw_socket })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Read bytes from the RX buffer.
|
||||||
|
//
|
||||||
|
// # Args
|
||||||
|
// * `buffer` - The location to read data into. The length of this slice determines how much
|
||||||
|
// data is read.
|
||||||
|
// * `offset` - The offset into current RX data to start reading from in bytes.
|
||||||
|
//
|
||||||
|
// # Returns
|
||||||
|
// The number of bytes successfully read.
|
||||||
fn read_bytes(&mut self, buffer: &mut [u8], offset: u16) -> Result<usize, SpiBus::Error> {
|
fn read_bytes(&mut self, buffer: &mut [u8], offset: u16) -> Result<usize, SpiBus::Error> {
|
||||||
let rx_size = self.raw_socket.get_receive_size(&mut self.bus)? as usize;
|
let rx_size = self.raw_socket.get_receive_size(&mut self.bus)? as usize;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue