LinkSprite LS-Y201 JPEG Color Camera.

Dependents:   Camera_LS_Y201_TestProgram Camera_LS_Y201_TestProgram ServoCamV1 RFIDdoor ... more

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 35 of file SerialBuffered.h.


Constructor & Destructor Documentation

SerialBuffered ( PinName  tx,
PinName  rx 
)

Create a buffered serial class.

============================================================================= LS-Y201 device driver class (Version 0.0.1) Reference documents: LinkSprite JPEG Color Camera Serial UART Interface January 2010 ============================================================================= Copyright (c) 2010 Shinichiro Nakamura (CuBeatSystems)

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

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ============================================================================= Create a buffered serial class.

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

Definition at line 38 of file SerialBuffered.cpp.

~SerialBuffered (  ) [virtual]

Destroy.

Definition at line 48 of file SerialBuffered.cpp.


Member Function Documentation

int getc (  )

Get a character.

Returns:
A character. (-1:timeout)

Definition at line 86 of file SerialBuffered.cpp.

int readable (  )

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

Definition at line 110 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 68 of file SerialBuffered.cpp.

void setTimeout ( int  ms )

Set timeout for getc().

Parameters:
msmilliseconds. (-1:Disable timeout)

Definition at line 56 of file SerialBuffered.cpp.