pub struct UioDevice { /* private fields */ }
Implementations§
source§impl UioDevice
impl UioDevice
sourcepub fn get_resource_info(&mut self) -> Result<Vec<(String, u64)>, UioError>
pub fn get_resource_info(&mut self) -> Result<Vec<(String, u64)>, UioError>
Return a vector of mappable resources (i.e., PCI bars) including their size.
sourcepub fn map_resource(&self, bar_nr: usize) -> Result<*mut c_void, UioError>
pub fn map_resource(&self, bar_nr: usize) -> Result<*mut c_void, UioError>
Maps a given resource into the virtual address space of the process.
Arguments
- bar_nr: The index to the given resource (i.e., 1 for /sys/class/uio/uioX/device/resource1)
sourcepub fn get_event_count(&self) -> Result<u32, UioError>
pub fn get_event_count(&self) -> Result<u32, UioError>
The amount of events.
sourcepub fn get_version(&self) -> Result<String, UioError>
pub fn get_version(&self) -> Result<String, UioError>
The version of the UIO driver.
sourcepub fn map_size(&self, mapping: usize) -> Result<usize, UioError>
pub fn map_size(&self, mapping: usize) -> Result<usize, UioError>
The size of a given mapping.
Arguments
- mapping: The given index of the mapping (i.e., 1 for /sys/class/uio/uioX/maps/map1)
sourcepub fn map_addr(&self, mapping: usize) -> Result<usize, UioError>
pub fn map_addr(&self, mapping: usize) -> Result<usize, UioError>
The address of a given mapping.
Arguments
- mapping: The given index of the mapping (i.e., 1 for /sys/class/uio/uioX/maps/map1)
sourcepub fn get_map_info(&mut self) -> Result<Vec<String>, UioError>
pub fn get_map_info(&mut self) -> Result<Vec<String>, UioError>
Return a list of all possible memory mappings.
sourcepub fn map_mapping(&self, mapping: usize) -> Result<*mut c_void, UioError>
pub fn map_mapping(&self, mapping: usize) -> Result<*mut c_void, UioError>
Map an available memory mapping.
Arguments
- mapping: The given index of the mapping (i.e., 1 for /sys/class/uio/uioX/maps/map1)
sourcepub fn irq_enable(&mut self) -> Result<()>
pub fn irq_enable(&mut self) -> Result<()>
Enable interrupt
sourcepub fn irq_disable(&mut self) -> Result<()>
pub fn irq_disable(&mut self) -> Result<()>
Disable interrupt
Auto Trait Implementations§
impl RefUnwindSafe for UioDevice
impl Send for UioDevice
impl Sync for UioDevice
impl Unpin for UioDevice
impl UnwindSafe for UioDevice
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more