IQRF SPI library for Arduino  Version 1.2
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
IQRF Class Reference

#include <IQRF.h>

Public Member Functions

void begin (IQRFCallbacks::rxCallback_t rxCallback, IQRFCallbacks::txCallback_t txCallback)
 
void driver ()
 
uint8_t getDataLength ()
 
void getData (uint8_t *dataBuffer, uint8_t dataLength)
 
uint8_t sendData (uint8_t *dataBuffer, uint8_t dataLength, uint8_t unallocationFlag)
 
void setPTYPE (uint8_t PTYPE)
 
uint8_t getPTYPE ()
 
void setAttepmtsCount (uint8_t attepmts)
 
uint8_t getAttepmtsCount ()
 
void setByteCount (uint8_t count)
 
uint8_t getByteCount ()
 
void setUsCount0 (unsigned long us)
 
unsigned long getUsCount0 ()
 
void setUsCount1 (unsigned long us)
 
unsigned long getUsCount1 ()
 

Detailed Description

Member Function Documentation

void IQRF::begin ( IQRFCallbacks::rxCallback_t  rxCallback,
IQRFCallbacks::txCallback_t  txCallback 
)

Function perform a TR-module driver initialization Function performes initialization of trInfo identification data structure

Parameters
rxCallbackPointer to callback function. Function is called when the driver receives data from the TR module
txCallbackPointer to callback function. unction is called when the driver sent data to the TR module
Examples:
Get-info.ino, and Hello-world.ino.
void IQRF::driver ( )

Periodically called IQRF_Driver

Examples:
Get-info.ino, and Hello-world.ino.
uint8_t IQRF::getAttepmtsCount ( )

Get count of attepmts to send data

Returns
Count of attepmts to send data
uint8_t IQRF::getByteCount ( )

Get byte count

Returns
Byte count
void IQRF::getData ( uint8_t *  dataBuffer,
uint8_t  dataLength 
)

Function is usually called inside the callback function, whitch is called when the driver receives data from TR module

Parameters
dataBufferPointer to my buffer, to which I want to load data received from the TR module
dataLengthNumber of bytes I want to read
Examples:
Get-info.ino, and Hello-world.ino.
uint8_t IQRF::getDataLength ( )

Get size of Rx data

Returns
Number of bytes recieved from TR module
Examples:
Get-info.ino, and Hello-world.ino.
uint8_t IQRF::getPTYPE ( )

Get PTYPE

Returns
PTYPE
unsigned long IQRF::getUsCount0 ( )

Get count of microseconds form counter

Returns
Count of microseconds
unsigned long IQRF::getUsCount1 ( )

Get count of microseconds form counter

Returns
Count of microseconds
uint8_t IQRF::sendData ( uint8_t *  dataBuffer,
uint8_t  dataLength,
uint8_t  unallocationFlag 
)

Function sends data from buffer to TR module

Parameters
dataBufferPointer to a buffer that contains data that I want to send to TR module
dataLengthNumber of bytes to send
unallocationFlagIf the pDataBuffer is dynamically allocated using malloc function. If you wish to unallocate buffer after data is sent, set the unallocationFlag to 1, otherwise to 0.
Returns
Tx packet ID (number 1-255)
Examples:
Hello-world.ino.
void IQRF::setAttepmtsCount ( uint8_t  attepmts)

Set count of attepmts to send data

Parameters
attepmtsCount of attepmts to send data
void IQRF::setByteCount ( uint8_t  count)

Set byte count

Parameters
countByte count
void IQRF::setPTYPE ( uint8_t  PTYPE)

Set PTYPE

Parameters
PTYPEPTYPE
void IQRF::setUsCount0 ( unsigned long  us)

Set count of microseconds from counter

Parameters
usCount of microseconds
void IQRF::setUsCount1 ( unsigned long  us)

Set count of microseconds from counter

Parameters
usCount of microseconds

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