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