ChimeraTK-DeviceAccess 03.20.00
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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.
 
void close ()
 Closes UIO device.
 
void read (uint64_t map, uint64_t address, int32_t *data, size_t sizeInBytes)
 Read data from the specified memory offset address.
 
void write (uint64_t map, uint64_t address, int32_t const *data, size_t sizeInBytes)
 Write data to the specified memory offset address.
 
uint32_t waitForInterrupt (int timeoutMs)
 Wait for hardware interrupt to occur within specified timeout period.
 
void clearInterrupts ()
 Clear all pending interrupts.
 
std::string getDeviceFilePath ()
 Return UIO device file path.
 

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 19 of file UioAccess.cc.

◆ ~UioAccess()

ChimeraTK::UioAccess::~UioAccess ( )

Definition at line 21 of file UioAccess.cc.

Member Function Documentation

◆ clearInterrupts()

void ChimeraTK::UioAccess::clearInterrupts ( )

Clear all pending interrupts.

Definition at line 123 of file UioAccess.cc.

◆ close()

void ChimeraTK::UioAccess::close ( )

Closes UIO device.

Definition at line 43 of file UioAccess.cc.

◆ getDeviceFilePath()

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

Return UIO device file path.

Returns
File path

Definition at line 132 of file UioAccess.cc.

◆ open()

void ChimeraTK::UioAccess::open ( )

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

Definition at line 25 of file UioAccess.cc.

◆ 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 51 of file UioAccess.cc.

◆ 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 89 of file UioAccess.cc.

◆ 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 70 of file UioAccess.cc.


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