Optimized High Speed NRF24L01+ Driver Class Documenation  V1.0
TMRh20 2014 - Optimized Fork of NRF24L01+ Driver
RF24_arch_config.h
Go to the documentation of this file.
1 
2 /*
3  Copyright (C) 2011 J. Coliz <maniacbug@ymail.com>
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public License
7  version 2 as published by the Free Software Foundation.
8 
9  */
10 
26 #ifndef __ARCH_CONFIG_H__
27 #define __ARCH_CONFIG_H__
28 
29 #define RF24_LINUX
30 
31 #include <stddef.h>
32 #include "spi.h"
33 #include "gpio.h"
34 #include "compatibility.h"
35 #include <stdint.h>
36 #include <stdio.h>
37 #include <time.h>
38 #include <string.h>
39 #include <sys/time.h>
40 
41 #define _BV(x) (1<<(x))
42 #define _SPI spi
43 
44 #undef SERIAL_DEBUG
45 #ifdef SERIAL_DEBUG
46 #define IF_SERIAL_DEBUG(x) ({x;})
47 #else
48 #define IF_SERIAL_DEBUG(x)
49 #endif
50 
51 // Avoid spurious warnings
52 #if 1
53 #if ! defined( NATIVE ) && defined( ARDUINO )
54 #undef PROGMEM
55 #define PROGMEM __attribute__(( section(".progmem.data") ))
56 #undef PSTR
57 #define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];}))
58 #endif
59 #endif
60 
61 typedef uint16_t prog_uint16_t;
62 #define PSTR(x) (x)
63 #define printf_P printf
64 #define strlen_P strlen
65 #define PROGMEM
66 #define pgm_read_word(p) (*(p))
67 #define PRIPSTR "%s"
68 #define pgm_read_byte(p) (*(p))
69 
70 // Function, constant map as a result of migrating from Arduino
71 #define LOW GPIO::OUTPUT_LOW
72 #define HIGH GPIO::OUTPUT_HIGH
73 #define INPUT GPIO::DIRECTION_IN
74 #define OUTPUT GPIO::DIRECTION_OUT
75 #define digitalWrite(pin, value) GPIO::write(pin, value)
76 #define pinMode(pin, direction) GPIO::open(pin, direction)
77 #define delay(milisec) __msleep(milisec)
78 #define delayMicroseconds(usec) __usleep(usec)
79 #define millis() __millis()
80 
81 #endif // __ARCH_CONFIG_H__
82 
83 
uint16_t prog_uint16_t