,

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers RF24_config.h Source File

RF24_config.h

00001 /*
00002  Copyright (C) 2011 J. Coliz <maniacbug@ymail.com>
00003  This program is free software; you can redistribute it and/or
00004  modify it under the terms of the GNU General Public License
00005  version 2 as published by the Free Software Foundation.
00006  */
00007  
00008 /*
00009  * Mbed support added by Akash Vibhute <akash.roboticist@gmail.com>
00010  * Porting completed on Nov/05/2015
00011  *
00012  * Updated 1: Synced with TMRh20's RF24 library on Nov/04/2015 from https://github.com/TMRh20
00013  * Updated 2: Synced with TMRh20's RF24 library on Apr/18/2015 from https://github.com/TMRh20
00014  *
00015  */
00016  
00017  
00018 #ifndef __RF24_CONFIG_H__
00019 #define __RF24_CONFIG_H__
00020  
00021 /*** USER DEFINES:  ***/
00022 //#define FAILURE_HANDLING
00023 //#define SERIAL_DEBUG
00024 //#define MINIMAL
00025 /**********************/
00026 #define rf24_max(a,b) (a>b?a:b)
00027 #define rf24_min(a,b) (a<b?a:b)
00028  
00029  
00030 #include <mbed.h>
00031  
00032 // RF modules support 10 Mhz SPI bus speed
00033 const uint32_t RF_SPI_SPEED = 10000000;
00034  
00035 #define HIGH 1
00036 #define LOW 0
00037  
00038 //#include <stdint.h>
00039 //#include <stdio.h>
00040 //#include <string.h>
00041  
00042 #define _BV(x) (1<<(x))
00043 #define _SPI SPI
00044  
00045 #ifdef SERIAL_DEBUG
00046 #define IF_SERIAL_DEBUG(x) ({x;})
00047 #else
00048 #define IF_SERIAL_DEBUG(x)
00049 #endif
00050  
00051 //#define printf_P printf
00052 #define printf_P
00053 //#define _BV(bit) (1<<(bit))
00054 #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
00055  
00056 typedef uint16_t prog_uint16_t;
00057 #define PSTR(x) (x)
00058   #define sprintf(...) os_sprintf( __VA_ARGS__ )
00059   //#define printf_P printf
00060   #define printf_P
00061   #define strlen_P strlen  
00062   #define PROGMEM
00063   #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
00064   #define pgm_read_word(p) (*(p))
00065   #define PRIPSTR "%s"
00066  
00067 #endif // __RF24_CONFIG_H__
00068