Memory Mapped I/O access library
Overview
This is a library for accessing memory-mapped I/O.
It assists register access using UIO(User space I/O) and bare-metal access with no_std.
It also assists access using u-dma-buf.
MMIO(Memory Mapped I/O)
mmio access in bare-metal programming can be written as follows.
type RegisterWordSize = u64;
let mmio_acc = new;
mmio_acc.write_mem8 ; // addr : 0xffff0000
mmio_acc.write_mem16; // addr : 0xffff0002
mmio_acc.write_reg32; // addr : 0xffff0080 <= 0x10 * size_of<RegisterWordSize>()
mmio_acc.read_reg32; // addr : 0xffff0080 <= 0x10 * size_of<RegisterWordSize>()
UIO(Userspace I/O)
UIO access in Linux programming can be written as follows.
type RegisterWordSize = usize;
let uio_num = 1; // ex.) /dev/uio1
let uio_acc = new;
uio_acc.set_irq_enable;
uio_acc.write_reg32;
uio_acc.wait_irq;
u-dma-buf
u-dma-buf access in Linux programming can be written as follows.
let udmabuf_num = 4; // ex.) /dev/udmabuf4
let udmabuf_acc = new.unwrap;
println!;
println!;
udmabuf_acc.write_mem32;