-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnrf_userconfig.h
78 lines (65 loc) · 2.41 KB
/
nrf_userconfig.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/* nrf_userconfig.h
* User configuration of nRF24L01+ connectivity parameters, e.g.
* IRQ, CSN, CE pin assignments, Serial SPI driver type
*
*
* Copyright (c) 2012, Eric Brundick <[email protected]>
*
* Permission to use, copy, modify, and/or distribute this software for any purpose
* with or without fee is hereby granted, provided that the above copyright notice
* and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
* OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _NRF_USERCONFIG_H
#define _NRF_USERCONFIG_H
/* CPU clock cycles for the specified amounts of time--accurate minimum delays
* required for reliable operation of the nRF24L01+'s state machine.
*/
/* Settings for 1MHz MCLK.
#define DELAY_CYCLES_5MS 5000
#define DELAY_CYCLES_130US 130
#define DELAY_CYCLES_15US 15
*/
/* Settings for 8MHz MCLK.
#define DELAY_CYCLES_5MS 40000
#define DELAY_CYCLES_130US 1040
#define DELAY_CYCLES_15US 120
*/
/* Settings for 16MHz MCLK */
#define DELAY_CYCLES_5MS 80000
#define DELAY_CYCLES_130US 2080
#define DELAY_CYCLES_15US 240
/* Settings for 24MHz MCLK.
#define DELAY_CYCLES_5MS 120000
#define DELAY_CYCLES_130US 3120
#define DELAY_CYCLES_15US 360
*/
/* SPI port--Select which USCI port we're using.
* Applies only to USCI devices. USI users can keep these
* commented out.
*/
//#define RF24_SPI_DRIVER_USCI_A 1
#define RF24_SPI_DRIVER_USCI_B 1
/* Define whether this library should use LPM0+IRQs during SPI I/O and whether this library should provide the ISR. */
#define RF24_SPI_DRIVER_USCI_USE_IRQ 1
#define RF24_SPI_DRIVER_USCI_PROVIDE_ISR 1
/* Operational pins -- IRQ, CE, CSN (SPI chip-select)
*/
/* IRQ */
#define nrfIRQport 2
#define nrfIRQpin BIT2
/* CSN SPI chip-select */
#define nrfCSNport 2
#define nrfCSNportout P2OUT
#define nrfCSNpin BIT1
/* CE Chip-Enable (used to put RF transceiver on-air for RX or TX) */
#define nrfCEport 2
#define nrfCEportout P2OUT
#define nrfCEpin BIT0
#endif