1/** 2@mainpage Introduction and configuration 3 4nrfx is a standalone set of drivers for peripherals present in Nordic 5Semiconductor's SoCs. It originated as an extract from the nRF5 SDK. 6The intention was to provide drivers that can be used in various environments 7without the necessity to integrate other parts of the SDK into them. 8For the user's convenience, the drivers come with the MDK package. This package 9contains definitions of register structures and bitfields for all supported 10SoCs, as well as startup and initialization files for them. 11 12Refer to the @ref nrfx_drv_supp_matrix to check which drivers are suitable 13for a given SoC. 14 15@section nrfx_integration Integration 16 17The purpose of nrfx is to make it possible to use the same set of peripheral 18drivers in various environments, from RTOSes to bare metal applications. 19Hence, for a given host environment, a light integration layer must be provided 20that implements certain specific routines, like interrupt management, critical 21sections, assertions, or logging. This is done by filling a predefined set of 22macros with proper implementations (or keeping some empty if desired) in files 23named: 24- @ref nrfx_glue 25- @ref nrfx_log 26 27Templates of these files are provided 28in the <a href="../../templates/">templates</a> subfolder. Their customized 29versions can be placed in any location within the host environment that the 30used compiler can access via include paths. 31 32In addition, the following locations should be specified as include paths 33([nrfx] stands for the nrfx root folder location): 34@code 35[nrfx]/ 36[nrfx]/drivers/include 37[nrfx]/mdk 38@endcode 39 40@section nrfx_irq_handlers IRQ handlers 41 42The IRQ handlers in all drivers are implemented as ordinary API functions 43named "nrfx_*_irq_handler". They can be bound to some structures or called in 44a specific way according to the requirements of the host environment. 45To install the handlers in the standard MDK way, you must only add the following 46line to the @ref nrfx_glue file: 47 48@code 49#include <soc/nrfx_irqs.h> 50@endcode 51 52This will cause the preprocessor to properly rename all the IRQ handler 53functions so that the linker could install them in the vector table. 54 55@section nrfx_configuration Configuration 56 57The drivers use both dynamic (run time) and static (compile time) configuration. 58 59Dynamic configuration is done by specifying desired options in configuration 60structures passed to the drivers during their initialization. 61Refer to the API reference for a given driver to see the members of its 62configuration structure. 63 64Static configuration allows enabling and disabling (excluding their code from 65compilation) particular drivers or in some cases their specific features, 66defining default parameters for dynamic configuration, parametrization of 67logging in particular drivers. It is done by specifying desired values of macros 68in a file named: 69 70- nrfx_config.h 71 72This file, similarly to the integration files mentioned above, can be placed 73in any suitable location within the host environment. 74The <a href="../../templates/">templates</a> subfolder contains templates of 75configuration files for all currently supported Nordic SoCs. These files are 76included through a common nrfx_config.h file, according to the selected SoC. 77Refer to the "driver configuration" section in the API reference for a given 78driver for more information regarding configuration options available for it. 79 80@section nrfx_additional_reqs Additional requirements 81 82Nordic SoCs are based on ARM® Cortex™-M series processors. Before you can 83start developing with nrfx, you must add the CMSIS header files to include 84paths during the compilation process. Download these files from the following 85website: 86 87- <a href="https://github.com/ARM-software/CMSIS"> ARM® CMSIS repository</a> 88(CMSIS/Include directory) 89*/ 90