docs: document public apis of wiznet driver

This commit is contained in:
Ulf Lilleengen 2023-12-20 12:14:25 +01:00
parent 52a801fdb7
commit 4a2dd7b944
5 changed files with 7 additions and 0 deletions

View File

@ -6,6 +6,7 @@ keywords = ["embedded", "wiznet", "embassy-net", "embedded-hal-async", "ethernet
categories = ["embedded", "hardware-support", "no-std", "network-programming", "async"] categories = ["embedded", "hardware-support", "no-std", "network-programming", "async"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
repository = "https://github.com/embassy-rs/embassy"
[dependencies] [dependencies]
embedded-hal = { version = "1.0.0-rc.3" } embedded-hal = { version = "1.0.0-rc.3" }

View File

@ -1,3 +1,4 @@
//! Wiznet W5100s and W5500 family driver.
mod w5500; mod w5500;
pub use w5500::W5500; pub use w5500::W5500;
mod w5100s; mod w5100s;
@ -45,4 +46,5 @@ pub(crate) mod sealed {
} }
} }
/// Trait for Wiznet chips.
pub trait Chip: sealed::Chip {} pub trait Chip: sealed::Chip {}

View File

@ -4,6 +4,7 @@ const SOCKET_BASE: u16 = 0x400;
const TX_BASE: u16 = 0x4000; const TX_BASE: u16 = 0x4000;
const RX_BASE: u16 = 0x6000; const RX_BASE: u16 = 0x6000;
/// Wizard W5100S chip.
pub enum W5100S {} pub enum W5100S {}
impl super::Chip for W5100S {} impl super::Chip for W5100S {}

View File

@ -8,6 +8,7 @@ pub enum RegisterBlock {
RxBuf = 0x03, RxBuf = 0x03,
} }
/// Wiznet W5500 chip.
pub enum W5500 {} pub enum W5500 {}
impl super::Chip for W5500 {} impl super::Chip for W5500 {}

View File

@ -1,6 +1,7 @@
#![no_std] #![no_std]
#![allow(async_fn_in_trait)] #![allow(async_fn_in_trait)]
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]
#![warn(missing_docs)]
pub mod chip; pub mod chip;
mod device; mod device;
@ -47,6 +48,7 @@ pub struct Runner<'d, C: Chip, SPI: SpiDevice, INT: Wait, RST: OutputPin> {
/// You must call this in a background task for the driver to operate. /// You must call this in a background task for the driver to operate.
impl<'d, C: Chip, SPI: SpiDevice, INT: Wait, RST: OutputPin> Runner<'d, C, SPI, INT, RST> { impl<'d, C: Chip, SPI: SpiDevice, INT: Wait, RST: OutputPin> Runner<'d, C, SPI, INT, RST> {
/// Run the driver.
pub async fn run(mut self) -> ! { pub async fn run(mut self) -> ! {
let (state_chan, mut rx_chan, mut tx_chan) = self.ch.split(); let (state_chan, mut rx_chan, mut tx_chan) = self.ch.split();
let mut tick = Ticker::every(Duration::from_millis(500)); let mut tick = Ticker::every(Duration::from_millis(500));