ArmSys Support
ArmsysApi  0.12.18

#include <BCan.h>

Inheritance diagram for BCan:
BComms

Public Member Functions

 BCan (BUInt fifoSize=64)
 
BError init (BUInt8 dev, BUInt speed=125000, bool loopback=0)
 Initialise device: 1 to 2. More...
 
Bool packetMode ()
 Device is in packet mode. More...
 
BUInt writeAvailable ()
 Check if can write, returns 0 or 1. More...
 
BError write (const void *data, BUInt32 nBytes, BUInt32 &nTrans)
 Write nBytes, will wait for hardware. More...
 
BUInt readAvailable ()
 Check if data is available, returns 0 or 1. More...
 
BError read (void *data, BUInt32 nBytes, BUInt32 &nTrans)
 Read nBytes, will wait for hardware. More...
 
BError sendCanPacket (Bool extId, BUInt id, const BUInt8 *data, BUInt nBytes)
 
BError recvCanPacket (Bool &extId, BUInt &id, BUInt8 *data, BUInt &nBytes)
 
void interrupt ()
 
void debugPrint ()
 
- Public Member Functions inherited from BComms
 BComms ()
 
virtual ~BComms ()
 
virtual BError init ()
 
virtual void close ()
 
virtual const char * name ()
 The name of this interface. More...
 
virtual BUInt32 byteRate ()
 The byte rate of this interface. More...
 
virtual BError setPacketMode (Bool packetMode)
 Set packet mode. More...
 
virtual BError setTimeout (BTimeout timeoutUs)
 Set communication timeout. More...
 
virtual BError connect (const char *resource)
 Create a connection. More...
 
virtual Bool isConnected ()
 
virtual BError disconnect ()
 Disconnect. More...
 
virtual void flush (Flush flush)
 
virtual BError writeChunks (const BDataChunk *chunks, BUInt nChunks, BUInt32 &nTrans)
 
virtual BError wait (BUInt32 eventSet, BTimeout timeoutUs=BTimeoutForever, BUInt32 num=1)
 
virtual void eventQueue (BEventQueue *eventQueue, BUInt32 event, BUInt32 eventSet, BUInt num=1)
 
virtual void eventEnable (Bool on)
 Enable events to be sent. More...
 

Protected Attributes

BCanPacketFifo orxFifoCmd
 
BCanPacketFifo orxFifoReply
 
int odev
 
CAN_TypeDef * ocan
 
- Protected Attributes inherited from BComms
Bool oconnected
 
Bool opacketMode
 
BTimeout otimeout
 
BEventQueueoeventQueue
 
Bool oeventEnabled
 
BUInt32 oevent
 
BUInt32 oeventSet
 
BUInt oeventNum
 

Additional Inherited Members

- Public Types inherited from BComms
enum  Flush { FlushRead, FlushWrite, FlushReadWrite }
 

Constructor & Destructor Documentation

◆ BCan()

BCan::BCan ( BUInt  fifoSize = 64)

Member Function Documentation

◆ debugPrint()

void BCan::debugPrint ( )

◆ init()

BError BCan::init ( BUInt8  dev,
BUInt  speed = 125000,
bool  loopback = 0 
)

Initialise device: 1 to 2.

◆ interrupt()

void BCan::interrupt ( )

◆ packetMode()

Bool BCan::packetMode ( )
virtual

Device is in packet mode.

Reimplemented from BComms.

◆ read()

BError BCan::read ( void *  data,
BUInt32  nBytes,
BUInt32 nTrans 
)
virtual

Read nBytes, will wait for hardware.

Implements BComms.

◆ readAvailable()

BUInt BCan::readAvailable ( )
virtual

Check if data is available, returns 0 or 1.

Reimplemented from BComms.

◆ recvCanPacket()

BError BCan::recvCanPacket ( Bool extId,
BUInt id,
BUInt8 data,
BUInt nBytes 
)

◆ sendCanPacket()

BError BCan::sendCanPacket ( Bool  extId,
BUInt  id,
const BUInt8 data,
BUInt  nBytes 
)

◆ write()

BError BCan::write ( const void *  data,
BUInt32  nBytes,
BUInt32 nTrans 
)
virtual

Write nBytes, will wait for hardware.

Implements BComms.

◆ writeAvailable()

BUInt BCan::writeAvailable ( )
virtual

Check if can write, returns 0 or 1.

Reimplemented from BComms.

Member Data Documentation

◆ ocan

CAN_TypeDef* BCan::ocan
protected

◆ odev

int BCan::odev
protected

◆ orxFifoCmd

BCanPacketFifo BCan::orxFifoCmd
protected

◆ orxFifoReply

BCanPacketFifo BCan::orxFifoReply
protected

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