ChimeraTK-DeviceAccess  03.18.00
ChimeraTK::UioAccess Class Reference

Implements a generic userspace interface for UIO devices. More...

#include <UioAccess.h>

Public Member Functions

 UioAccess (const std::string &deviceFilePath)
 
 ~UioAccess ()
 
void open ()
 Opens UIO device for read and write operations and interrupt handling. More...
 
void close ()
 Closes UIO device. More...
 
void read (uint64_t map, uint64_t address, int32_t *data, size_t sizeInBytes)
 Read data from the specified memory offset address. More...
 
void write (uint64_t map, uint64_t address, int32_t const *data, size_t sizeInBytes)
 Write data to the specified memory offset address. More...
 
uint32_t waitForInterrupt (int timeoutMs)
 Wait for hardware interrupt to occur within specified timeout period. More...
 
void clearInterrupts ()
 Clear all pending interrupts. More...
 
std::string getDeviceFilePath ()
 Return UIO device file path. More...
 

Detailed Description

Implements a generic userspace interface for UIO devices.

Definition at line 13 of file UioAccess.h.

Constructor & Destructor Documentation

◆ UioAccess()

ChimeraTK::UioAccess::UioAccess ( const std::string &  deviceFilePath)
explicit

Definition at line 17 of file UioAccess.cc.

◆ ~UioAccess()

ChimeraTK::UioAccess::~UioAccess ( )

Definition at line 19 of file UioAccess.cc.

+ Here is the call graph for this function:

Member Function Documentation

◆ clearInterrupts()

void ChimeraTK::UioAccess::clearInterrupts ( )

Clear all pending interrupts.

Definition at line 121 of file UioAccess.cc.

+ Here is the call graph for this function:

◆ close()

void ChimeraTK::UioAccess::close ( )

Closes UIO device.

Definition at line 41 of file UioAccess.cc.

+ Here is the caller graph for this function:

◆ getDeviceFilePath()

std::string ChimeraTK::UioAccess::getDeviceFilePath ( )

Return UIO device file path.

Returns
File path

Definition at line 130 of file UioAccess.cc.

+ Here is the caller graph for this function:

◆ open()

void ChimeraTK::UioAccess::open ( )

Opens UIO device for read and write operations and interrupt handling.

Definition at line 23 of file UioAccess.cc.

+ Here is the call graph for this function:

◆ read()

void ChimeraTK::UioAccess::read ( uint64_t  map,
uint64_t  address,
int32_t *  data,
size_t  sizeInBytes 
)

Read data from the specified memory offset address.

The address range starts at '0'.

Parameters
mapSelected UIO memory region. Only region '0' is currently supported.
addressStart address of memory to read from
dataAddress pointer to which data is to be copied
sizeInBytesNumber of bytes to copy

Definition at line 49 of file UioAccess.cc.

+ Here is the caller graph for this function:

◆ waitForInterrupt()

uint32_t ChimeraTK::UioAccess::waitForInterrupt ( int  timeoutMs)

Wait for hardware interrupt to occur within specified timeout period.

Parameters
timeoutMsTimeout period in ms
Returns
Number of interrupts that occurred. '0' for none withing timeout period.

Definition at line 87 of file UioAccess.cc.

+ Here is the call graph for this function:

◆ write()

void ChimeraTK::UioAccess::write ( uint64_t  map,
uint64_t  address,
int32_t const *  data,
size_t  sizeInBytes 
)

Write data to the specified memory offset address.

The address range starts at '0'.

Parameters
mapSelected UIO memory region. Only region '0' is currently supported.
addressStart address of memory to write to
dataAddress pointer from which data is to be copied
sizeInBytesNumber of bytes to copy

Definition at line 68 of file UioAccess.cc.

+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: