same
Fork of RF24 by
Diff: RF24_config.h
- Revision:
- 2:3bdf0d9bb71f
- Child:
- 3:e94be00fd19e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RF24_config.h Thu Nov 05 05:40:23 2015 +0000 @@ -0,0 +1,62 @@ + +/* + Copyright (C) 2011 J. Coliz <maniacbug@ymail.com> + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + version 2 as published by the Free Software Foundation. + */ + +/* Akash Vibhute <akash.roboticist@gmail.com> + * + * Modified for mbed support. Base code taken from TMRh20's github as on 04/Nov/2015 + * + */ + + +#ifndef __RF24_CONFIG_H__ +#define __RF24_CONFIG_H__ + +/*** USER DEFINES: ***/ +//#define FAILURE_HANDLING +//#define SERIAL_DEBUG +//#define MINIMAL +/**********************/ +#define rf24_max(a,b) (a>b?a:b) +#define rf24_min(a,b) (a<b?a:b) + +#if defined SPI_HAS_TRANSACTION && !defined SPI_UART && !defined SOFTSPI +#define RF24_SPI_TRANSACTIONS +#endif + +#include <mbed.h> + +// RF modules support 10 Mhz SPI bus speed +const uint32_t RF_SPI_SPEED = 10000000; + +#include <stdint.h> +#include <stdio.h> +#include <string.h> + +#define _BV(x) (1<<(x)) +#define _SPI SPI + +#ifdef SERIAL_DEBUG +#define IF_SERIAL_DEBUG(x) ({x;}) +#else +#define IF_SERIAL_DEBUG(x) +#endif + +#define printf_P printf +#define _BV(bit) (1<<(bit)) +#define pgm_read_byte(addr) (*(const unsigned char *)(addr)) + +typedef uint16_t prog_uint16_t; +#define PSTR(x) (x) +#define printf_P printf +#define strlen_P strlen +#define PROGMEM +#define pgm_read_word(p) (*(p)) +#define PRIPSTR "%s" + +#endif // __RF24_CONFIG_H__ +