Crates.io | cadence-macb |
lib.rs | cadence-macb |
version | 0.1.0 |
source | src |
created_at | 2023-02-23 13:00:10.293072 |
updated_at | 2023-02-23 13:00:10.293072 |
description | cadence-macb ethernet rust driver on SiFive FU740 board. |
homepage | https://github.com/elliott10/cadence-macb.git |
repository | https://github.com/elliott10/cadence-macb.git |
max_upload_size | |
id | 792729 |
size | 162,182 |
cadence-macb ethernet Rust driver on SiFive FU740 board.
Initialize ethernet driver
pub struct MEM;
impl MemMapping for MEM {
fn dma_alloc_coherent(pages: usize) -> usize {
...
}
fn dma_free_coherent(paddr: usize, pages: usize) {
...
}
}
let mut macb_device = cadence_macb::eth_macb::open::<MEM>(&mac).unwrap();
Sending network packets
cadence_macb::eth_macb_ops::macb_send(&mut macb_device, &packet);
Receiving network packets
cadence_macb::eth_macb_ops::macb_recv(&mut macb_device, &mut rx_buffer);