IQRF SPI library for Arduino
Version 1.2
|
#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"
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. | |
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.
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
dataBuffer | Pointer to my buffer, to which I want to load data received from the TR module |
dataLength | Number 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
rxCallback | Pointer to callback function. Function is called when the driver receives data from the TR module |
txCallback | Pointer 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
spiCmd | Command that I want to send to TR module |
dataBuffer | Pointer to a buffer that contains data that I want to send to TR module |
dataLength | Number of bytes to send |
unallocationFlag | If 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. |
void trIdentify | ( | ) |
Process identification data packet from TR module