TOOTHPIC RF Solutions, TOOTHPIC Datasheet - Page 89

MODULE, BLUETOOTH, DATA ACQUISITION

TOOTHPIC

Manufacturer Part Number
TOOTHPIC
Description
MODULE, BLUETOOTH, DATA ACQUISITION
Manufacturer
RF Solutions
Datasheet

Specifications of TOOTHPIC

Svhc
No SVHC (15-Dec-2010)
BMTTxWaitBytes
The BMTTxWaitBytes(i) macro waits until there is space in the transmit buffer to add i characters. It can
be called before BMTTxAdvance to avoid buffer overrun. i must be of type unsigned char – this is a macro
and no type casting is done.
As of ToothPIC 3.0.00005, BMTTxWaitBytes has not been fully implemented and the BMTTransmit macro
only should be used.
BMTReceive
BMTReceive service takes nBytes of serial data from the receive buffer and places them in pRxData. If it
does so successfully, the return value is True. If the receive buffer does not contain sufficient data nBytes,
it will wait for up to msTimeOut milliseconds for sufficient data. If at the end of that period there is still
insufficient data, BMTReceive will return with the value False, leaving the receive buffer and pRxData
untouched; in addition, if msTimeOut was an odd number, a ERR_RXTIMEOUT error status event will be
generated before returning. If msTimeOut is zero, BMTReceive will not return until sufficient data is in the
buffer.
BMTRxAdvance, BMTRxAdvanceCh
The BMTAdvance macro advances the receive buffer start pointer BMTRxStart by i bytes.
BMTAdvanceCh macro advances the receive buffer start pointer BMTRxStart by 1 byte. They are high-
speed macros and no buffer underrun checks are made. Use the BMTRxWaitBytes macro or BMTRxEmpty
value to test whether there is any data to receive. i must be of type unsigned char – this is a macro and no
type casting is done.
Examples:
BMTRxLoc, BMTRxLoc
The BMTRxLoc(i) macros is a pointer to the memory location of the ith character in the receive buffer after
the start point BMTRxStart, accounting for the fact that the buffer is circular. i must be of type unsigned
char – this is a macro and no type casting is done.
BMTRxLoc / BMTRxCh and BMTRxAdvance / BMTRxAdvanceCh provide a memory- and time-efficient way of
reading and discarding data in the buffer. They are high-speed macros and no buffer underrun checks are
made. Use the BMTRxWaitBytes macro or BMTRxEmpty value to test whether there is any data to receive.
i is zero-based, so BMTRxLoc(0) so is the next character to be read from the receive buffer.
Page 89
void BMTTxWaitBytes( unsigned char i )
Bool BMTReceive(
BMTRxAdvance( unsigned char i )
BMTRxAdvanceCh
if (!BMTRxEmpty)
{
}
unsigned char * BMTRxLoc( unsigned char i )
9-Apr-06
char ch;
ch = *BMTRxCh;
BMTRxAdvanceCh;
Toothpick 3.0.00007
unsigned char *pRxData, unsigned char nBytes,
unsigned char msTimeOut )
DS380-8
© FlexiPanel Ltd
// Fetch a character
Patents apply and/or pending
www.FlexiPanel.com
The

Related parts for TOOTHPIC