Exploring BeagleBone  V1.0
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes
exploringBB::BusDevice Class Referenceabstract

This class is the parent of I2C and SPI devices, so that devices that use both SPI and I2C interfaces can use those interfaces interchangeably. Because it contains abstract methods, the child classes MUST implement the methods that are listed in this class. More...

#include <BusDevice.h>

Inheritance diagram for exploringBB::BusDevice:
Inheritance graph
[legend]

Public Member Functions

 BusDevice (unsigned int bus, unsigned int device)
 
virtual int open ()=0
 
virtual unsigned char readRegister (unsigned int registerAddress)=0
 
virtual unsigned char * readRegisters (unsigned int number, unsigned int fromAddress=0)=0
 
virtual int write (unsigned char value)=0
 
virtual int writeRegister (unsigned int registerAddress, unsigned char value)=0
 
virtual void debugDumpRegisters (unsigned int number=0xff)=0
 
virtual void close ()=0
 
virtual ~BusDevice ()
 

Protected Attributes

unsigned int bus
 
unsigned int device
 
int file
 

Detailed Description

This class is the parent of I2C and SPI devices, so that devices that use both SPI and I2C interfaces can use those interfaces interchangeably. Because it contains abstract methods, the child classes MUST implement the methods that are listed in this class.

Constructor & Destructor Documentation

exploringBB::BusDevice::BusDevice ( unsigned int  bus,
unsigned int  device 
)

Constructor for a generic bus device

Parameters
busthe bus number
devicethe device number
34  {
35  this->bus = bus;
36  this->device = device;
37  this->file=-1;
38 }
int file
Definition: BusDevice.h:41
unsigned int bus
Definition: BusDevice.h:39
unsigned int device
Definition: BusDevice.h:40
exploringBB::BusDevice::~BusDevice ( )
virtual

Destructor is unused

43 {}

Member Function Documentation

virtual void exploringBB::BusDevice::close ( )
pure virtual
virtual void exploringBB::BusDevice::debugDumpRegisters ( unsigned int  number = 0xff)
pure virtual
virtual int exploringBB::BusDevice::open ( )
pure virtual
virtual unsigned char exploringBB::BusDevice::readRegister ( unsigned int  registerAddress)
pure virtual
virtual unsigned char* exploringBB::BusDevice::readRegisters ( unsigned int  number,
unsigned int  fromAddress = 0 
)
pure virtual
virtual int exploringBB::BusDevice::write ( unsigned char  value)
pure virtual
virtual int exploringBB::BusDevice::writeRegister ( unsigned int  registerAddress,
unsigned char  value 
)
pure virtual

Field Documentation

unsigned int exploringBB::BusDevice::bus
protected

the bus number

unsigned int exploringBB::BusDevice::device
protected

the device number on the bus

int exploringBB::BusDevice::file
protected

the file handle to the device


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