/* Copyright (C) 2011 J. Coliz 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. */ /* spaniakos Added __ARDUINO_X86__ support */ #ifndef __RF24MOD_CONFIG_H__ #define __RF24MOD_CONFIG_H__ /*** USER DEFINES: ***/ //#define FAILURE_HANDLING //#define SERIAL_DEBUG //#define MINIMAL //#define SPI_UART // Requires library from https://github.com/TMRh20/Sketches/tree/master/SPI_UART //#define SOFTSPI // Requires library from https://github.com/greiman/DigitalIO /**********************/ #define rf24_max(a,b) (a>b?a:b) #define rf24_min(a,b) (a // RF modules support 10 Mhz SPI bus speed const uint32_t RF24_SPI_SPEED = 10000000; #if defined (ARDUINO) && !defined (__arm__) && !defined (__ARDUINO_X86__) #if defined SPI_UART #include #define _SPI uspi #elif defined SOFTSPI // change these pins to your liking // #ifndef SOFT_SPI_MISO_PIN #define SOFT_SPI_MISO_PIN 9 #endif #ifndef SOFT_SPI_MOSI_PIN #define SOFT_SPI_MOSI_PIN 8 #endif #ifndef SOFT_SPI_SCK_PIN #define SOFT_SPI_SCK_PIN 7 #endif const uint8_t SPI_MODE = 0; #define _SPI spi #else #include #define _SPI SPI #endif #else // Define _BV for non-Arduino platforms and for Arduino DUE #include #include #include #if defined(__arm__) || defined (__ARDUINO_X86__) #if defined (__arm__) && defined (SPI_UART) #include #define _SPI uspi #else #include #include "wiring_private.h" // pinPeripheral() function //SPIClass mySPI (&sercom1, 12, 13, 11, SPI_PAD_0_SCK_1, SERCOM_RX_PAD_3); #define _SPI SPI #endif #elif !defined(__arm__) && !defined (__ARDUINO_X86__) extern HardwareSPI SPI; #endif #define _BV(x) (1<<(x)) #endif #ifdef SERIAL_DEBUG #define IF_SERIAL_DEBUG(x) ({x;}) #else #define IF_SERIAL_DEBUG(x) #if defined(RF24_TINY) #define printf_P(...) #endif #endif #if defined (__ARDUINO_X86__) #define printf_P printf #define _BV(bit) (1<<(bit)) #endif // Progmem is Arduino-specific // Arduino DUE is arm and does not include avr/pgmspace #if defined (ARDUINO_ARCH_ESP8266) #include #define PRIPSTR "%s" #elif defined(ARDUINO) && !defined(ESP_PLATFORM) && ! defined(__arm__) && !defined (__ARDUINO_X86__) || defined(XMEGA) #include #define PRIPSTR "%S" #else #if ! defined(ARDUINO) // This doesn't work on Arduino DUE typedef char const char; #else // Fill in pgm_read_byte that is used, but missing from DUE #define pgm_read_byte(addr) (*(const unsigned char *)(addr)) #endif 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 #endif #endif // __RF24MOD_CONFIG_H__