nrf24l01p_ng_params.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Otto-von-Guericke-Universität Magdeburg
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
9 #pragma once
10 
21 #include "board.h"
22 #include "periph/gpio.h"
23 #include "periph/spi.h"
24 #include "kernel_defines.h"
25 #include "nrf24l01p_ng_constants.h"
26 #include "nrf24l01p_ng.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #ifndef NRF24L01P_NG_PARAM_SPI
36 #define NRF24L01P_NG_PARAM_SPI SPI_DEV(0)
37 #endif
38 
39 #ifndef NRF24L01P_NG_PARAM_SPI_CLK
43 #define NRF24L01P_NG_PARAM_SPI_CLK SPI_CLK_5MHZ
44 #endif
45 
46 #ifndef NRF24L01P_NG_PARAM_CS
50 #define NRF24L01P_NG_PARAM_CS GPIO_UNDEF
51 #endif
52 
53 #ifndef NRF24L01P_NG_PARAM_CE
57 #define NRF24L01P_NG_PARAM_CE GPIO_UNDEF
58 #endif
59 
60 #ifndef NRF24L01P_NG_PARAM_IRQ
64 #define NRF24L01P_NG_PARAM_IRQ GPIO_UNDEF
65 #endif
66 
67 #ifndef NRF24L01P_NG_PARAM_CRC_LEN
72 #define NRF24L01P_NG_PARAM_CRC_LEN (NRF24L01P_NG_CRC_2BYTE)
73 #endif
74 
75 #ifndef NRF24L01P_NG_PARAM_TX_POWER
80 #define NRF24L01P_NG_PARAM_TX_POWER (NRF24L01P_NG_TX_POWER_0DBM)
81 #endif
82 
83 #ifndef NRF24L01P_NG_PARAM_DATA_RATE_LVL
88 #define NRF24L01P_NG_PARAM_DATA_RATE (NRF24L01P_NG_RF_DR_2MBPS)
89 #endif
90 
91 #ifndef NRF24L01P_NG_PARAM_CHANNEL
95 #define NRF24L01P_NG_PARAM_CHANNEL (4)
96 #endif
97 
98 #ifndef NRF24L01P_NG_PARAM_MAX_RETRANSM
102 #define NRF24L01P_NG_PARAM_MAX_RETRANSM (5)
103 #endif
104 
105 #ifndef NRF24L01P_NG_PARAM_RETRANSM_DELAY
110 #define NRF24L01P_NG_PARAM_RETRANSM_DELAY (NRF24L01P_NG_ARD_2750US)
111 #endif
112 
113 #ifndef NRF24L01P_NG_PARAMS
117 #define NRF24L01P_NG_PARAMS { \
118  .spi = NRF24L01P_NG_PARAM_SPI, \
119  .spi_clk = NRF24L01P_NG_PARAM_SPI_CLK, \
120  .pin_cs = NRF24L01P_NG_PARAM_CS, \
121  .pin_ce = NRF24L01P_NG_PARAM_CE, \
122  .pin_irq = NRF24L01P_NG_PARAM_IRQ, \
123  .config = { \
124  .cfg_crc = NRF24L01P_NG_PARAM_CRC_LEN, \
125  .cfg_tx_power = NRF24L01P_NG_PARAM_TX_POWER, \
126  .cfg_data_rate = NRF24L01P_NG_PARAM_DATA_RATE, \
127  .cfg_channel = NRF24L01P_NG_PARAM_CHANNEL, \
128  .cfg_max_retr = NRF24L01P_NG_PARAM_MAX_RETRANSM, \
129  .cfg_retr_delay = NRF24L01P_NG_PARAM_RETRANSM_DELAY, \
130  } \
131 }
132 #endif
133 
139 };
140 
144 #define NRF24L01P_NG_NUM ARRAY_SIZE(nrf24l01p_ng_params)
145 
146 #ifdef __cplusplus
147 }
148 #endif
149 
Low-level GPIO peripheral driver interface definitions.
Common macros and compiler attributes/pragmas configuration.
Public interface for NRF24L01+ (NG) devices.
Constants from the datasheet of the NRF24L01+ (NG) transceiver.
#define NRF24L01P_NG_PARAMS
Default NRF24L01+ device parameters.
static const nrf24l01p_ng_params_t nrf24l01p_ng_params[]
Static array that holds NRF24L01+ device configurations.
Low-level SPI peripheral driver interface definition.
Struct of NRF24L01+ initialization parameters.
Definition: nrf24l01p_ng.h:131