Exploring BeagleBone
V1.0
|
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>
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 |
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.
exploringBB::BusDevice::BusDevice | ( | unsigned int | bus, |
unsigned int | device | ||
) |
Constructor for a generic bus device
bus | the bus number |
device | the device number |
|
pure virtual |
Implemented in exploringBB::SPIDevice, and exploringBB::I2CDevice.
|
pure virtual |
Implemented in exploringBB::SPIDevice, and exploringBB::I2CDevice.
|
pure virtual |
Implemented in exploringBB::SPIDevice, and exploringBB::I2CDevice.
|
pure virtual |
Implemented in exploringBB::SPIDevice, and exploringBB::I2CDevice.
|
pure virtual |
Implemented in exploringBB::SPIDevice, and exploringBB::I2CDevice.
|
pure virtual |
Implemented in exploringBB::SPIDevice, and exploringBB::I2CDevice.
|
pure virtual |
Implemented in exploringBB::SPIDevice, and exploringBB::I2CDevice.
|
protected |
the bus number
|
protected |
the device number on the bus
|
protected |
the file handle to the device