ApraLinuxUtils 1.0.0
C++ utility library for embedded Linux systems
 
Loading...
Searching...
No Matches
apra::I2C_Interface Class Reference

#include <I2CInterface.h>

Inheritance diagram for apra::I2C_Interface:
apra::ProcessThread

Public Member Functions

 I2C_Interface (string i2cPath, string processName, uint64_t processFpsHz, bool shouldPrint)
 
virtual ~I2C_Interface ()
 
virtual void process (Message *obj)
 
uint64_t registerEvent (I2C_Transaction_Message message)
 
void unregisterEvent (uint64_t messageHandle)
 
I2CError reSetupI2CBus ()
 
bool isSuccessfullSetup ()
 
- Public Member Functions inherited from apra::ProcessThread
 ProcessThread (string name, int64_t freq=0)
 
virtual ~ProcessThread ()
 
void setType (THREAD_TYPE t)
 
int32_t begin ()
 
virtual int32_t end ()
 
bool shouldIquit ()
 
string getName ()
 
void enque (Message *p)
 
THREAD_TYPE getType ()
 
void setFPS (int64_t fps)
 
Messagedequeue ()
 

Protected Member Functions

virtual void processEvents ()
 
virtual void processSingleEvent ()
 
void processMessage (I2C_Transaction_Message *txMessage)
 
void processI2CTransaction (I2C_Transaction_Message *txMessage)
 
I2CError performRead (uint8_t chipNumber, I2C_Message &message)
 
I2CError performCompareRead (uint8_t chipNumber, I2C_Message &message, bool compareEquals)
 
I2CError performWrite (uint8_t chipNumber, I2C_Message &message)
 
void performTransactionDelay (const uint64_t timeDelay)
 
uint64_t getNormalizedDelay (int64_t largerTime, int64_t smallerTime, uint64_t timeDelay)
 
- Protected Member Functions inherited from apra::ProcessThread
int32_t mainLoop ()
 
void someFunction (bool &executedOnce)
 
void enqueResponse (Message *message)
 
void trimQueue (std::queue< Message * > &queue)
 

Protected Attributes

string m_i2cPath
 
I2C_Bus m_i2cBus
 
map< uint64_t, I2C_Transaction_Messagem_registeredEvents
 
vector< uint64_t > m_processedEvents
 
apra::Mutex m_eventMessageLock
 
int64_t m_lastProcessedEventTs
 
bool m_setupSuccess
 
apra::Mutex m_processLock
 
- Protected Attributes inherited from apra::ProcessThread
string m_threadname
 
pthread_t m_threadID
 
int64_t m_frequSec
 
std::queue< Message * > m_requestQueue
 
std::queue< Message * > m_responseQueue
 
THREAD_TYPE m_typeofThread
 
Mutex m_requestLock
 
Mutex m_responseLock
 
bool m_shouldIquit
 
uint32_t m_queueSizeLimit
 

Additional Inherited Members

- Static Protected Member Functions inherited from apra::ProcessThread
static void * beginProxy (void *arg)
 

Detailed Description

Definition at line 25 of file I2CInterface.h.

Constructor & Destructor Documentation

◆ I2C_Interface()

apra::I2C_Interface::I2C_Interface ( string  i2cPath,
string  processName,
uint64_t  processFpsHz,
bool  shouldPrint 
)

◆ ~I2C_Interface()

apra::I2C_Interface::~I2C_Interface ( )
virtual

Definition at line 40 of file I2CInterface.cpp.

References apra::I2C_Bus::closeBus(), and m_i2cBus.

Member Function Documentation

◆ getNormalizedDelay()

uint64_t apra::I2C_Interface::getNormalizedDelay ( int64_t  largerTime,
int64_t  smallerTime,
uint64_t  timeDelay 
)
protected

Definition at line 393 of file I2CInterface.cpp.

Referenced by performTransactionDelay(), and processMessage().

◆ isSuccessfullSetup()

bool apra::I2C_Interface::isSuccessfullSetup ( )

Definition at line 56 of file I2CInterface.cpp.

References m_setupSuccess.

◆ performCompareRead()

◆ performRead()

◆ performTransactionDelay()

void apra::I2C_Interface::performTransactionDelay ( const uint64_t  timeDelay)
protected

◆ performWrite()

◆ process()

void apra::I2C_Interface::process ( Message obj)
virtual

◆ processEvents()

◆ processI2CTransaction()

◆ processMessage()

◆ processSingleEvent()

◆ registerEvent()

uint64_t apra::I2C_Interface::registerEvent ( I2C_Transaction_Message  message)

◆ reSetupI2CBus()

I2CError apra::I2C_Interface::reSetupI2CBus ( )

◆ unregisterEvent()

void apra::I2C_Interface::unregisterEvent ( uint64_t  messageHandle)

Definition at line 68 of file I2CInterface.cpp.

References m_eventMessageLock, and m_registeredEvents.

Member Data Documentation

◆ m_eventMessageLock

apra::Mutex apra::I2C_Interface::m_eventMessageLock
protected

Definition at line 53 of file I2CInterface.h.

Referenced by processEvents(), processSingleEvent(), registerEvent(), and unregisterEvent().

◆ m_i2cBus

I2C_Bus apra::I2C_Interface::m_i2cBus
protected

◆ m_i2cPath

string apra::I2C_Interface::m_i2cPath
protected

Definition at line 49 of file I2CInterface.h.

Referenced by I2C_Interface().

◆ m_lastProcessedEventTs

int64_t apra::I2C_Interface::m_lastProcessedEventTs
protected

Definition at line 54 of file I2CInterface.h.

Referenced by processEvents(), processMessage(), and processSingleEvent().

◆ m_processedEvents

vector<uint64_t> apra::I2C_Interface::m_processedEvents
protected

Definition at line 52 of file I2CInterface.h.

Referenced by performTransactionDelay(), processEvents(), and processSingleEvent().

◆ m_processLock

apra::Mutex apra::I2C_Interface::m_processLock
protected

Definition at line 56 of file I2CInterface.h.

Referenced by performCompareRead(), performRead(), performWrite(), and reSetupI2CBus().

◆ m_registeredEvents

map<uint64_t, I2C_Transaction_Message> apra::I2C_Interface::m_registeredEvents
protected

◆ m_setupSuccess

bool apra::I2C_Interface::m_setupSuccess
protected

Definition at line 55 of file I2CInterface.h.

Referenced by I2C_Interface(), isSuccessfullSetup(), process(), and reSetupI2CBus().


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