Some improvement on mrcrsch's RF24 library
Fork of RF24_fork by
RF24_config.h@13:d295c8b3f742, 2018-09-19 (annotated)
- Committer:
- gume
- Date:
- Wed Sep 19 22:50:11 2018 +0000
- Revision:
- 13:d295c8b3f742
- Parent:
- 11:1dd1d5ae6ca7
adapted radio presence test
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 | 6:5cc7136648d1 | 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 | 6:5cc7136648d1 | 13 | * Updated 1: Synced with TMRh20's RF24 library on Nov/04/2015 from https://github.com/TMRh20 |
akashvibhute | 6:5cc7136648d1 | 14 | * Updated 2: Synced with TMRh20's RF24 library on Apr/18/2015 from https://github.com/TMRh20 |
akashvibhute | 2:3bdf0d9bb71f | 15 | * |
akashvibhute | 2:3bdf0d9bb71f | 16 | */ |
akashvibhute | 6:5cc7136648d1 | 17 | |
akashvibhute | 2:3bdf0d9bb71f | 18 | |
akashvibhute | 2:3bdf0d9bb71f | 19 | #ifndef __RF24_CONFIG_H__ |
akashvibhute | 2:3bdf0d9bb71f | 20 | #define __RF24_CONFIG_H__ |
akashvibhute | 2:3bdf0d9bb71f | 21 | |
akashvibhute | 2:3bdf0d9bb71f | 22 | /*** USER DEFINES: ***/ |
akashvibhute | 2:3bdf0d9bb71f | 23 | //#define FAILURE_HANDLING |
akashvibhute | 2:3bdf0d9bb71f | 24 | //#define SERIAL_DEBUG |
akashvibhute | 2:3bdf0d9bb71f | 25 | //#define MINIMAL |
akashvibhute | 2:3bdf0d9bb71f | 26 | /**********************/ |
gume | 11:1dd1d5ae6ca7 | 27 | //#define MINIMAL // Strange package loss in this case |
gume | 11:1dd1d5ae6ca7 | 28 | |
akashvibhute | 2:3bdf0d9bb71f | 29 | #define rf24_max(a,b) (a>b?a:b) |
akashvibhute | 2:3bdf0d9bb71f | 30 | #define rf24_min(a,b) (a<b?a:b) |
akashvibhute | 2:3bdf0d9bb71f | 31 | |
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 | 6:5cc7136648d1 | 38 | #define HIGH 1 |
akashvibhute | 6:5cc7136648d1 | 39 | #define LOW 0 |
akashvibhute | 6:5cc7136648d1 | 40 | |
akashvibhute | 6:5cc7136648d1 | 41 | //#include <stdint.h> |
akashvibhute | 6:5cc7136648d1 | 42 | //#include <stdio.h> |
akashvibhute | 6:5cc7136648d1 | 43 | //#include <string.h> |
akashvibhute | 2:3bdf0d9bb71f | 44 | |
akashvibhute | 2:3bdf0d9bb71f | 45 | #define _BV(x) (1<<(x)) |
akashvibhute | 2:3bdf0d9bb71f | 46 | #define _SPI SPI |
akashvibhute | 2:3bdf0d9bb71f | 47 | |
akashvibhute | 2:3bdf0d9bb71f | 48 | #ifdef SERIAL_DEBUG |
akashvibhute | 2:3bdf0d9bb71f | 49 | #define IF_SERIAL_DEBUG(x) ({x;}) |
akashvibhute | 2:3bdf0d9bb71f | 50 | #else |
akashvibhute | 2:3bdf0d9bb71f | 51 | #define IF_SERIAL_DEBUG(x) |
akashvibhute | 2:3bdf0d9bb71f | 52 | #endif |
akashvibhute | 2:3bdf0d9bb71f | 53 | |
akashvibhute | 7:32d6957f37ae | 54 | //#define printf_P printf |
akashvibhute | 7:32d6957f37ae | 55 | #define printf_P |
akashvibhute | 6:5cc7136648d1 | 56 | //#define _BV(bit) (1<<(bit)) |
akashvibhute | 2:3bdf0d9bb71f | 57 | #define pgm_read_byte(addr) (*(const unsigned char *)(addr)) |
akashvibhute | 2:3bdf0d9bb71f | 58 | |
akashvibhute | 2:3bdf0d9bb71f | 59 | typedef uint16_t prog_uint16_t; |
akashvibhute | 2:3bdf0d9bb71f | 60 | #define PSTR(x) (x) |
akashvibhute | 6:5cc7136648d1 | 61 | #define sprintf(...) os_sprintf( __VA_ARGS__ ) |
akashvibhute | 7:32d6957f37ae | 62 | //#define printf_P printf |
akashvibhute | 7:32d6957f37ae | 63 | #define printf_P |
akashvibhute | 6:5cc7136648d1 | 64 | #define strlen_P strlen |
akashvibhute | 6:5cc7136648d1 | 65 | #define PROGMEM |
akashvibhute | 6:5cc7136648d1 | 66 | #define pgm_read_byte(addr) (*(const unsigned char *)(addr)) |
akashvibhute | 6:5cc7136648d1 | 67 | #define pgm_read_word(p) (*(p)) |
akashvibhute | 6:5cc7136648d1 | 68 | #define PRIPSTR "%s" |
akashvibhute | 2:3bdf0d9bb71f | 69 | |
akashvibhute | 2:3bdf0d9bb71f | 70 | #endif // __RF24_CONFIG_H__ |
akashvibhute | 6:5cc7136648d1 | 71 |