fd
Dependents: xtoff3 CYS_Receiver
Fork of RF24Network by
RF24Network_config.h@2:a5f8e04bd02b, 2015-11-05 (annotated)
- Committer:
- akashvibhute
- Date:
- Thu Nov 05 05:40:44 2015 +0000
- Revision:
- 2:a5f8e04bd02b
- Parent:
- 0:c3db0798d9aa
- Child:
- 3:dfc8da7ac18c
Updated with TMRh20's RF24 library on Nov/04/2015 from https://github.com/TMRh20; Porting completed on Nov/05/2015
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
akashvibhute | 0:c3db0798d9aa | 1 | |
akashvibhute | 0:c3db0798d9aa | 2 | /* |
akashvibhute | 0:c3db0798d9aa | 3 | Copyright (C) 2011 James Coliz, Jr. <maniacbug@ymail.com> |
akashvibhute | 0:c3db0798d9aa | 4 | |
akashvibhute | 0:c3db0798d9aa | 5 | This program is free software; you can redistribute it and/or |
akashvibhute | 0:c3db0798d9aa | 6 | modify it under the terms of the GNU General Public License |
akashvibhute | 0:c3db0798d9aa | 7 | version 2 as published by the Free Software Foundation. |
akashvibhute | 0:c3db0798d9aa | 8 | */ |
akashvibhute | 0:c3db0798d9aa | 9 | |
akashvibhute | 2:a5f8e04bd02b | 10 | #ifndef __RF24NETWORK_CONFIG_H__ |
akashvibhute | 2:a5f8e04bd02b | 11 | #define __RF24NETWORK_CONFIG_H__ |
akashvibhute | 0:c3db0798d9aa | 12 | |
akashvibhute | 0:c3db0798d9aa | 13 | #include "mbed.h" |
akashvibhute | 0:c3db0798d9aa | 14 | |
akashvibhute | 2:a5f8e04bd02b | 15 | |
akashvibhute | 2:a5f8e04bd02b | 16 | |
akashvibhute | 0:c3db0798d9aa | 17 | #include <stdint.h> |
akashvibhute | 0:c3db0798d9aa | 18 | #include <stdio.h> |
akashvibhute | 0:c3db0798d9aa | 19 | #include <string.h> |
akashvibhute | 0:c3db0798d9aa | 20 | #define _BV(x) (1<<(x)) |
akashvibhute | 0:c3db0798d9aa | 21 | |
akashvibhute | 0:c3db0798d9aa | 22 | |
akashvibhute | 2:a5f8e04bd02b | 23 | |
akashvibhute | 2:a5f8e04bd02b | 24 | |
akashvibhute | 2:a5f8e04bd02b | 25 | |
akashvibhute | 2:a5f8e04bd02b | 26 | |
akashvibhute | 2:a5f8e04bd02b | 27 | |
akashvibhute | 2:a5f8e04bd02b | 28 | |
akashvibhute | 2:a5f8e04bd02b | 29 | |
akashvibhute | 2:a5f8e04bd02b | 30 | |
akashvibhute | 2:a5f8e04bd02b | 31 | #include <stddef.h> |
akashvibhute | 2:a5f8e04bd02b | 32 | |
akashvibhute | 2:a5f8e04bd02b | 33 | |
akashvibhute | 2:a5f8e04bd02b | 34 | |
akashvibhute | 2:a5f8e04bd02b | 35 | |
akashvibhute | 2:a5f8e04bd02b | 36 | |
akashvibhute | 2:a5f8e04bd02b | 37 | /********** USER CONFIG - non ATTiny **************/ |
akashvibhute | 2:a5f8e04bd02b | 38 | |
akashvibhute | 2:a5f8e04bd02b | 39 | //#define DUAL_HEAD_RADIO |
akashvibhute | 2:a5f8e04bd02b | 40 | //#define ENABLE_SLEEP_MODE //AVR only |
akashvibhute | 2:a5f8e04bd02b | 41 | #define RF24NetworkMulticast |
akashvibhute | 2:a5f8e04bd02b | 42 | |
akashvibhute | 2:a5f8e04bd02b | 43 | /** \def |
akashvibhute | 2:a5f8e04bd02b | 44 | * Saves memory by disabling fragmentation |
akashvibhute | 2:a5f8e04bd02b | 45 | */ |
akashvibhute | 2:a5f8e04bd02b | 46 | //#define DISABLE_FRAGMENTATION |
akashvibhute | 2:a5f8e04bd02b | 47 | |
akashvibhute | 2:a5f8e04bd02b | 48 | /** System defines */ |
akashvibhute | 2:a5f8e04bd02b | 49 | |
akashvibhute | 2:a5f8e04bd02b | 50 | /** The size of the main buffer. This is the user-cache, where incoming data is stored. |
akashvibhute | 2:a5f8e04bd02b | 51 | * Data is stored using Frames: Header (8-bytes) + Frame_Size (2-bytes) + Data (?-bytes) |
akashvibhute | 2:a5f8e04bd02b | 52 | * |
akashvibhute | 2:a5f8e04bd02b | 53 | * @note The MAX_PAYLOAD_SIZE is (MAIN_BUFFER_SIZE - 10), and the result must be divisible by 24. |
akashvibhute | 2:a5f8e04bd02b | 54 | */ |
akashvibhute | 2:a5f8e04bd02b | 55 | #define MAIN_BUFFER_SIZE 144 + 10 |
akashvibhute | 2:a5f8e04bd02b | 56 | |
akashvibhute | 2:a5f8e04bd02b | 57 | /** Maximum size of fragmented network frames and fragmentation cache. This MUST BE divisible by 24. |
akashvibhute | 2:a5f8e04bd02b | 58 | * @note: Must be a multiple of 24. |
akashvibhute | 2:a5f8e04bd02b | 59 | * @note: If used with RF24Ethernet, this value is used to set the buffer sizes. |
akashvibhute | 2:a5f8e04bd02b | 60 | */ |
akashvibhute | 2:a5f8e04bd02b | 61 | #define MAX_PAYLOAD_SIZE MAIN_BUFFER_SIZE-10 |
akashvibhute | 2:a5f8e04bd02b | 62 | |
akashvibhute | 2:a5f8e04bd02b | 63 | /** Disable user payloads. Saves memory when used with RF24Ethernet or software that uses external data.*/ |
akashvibhute | 2:a5f8e04bd02b | 64 | //#define DISABLE_USER_PAYLOADS |
akashvibhute | 2:a5f8e04bd02b | 65 | |
akashvibhute | 2:a5f8e04bd02b | 66 | /** Enable tracking of success and failures for all transmissions, routed and user initiated */ |
akashvibhute | 2:a5f8e04bd02b | 67 | //#define ENABLE_NETWORK_STATS |
akashvibhute | 2:a5f8e04bd02b | 68 | |
akashvibhute | 2:a5f8e04bd02b | 69 | /** Enable dynamic payloads - If using different types of NRF24L01 modules, some may be incompatible when using this feature **/ |
akashvibhute | 2:a5f8e04bd02b | 70 | #define ENABLE_DYNAMIC_PAYLOADS |
akashvibhute | 2:a5f8e04bd02b | 71 | |
akashvibhute | 2:a5f8e04bd02b | 72 | /** Debug Options */ |
akashvibhute | 2:a5f8e04bd02b | 73 | //#define SERIAL_DEBUG |
akashvibhute | 2:a5f8e04bd02b | 74 | //#define SERIAL_DEBUG_MINIMAL |
akashvibhute | 2:a5f8e04bd02b | 75 | //#define SERIAL_DEBUG_ROUTING |
akashvibhute | 2:a5f8e04bd02b | 76 | //#define SERIAL_DEBUG_FRAGMENTATION |
akashvibhute | 2:a5f8e04bd02b | 77 | //#define SERIAL_DEBUG_FRAGMENTATION_L2 |
akashvibhute | 2:a5f8e04bd02b | 78 | /*************************************/ |
akashvibhute | 2:a5f8e04bd02b | 79 | |
akashvibhute | 2:a5f8e04bd02b | 80 | |
akashvibhute | 2:a5f8e04bd02b | 81 | |
akashvibhute | 2:a5f8e04bd02b | 82 | |
akashvibhute | 2:a5f8e04bd02b | 83 | |
akashvibhute | 2:a5f8e04bd02b | 84 | |
akashvibhute | 2:a5f8e04bd02b | 85 | |
akashvibhute | 2:a5f8e04bd02b | 86 | |
akashvibhute | 2:a5f8e04bd02b | 87 | |
akashvibhute | 2:a5f8e04bd02b | 88 | |
akashvibhute | 2:a5f8e04bd02b | 89 | |
akashvibhute | 2:a5f8e04bd02b | 90 | |
akashvibhute | 2:a5f8e04bd02b | 91 | |
akashvibhute | 2:a5f8e04bd02b | 92 | |
akashvibhute | 2:a5f8e04bd02b | 93 | |
akashvibhute | 2:a5f8e04bd02b | 94 | |
akashvibhute | 2:a5f8e04bd02b | 95 | |
akashvibhute | 2:a5f8e04bd02b | 96 | |
akashvibhute | 2:a5f8e04bd02b | 97 | #ifndef rf24_max |
akashvibhute | 2:a5f8e04bd02b | 98 | #define rf24_max(a,b) (a>b?a:b) |
akashvibhute | 2:a5f8e04bd02b | 99 | #endif |
akashvibhute | 2:a5f8e04bd02b | 100 | #ifndef rf24_min |
akashvibhute | 2:a5f8e04bd02b | 101 | #define rf24_min(a,b) (a<b?a:b) |
akashvibhute | 2:a5f8e04bd02b | 102 | #endif |
akashvibhute | 2:a5f8e04bd02b | 103 | |
akashvibhute | 2:a5f8e04bd02b | 104 | |
akashvibhute | 2:a5f8e04bd02b | 105 | |
akashvibhute | 2:a5f8e04bd02b | 106 | |
akashvibhute | 2:a5f8e04bd02b | 107 | |
akashvibhute | 2:a5f8e04bd02b | 108 | |
akashvibhute | 2:a5f8e04bd02b | 109 | |
akashvibhute | 2:a5f8e04bd02b | 110 | |
akashvibhute | 2:a5f8e04bd02b | 111 | |
akashvibhute | 2:a5f8e04bd02b | 112 | |
akashvibhute | 2:a5f8e04bd02b | 113 | |
akashvibhute | 2:a5f8e04bd02b | 114 | |
akashvibhute | 2:a5f8e04bd02b | 115 | |
akashvibhute | 2:a5f8e04bd02b | 116 | |
akashvibhute | 2:a5f8e04bd02b | 117 | #if defined (SERIAL_DEBUG_MINIMAL) |
akashvibhute | 2:a5f8e04bd02b | 118 | #define IF_SERIAL_DEBUG_MINIMAL(x) ({x;}) |
akashvibhute | 2:a5f8e04bd02b | 119 | #else |
akashvibhute | 2:a5f8e04bd02b | 120 | #define IF_SERIAL_DEBUG_MINIMAL(x) |
akashvibhute | 2:a5f8e04bd02b | 121 | #endif |
akashvibhute | 2:a5f8e04bd02b | 122 | |
akashvibhute | 2:a5f8e04bd02b | 123 | #if defined (SERIAL_DEBUG_FRAGMENTATION) |
akashvibhute | 2:a5f8e04bd02b | 124 | #define IF_SERIAL_DEBUG_FRAGMENTATION(x) ({x;}) |
akashvibhute | 2:a5f8e04bd02b | 125 | #else |
akashvibhute | 2:a5f8e04bd02b | 126 | #define IF_SERIAL_DEBUG_FRAGMENTATION(x) |
akashvibhute | 2:a5f8e04bd02b | 127 | #endif |
akashvibhute | 2:a5f8e04bd02b | 128 | |
akashvibhute | 2:a5f8e04bd02b | 129 | #if defined (SERIAL_DEBUG_FRAGMENTATION_L2) |
akashvibhute | 2:a5f8e04bd02b | 130 | #define IF_SERIAL_DEBUG_FRAGMENTATION_L2(x) ({x;}) |
akashvibhute | 2:a5f8e04bd02b | 131 | #else |
akashvibhute | 2:a5f8e04bd02b | 132 | #define IF_SERIAL_DEBUG_FRAGMENTATION_L2(x) |
akashvibhute | 2:a5f8e04bd02b | 133 | #endif |
akashvibhute | 2:a5f8e04bd02b | 134 | |
akashvibhute | 2:a5f8e04bd02b | 135 | #if defined (SERIAL_DEBUG_ROUTING) |
akashvibhute | 2:a5f8e04bd02b | 136 | #define IF_SERIAL_DEBUG_ROUTING(x) ({x;}) |
akashvibhute | 2:a5f8e04bd02b | 137 | #else |
akashvibhute | 2:a5f8e04bd02b | 138 | #define IF_SERIAL_DEBUG_ROUTING(x) |
akashvibhute | 2:a5f8e04bd02b | 139 | #endif |
akashvibhute | 2:a5f8e04bd02b | 140 | #endif // RF24_NETWORK_CONFIG_H |
akashvibhute | 2:a5f8e04bd02b | 141 |