1. Introduction

1.1. Before You Start


Before you start you need to:

  • Install the latest SmartSnippets Studio
  • Download the latest SDK for the DA1468x platforms

These can be downloaded from the Dialog Semiconductor support portal.

Additionally, for this tutorial either a Pro or Basic Development kit is required.

The key goals of this tutorial are to:

  • Provide a basic understanding of Adapters concept
  • Explain the different settings of Flash Adapters
  • Give a complete sample project demonstrating the usage of Flash Adapters

1.2. Adapters Concept

The DA1468x family of devices supports several peripherals on different interfaces. To support them, the SmartSnippets™ DA1468x SDK provides Low Level Drivers (LLDs) as well as adapters for each of the available peripherals. Both of these elements add an abstraction layer on top of the hardware functions, allowing a more intuitive approach for using the hardware peripheral. This makes software porting easier.

Low Level Drivers (LLDs)

  • Provide simple HW abstraction (register addresses, access functions, and so on)
  • Are not aware of operating system
  • Add zero overhead to the application
  • Avoid race conditions when using HW

Adapters

  • Applications consist of more than one task
  • Two or more tasks will need the same resource
  • Adapters make sure access to the resources is managed
'Adapters Communication'

Fig. 1 Adapters Communication

Adapters provided by SmartSnippets facilitate requests for a specific driver or resource. To achieve this, they utilize mechanisms offered by the OS such as semaphores and events, as well as the resource management API that facilitates multiple simultaneous resource acquisitions/releases. We do not need to worry about the internal structure of the adapters since this is out of the scope of this tutorial. Other advantages of adapters are that:

  • Synchronous writing/reading operations, block the calling freeRTOS task while the operation is performed using Semaphores rather than relying on a polling loop approach. This means that while the hardware is busy transferring data, the Operating System (OS) scheduler may select another task for execution, thus utilizing processor time more efficiently. After the transfer finishes, the calling freeRTOS task is released and resumes its execution.
  • They ensure that system does not interrupt any current activity. Using adapters, the Power Manager (PM) is aware of the specific peripheral/resource (for example, UART or SPI) and before the system enters sleep, the PM checks whether there is activity on that specific peripheral or not.

Note

Adapters are not implemented as separate tasks and should be considered as an additional layer between the application and the LLDs. It is recommended to use adapters for accessing a hardware block.