EVE 1.0
IQRF module driver
Collaboration diagram for IQRF module driver:

Data Structures

struct  iqrf_dpa_header_t
 
struct  iqrf_dpa_request_t
 
struct  iqrf_dpa_confirmation_t
 
struct  iqrf_dpa_response_t
 
struct  iqrf_dpa_broadcast_t
 
struct  iqrf_global_handlers_t
 
struct  iqrf_state_t
 
struct  iqrf_t
 IQRF instance structure. More...
 

Macros

#define IQRF_PNUM_BRIDGE   (0x30)
 Custom periferal number for Bridge.
 
#define IQRF_SPI_BUFFER_LENGTH   (68)
 SPI buffer length (max IQRF packet size + 4)
 
#define IQRF_RESPONSE_TIMESLOT_LENGTH_WORST_ESTIMATE   (5)
 Worst estimate for response timeslot length in 10 ms. intervals.
 
#define IQRF_INVALID_TIMESTAMP   (0xFFFFFFFF)
 Value used as an invalid timestamp value.
 

Typedefs

typedef void(* iqrf_response_handler_t) (const struct iqrf_t *Iqrf, enum iqrf_response_type_t Type, const struct iqrf_dpa_response_t *Dpa, uint8_t Length)
 

Enumerations

Functions

void IqrfInterruptCb (const struct iqrf_t *Iqrf)
 
void IqrfInit (const struct iqrf_t *Iqrf)
 
bool IqrfIsBusy (const struct iqrf_t *Iqrf)
 
bool IqrfSendDpaRequest (const struct iqrf_t *Iqrf, iqrf_response_handler_t ResponseHandler, const struct iqrf_dpa_request_t *Request, uint8_t DataLen)
 
bool IqrfSendDpaResponse (const struct iqrf_t *Iqrf, const uint8_t *Data, uint8_t DataLen)
 
bool IqrfSendDpaError (const struct iqrf_t *Iqrf, uint8_t ErrorCode)
 
bool IqrfSendFrcResponse (const struct iqrf_t *Iqrf, uint16_t Status)
 
uint32_t IqrfGetExpectedRoutingTime (uint8_t HopsRequest, uint8_t TimeslotRequest, uint8_t HopsResponse, uint8_t TimeslotResponse)
 
uint32_t IqrfGetExpectedRoutingCompleteTimestamp (const struct iqrf_t *Iqrf)
 

Detailed Description

Typedef Documentation

typedef void(* iqrf_response_handler_t) (const struct iqrf_t *Iqrf, enum iqrf_response_type_t Type, const struct iqrf_dpa_response_t *Dpa, uint8_t Length)

Per-request handler (callback), which receives notification about the request lifecycle

Parameters
IqrfIQRF instance
TypeType of notification
DpaPointer to the DPA response structure. It can contain iqrf_dpa_confirmation_t as well.
LengthLength of the data in the DPA response.

Definition at line 166 of file iqrf.h.

Enumeration Type Documentation

Possible response types

Enumerator
IQRF_TYPE_CONFIRMATION 

DPA Confirmation.

IQRF_TYPE_RESPONSE 

DPA Response.

IQRF_TYPE_ERROR 

DPA error.

IQRF_TYPE_TIMEOUT 

Timeout.

Definition at line 76 of file iqrf.h.

Function Documentation

void IqrfInterruptCb ( const struct iqrf_t Iqrf)

IQRF interrupt handler

Parameters
IqrfIQRF instance
void IqrfInit ( const struct iqrf_t Iqrf)

Init an IQRF driver instance

Parameters
IqrfIQRF instance
bool IqrfIsBusy ( const struct iqrf_t Iqrf)

Checks if an IQRF driver is busy

Parameters
IqrfIQRF instance
Returns
true if the instance is busy, false if IqrfSendDpaRequest can be called.
bool IqrfSendDpaRequest ( const struct iqrf_t Iqrf,
iqrf_response_handler_t  ResponseHandler,
const struct iqrf_dpa_request_t Request,
uint8_t  DataLen 
)

Send a DPA request to the IQRF module

Parameters
IqrfIQRF instance
ResponseHandlerA handler (callback), which receives notification about the request lifecycle
RequestDPA request
DataLenLength of data field in the DPA request
Returns
true if the request was sent to the IQRF, false in case of any error
bool IqrfSendDpaResponse ( const struct iqrf_t Iqrf,
const uint8_t *  Data,
uint8_t  DataLen 
)

Send a response to a DPA request

Parameters
IqrfIQRF instance
DataDPA response data
DataLenLength of the DPA response data
Returns
true if the response was sent to the IQRF, false in case of any error
bool IqrfSendDpaError ( const struct iqrf_t Iqrf,
uint8_t  ErrorCode 
)

Send a response with error code

Parameters
IqrfIQRF instance
ErrorCodeError code
Returns
true if the response was sent to the IQRF, false in case of any error
bool IqrfSendFrcResponse ( const struct iqrf_t Iqrf,
uint16_t  Status 
)

Send a response to a FRC request

Parameters
IqrfIQRF instance
StatusFRC status
Returns
true if the response was sent to the IQRF, false in case of any error
uint32_t IqrfGetExpectedRoutingTime ( uint8_t  HopsRequest,
uint8_t  TimeslotRequest,
uint8_t  HopsResponse,
uint8_t  TimeslotResponse 
)

Get time in system ticks required to complete a routing with the given parameters

Parameters
HopsRequestHopsRequest field of the confirmation message
TimeslotRequestTimeslotRequest field of the confirmation message
HopsResponseHopsResponse field of the confirmation message
TimeslotResponseExpected duration of the response message, number of timeslots
Returns
Expected routing time in system tick intervals
uint32_t IqrfGetExpectedRoutingCompleteTimestamp ( const struct iqrf_t Iqrf)

Get point in time when routing is going to be completed.

Parameters
IqrfIQRF instance
Returns
System time when routing is expected to be completed. IQRF_INVALID_TIMESTAMP if no routing is in progress.