IQRF SPI library for Arduino  Version 1.2
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
iqrf_library.h File Reference
#include <Arduino.h>
#include <stddef.h>
#include <stdint.h>
#include "CallbackFunctions.h"
#include "IQRF.h"
#include "IQRFBuffers.h"
#include "IQRFCallbacks.h"
#include "IQRFCRC.h"
#include "IQRFPackets.h"
#include "IQRFSettings.h"
#include "IQRFSPI.h"
#include "IQRFTR.h"
#include "IQSPI.h"
Include dependency graph for iqrf_library.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  trInfo_t
 
struct  packetBuffer_t
 

Functions

void IQRF_Init (IQRFCallbacks::rxCallback_t rxCallback, IQRFCallbacks::txCallback_t txCallback)
 
void IQRF_Driver ()
 
void IQRF_GetRxData (uint8_t *dataBuffer, uint8_t dataLength)
 
uint8_t TR_SendSpiPacket (uint8_t spiCmd, uint8_t *dataBuffer, uint8_t dataLength, uint8_t unallocationFlag)
 
void trIdentify ()
 

Variables

uint8_t dataLength
 Data length.
 
trInfo_t trInfo
 TR info structure.
 

Detailed Description

Author
Rostislav Špinar rosti.nosp@m.slav.nosp@m..spin.nosp@m.ar@m.nosp@m.icror.nosp@m.isc..nosp@m.com
Roman Ondráček ondra.nosp@m.cek..nosp@m.roman.nosp@m.@cen.nosp@m.trum..nosp@m.cz
Version
1.1

Copyright 2015-2016 MICRORISC s.r.o.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

void IQRF_Driver ( )

Periodically called IQRF_Driver

void IQRF_GetRxData ( 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
void IQRF_Init ( 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
uint8_t TR_SendSpiPacket ( uint8_t  spiCmd,
uint8_t *  dataBuffer,
uint8_t  dataLength,
uint8_t  unallocationFlag 
)

Prepare SPI packet to packet buffer

Parameters
spiCmdCommand that I want to send to TR module
dataBufferPointer to a buffer that contains data that I want to send to TR module
dataLengthNumber of bytes to send
unallocationFlagIf the dataBuffer 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
Packet ID
void trIdentify ( )

Process identification data packet from TR module