Jump to main content

# 1.1.3.1 How the Library Works

The RF215 driver library is a multi-client, single-instance based driver interface.

## Abstraction Model

The RF215 driver library communicates with a RF215 transceiver using an SPI port, DMA and the GPIO controller.

The library offers the necessary functions to control the transceiver, which include:

- Library initialization
- Transmitting and Receiving RF messages
- Accessing PHY Information Base (PIB) to get/set configuration parameters

The client can be:

- Application: Directly access the external RF device (AT86RF215/AT86RF215M) using the API provided by the RF215 driver library
- G3/PRIME PAL layer: Application can run a PLC-RF hybrid communication stack (G3/PRIME) by connecting it to the PHY Abstraction Layer (PAL) which can further be connected to the RF215 driver

## Working Flow

The RF215 driver library's state machine is driven from interrupt context. This means the library API is non-blocking.

The RF215 device notifies events by the external interrupt pin. The driver library automatically read the events from GPIO interrupt.

The driver library also takes advantage of DMA and never waits for a SPI transfer to finish. Therefore, freeing the CPU for another tasks.

### Driver Initialization and Instance Opening

First of all, the driver has to be initialized by calling DRV_RF215_Initialize to get a valid system object handle. After that, the RF215 device initialization will start. The status of the initialization can be checked by calling DRV_RF215_Status. Once the initialization is finished, a client can open the driver by calling DRV_RF215_Open. At this point the RF215 driver is ready to operate and the client can register callbacks using DRV_RF215_RxIndCallbackRegister and DRV_RF215_TxCfmCallbackRegister.

### Message Transmission and Reception

A message can be transmitted by calling DRV_RF215_TxRequest. The result of the transmission is notified through callback (if registered by the client), which is called from DRV_RF215_Tasks.

If a new message is received, it is notified through callback (if registered by the client), which is called from DRV_RF215_Tasks.

### PIB Management

Configuration parameters can be get by DRV_RF215_GetPib and set by DRV_RF215_SetPib.

Rev: G