TMRh20 ported to MBED

Fork of TMRh20 by BME SmartLab

RF24_config.h

Committer:
gume
Date:
2017-10-06
Revision:
6:15a3bbf90fe9
Parent:
4:c741eb877a4e

File content as of revision 6:15a3bbf90fe9:


/*
 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.
 */
 
 /* spaniakos <spaniakos@gmail.com>
  Added __ARDUINO_X86__ support
*/

#ifndef __RF24_CONFIG_H__
#define __RF24_CONFIG_H__

#include <stdint.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
 

  #define RF24_MBED
   
  #define HIGH 1
  #define LOW 0
  
  // Define _BV for non-Arduino platforms and for Arduino DUE
  #include <stdint.h>
  #include <stdio.h>
  #include <string.h>
 
  #define _BV(x) (1<<(x))

  #ifdef SERIAL_DEBUG
    #define IF_SERIAL_DEBUG(x) ({x;})
  #else
    #define IF_SERIAL_DEBUG(x)
  #endif
    
  #define PSTR(x) (x)
  //#define printf Serial.printf
  //#define sprintf(...) os_sprintf( __VA_ARGS__ )
  #define printf_P printf
  #define strlen_P strlen  
  #define PROGMEM
  #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
  #define pgm_read_word(p) (*(p))
  #define PRIPSTR "%s"

  #define millis() (us_ticker_read() / 1000)
  #define delay(t) wait_ms(t)
  #define delayMicroseconds(t) wait_us(t) 

#endif // __RF24_CONFIG_H__