I am no longer actively working on the ppCANOpen library, however, I want to publish this project so that anyone who wants to pick up any of the pieces can have a good example. This is a a project I was working on using the ppCANOpen library. It has a pretty in deep use of the object dictionary structure. And a number of functions to control high voltage pinball drivers, if you're into that sort of thing.

Dependencies:   CANnucleo mbed ppCANOpen

Embed: (wiki syntax)

« Back to documentation index

SerialBuffered Class Reference

SerialBuffered Class Reference

Buffered serial class. More...

#include <SerialBuffered.h>

Public Member Functions

 SerialBuffered (PinName tx, PinName rx)
 Create a buffered serial class.
virtual ~SerialBuffered ()
 Destroy.
int getc ()
 Get a character.
int readable ()
 Returns 1 if there is a character available to read, 0 otherwise.
void setTimeout (int ms)
 Set timeout for getc().
size_t readBytes (uint8_t *bytes, size_t requested)
 Read requested bytes.

Detailed Description

Buffered serial class.

Definition at line 7 of file SerialBuffered.h.


Constructor & Destructor Documentation

SerialBuffered ( PinName  tx,
PinName  rx 
)

Create a buffered serial class.

Parameters:
txA pin for transmit.
rxA pin for receive.

Definition at line 10 of file SerialBuffered.cpp.

~SerialBuffered (  ) [virtual]

Destroy.

Definition at line 20 of file SerialBuffered.cpp.


Member Function Documentation

int getc (  )

Get a character.

Returns:
A character. (-1:timeout)

Definition at line 58 of file SerialBuffered.cpp.

int readable (  )

Returns 1 if there is a character available to read, 0 otherwise.

Definition at line 82 of file SerialBuffered.cpp.

size_t readBytes ( uint8_t *  bytes,
size_t  requested 
)

Read requested bytes.

Parameters:
bytesA pointer to a buffer.
requestedLength.
Returns:
Readed byte length.

Definition at line 40 of file SerialBuffered.cpp.

void setTimeout ( int  ms )

Set timeout for getc().

Parameters:
msmilliseconds. (-1:Disable timeout)

Definition at line 28 of file SerialBuffered.cpp.