no modif
Dependents: ISEN_RF24Network_Node_01 ISEN_RF24Network_Node_02
RF24_config.h@10:2b68b1fe6538, 2021-05-20 (annotated)
- Committer:
- Giamarchi
- Date:
- Thu May 20 09:26:32 2021 +0000
- Revision:
- 10:2b68b1fe6538
- Parent:
- 3:e94be00fd19e
no modif
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
akashvibhute | 2:3bdf0d9bb71f | 1 | |
akashvibhute | 2:3bdf0d9bb71f | 2 | /* |
akashvibhute | 2:3bdf0d9bb71f | 3 | Copyright (C) 2011 J. Coliz <maniacbug@ymail.com> |
akashvibhute | 2:3bdf0d9bb71f | 4 | This program is free software; you can redistribute it and/or |
akashvibhute | 2:3bdf0d9bb71f | 5 | modify it under the terms of the GNU General Public License |
akashvibhute | 2:3bdf0d9bb71f | 6 | version 2 as published by the Free Software Foundation. |
akashvibhute | 2:3bdf0d9bb71f | 7 | */ |
akashvibhute | 2:3bdf0d9bb71f | 8 | |
akashvibhute | 3:e94be00fd19e | 9 | /* |
akashvibhute | 3:e94be00fd19e | 10 | * Mbed support added by Akash Vibhute <akash.roboticist@gmail.com> |
akashvibhute | 3:e94be00fd19e | 11 | * Porting completed on Nov/05/2015 |
akashvibhute | 2:3bdf0d9bb71f | 12 | * |
akashvibhute | 3:e94be00fd19e | 13 | * Updated with TMRh20's RF24 library on Nov/04/2015 from https://github.com/TMRh20 |
akashvibhute | 2:3bdf0d9bb71f | 14 | * |
akashvibhute | 2:3bdf0d9bb71f | 15 | */ |
akashvibhute | 2:3bdf0d9bb71f | 16 | |
akashvibhute | 2:3bdf0d9bb71f | 17 | |
akashvibhute | 2:3bdf0d9bb71f | 18 | #ifndef __RF24_CONFIG_H__ |
akashvibhute | 2:3bdf0d9bb71f | 19 | #define __RF24_CONFIG_H__ |
akashvibhute | 2:3bdf0d9bb71f | 20 | |
akashvibhute | 2:3bdf0d9bb71f | 21 | /*** USER DEFINES: ***/ |
akashvibhute | 2:3bdf0d9bb71f | 22 | //#define FAILURE_HANDLING |
akashvibhute | 2:3bdf0d9bb71f | 23 | //#define SERIAL_DEBUG |
akashvibhute | 2:3bdf0d9bb71f | 24 | //#define MINIMAL |
akashvibhute | 2:3bdf0d9bb71f | 25 | /**********************/ |
akashvibhute | 2:3bdf0d9bb71f | 26 | #define rf24_max(a,b) (a>b?a:b) |
akashvibhute | 2:3bdf0d9bb71f | 27 | #define rf24_min(a,b) (a<b?a:b) |
akashvibhute | 2:3bdf0d9bb71f | 28 | |
akashvibhute | 2:3bdf0d9bb71f | 29 | #if defined SPI_HAS_TRANSACTION && !defined SPI_UART && !defined SOFTSPI |
akashvibhute | 2:3bdf0d9bb71f | 30 | #define RF24_SPI_TRANSACTIONS |
akashvibhute | 2:3bdf0d9bb71f | 31 | #endif |
akashvibhute | 2:3bdf0d9bb71f | 32 | |
akashvibhute | 2:3bdf0d9bb71f | 33 | #include <mbed.h> |
akashvibhute | 2:3bdf0d9bb71f | 34 | |
akashvibhute | 2:3bdf0d9bb71f | 35 | // RF modules support 10 Mhz SPI bus speed |
akashvibhute | 2:3bdf0d9bb71f | 36 | const uint32_t RF_SPI_SPEED = 10000000; |
akashvibhute | 2:3bdf0d9bb71f | 37 | |
akashvibhute | 2:3bdf0d9bb71f | 38 | #include <stdint.h> |
akashvibhute | 2:3bdf0d9bb71f | 39 | #include <stdio.h> |
akashvibhute | 2:3bdf0d9bb71f | 40 | #include <string.h> |
akashvibhute | 2:3bdf0d9bb71f | 41 | |
akashvibhute | 2:3bdf0d9bb71f | 42 | #define _BV(x) (1<<(x)) |
akashvibhute | 2:3bdf0d9bb71f | 43 | #define _SPI SPI |
akashvibhute | 2:3bdf0d9bb71f | 44 | |
akashvibhute | 2:3bdf0d9bb71f | 45 | #ifdef SERIAL_DEBUG |
akashvibhute | 2:3bdf0d9bb71f | 46 | #define IF_SERIAL_DEBUG(x) ({x;}) |
akashvibhute | 2:3bdf0d9bb71f | 47 | #else |
akashvibhute | 2:3bdf0d9bb71f | 48 | #define IF_SERIAL_DEBUG(x) |
akashvibhute | 2:3bdf0d9bb71f | 49 | #endif |
akashvibhute | 2:3bdf0d9bb71f | 50 | |
akashvibhute | 2:3bdf0d9bb71f | 51 | #define printf_P printf |
Giamarchi | 10:2b68b1fe6538 | 52 | //#define _BV(bit) (1<<(bit)) |
akashvibhute | 2:3bdf0d9bb71f | 53 | #define pgm_read_byte(addr) (*(const unsigned char *)(addr)) |
akashvibhute | 2:3bdf0d9bb71f | 54 | |
akashvibhute | 2:3bdf0d9bb71f | 55 | typedef uint16_t prog_uint16_t; |
akashvibhute | 2:3bdf0d9bb71f | 56 | #define PSTR(x) (x) |
akashvibhute | 2:3bdf0d9bb71f | 57 | #define printf_P printf |
akashvibhute | 2:3bdf0d9bb71f | 58 | #define strlen_P strlen |
akashvibhute | 2:3bdf0d9bb71f | 59 | #define PROGMEM |
akashvibhute | 2:3bdf0d9bb71f | 60 | #define pgm_read_word(p) (*(p)) |
akashvibhute | 2:3bdf0d9bb71f | 61 | #define PRIPSTR "%s" |
akashvibhute | 2:3bdf0d9bb71f | 62 | |
akashvibhute | 2:3bdf0d9bb71f | 63 | #endif // __RF24_CONFIG_H__ |