mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-24 15:52:34 +00:00
docs: document public apis of wiznet driver
This commit is contained in:
parent
52a801fdb7
commit
4a2dd7b944
@ -6,6 +6,7 @@ keywords = ["embedded", "wiznet", "embassy-net", "embedded-hal-async", "ethernet
|
||||
categories = ["embedded", "hardware-support", "no-std", "network-programming", "async"]
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2021"
|
||||
repository = "https://github.com/embassy-rs/embassy"
|
||||
|
||||
[dependencies]
|
||||
embedded-hal = { version = "1.0.0-rc.3" }
|
||||
|
@ -1,3 +1,4 @@
|
||||
//! Wiznet W5100s and W5500 family driver.
|
||||
mod w5500;
|
||||
pub use w5500::W5500;
|
||||
mod w5100s;
|
||||
@ -45,4 +46,5 @@ pub(crate) mod sealed {
|
||||
}
|
||||
}
|
||||
|
||||
/// Trait for Wiznet chips.
|
||||
pub trait Chip: sealed::Chip {}
|
||||
|
@ -4,6 +4,7 @@ const SOCKET_BASE: u16 = 0x400;
|
||||
const TX_BASE: u16 = 0x4000;
|
||||
const RX_BASE: u16 = 0x6000;
|
||||
|
||||
/// Wizard W5100S chip.
|
||||
pub enum W5100S {}
|
||||
|
||||
impl super::Chip for W5100S {}
|
||||
|
@ -8,6 +8,7 @@ pub enum RegisterBlock {
|
||||
RxBuf = 0x03,
|
||||
}
|
||||
|
||||
/// Wiznet W5500 chip.
|
||||
pub enum W5500 {}
|
||||
|
||||
impl super::Chip for W5500 {}
|
||||
|
@ -1,6 +1,7 @@
|
||||
#![no_std]
|
||||
#![allow(async_fn_in_trait)]
|
||||
#![doc = include_str!("../README.md")]
|
||||
#![warn(missing_docs)]
|
||||
|
||||
pub mod chip;
|
||||
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.
|
||||
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) -> ! {
|
||||
let (state_chan, mut rx_chan, mut tx_chan) = self.ch.split();
|
||||
let mut tick = Ticker::every(Duration::from_millis(500));
|
||||
|
Loading…
Reference in New Issue
Block a user