diff --git a/.gitignore b/.gitignore index 162a7dfa3..f4545a15f 100644 --- a/.gitignore +++ b/.gitignore @@ -20,8 +20,12 @@ Session.vim Makefile.inc utility/includes.h examples_linux/* +examples_linux/**/* !examples_linux/*.cpp !examples_linux/*.py +!examples_linux/**/*.cpp +!examples_linux/Makefile +!examples_linux/**/Makefile *__pycache__/ .directory .idea diff --git a/RF24.h b/RF24.h index e1f095934..de67fc89c 100644 --- a/RF24.h +++ b/RF24.h @@ -40,7 +40,6 @@ typedef enum { * -18 dBm | -6 dBm | -12 dBm */ RF24_PA_MIN = 0, - /** * (1) represents: * nRF24L01 | Si24R1 with
lnaEnabled = 1 | Si24R1 with
lnaEnabled = 0 @@ -48,7 +47,6 @@ typedef enum { * -12 dBm | 0 dBm | -4 dBm */ RF24_PA_LOW, - /** * (2) represents: * nRF24L01 | Si24R1 with
lnaEnabled = 1 | Si24R1 with
lnaEnabled = 0 @@ -56,7 +54,6 @@ typedef enum { * -6 dBm | 3 dBm | 1 dBm */ RF24_PA_HIGH, - /** * (3) represents: * nRF24L01 | Si24R1 with
lnaEnabled = 1 | Si24R1 with
lnaEnabled = 0 @@ -64,7 +61,6 @@ typedef enum { * 0 dBm | 7 dBm | 4 dBm */ RF24_PA_MAX, - /** * (4) This should not be used and remains for backward compatibility. */ @@ -109,7 +105,7 @@ typedef enum { /** * @} - * Driver for nRF24L01(+) 2.4GHz Wireless Transceiver + * @brief Driver class for nRF24L01(+) 2.4GHz Wireless Transceiver */ class RF24 { @@ -170,7 +166,7 @@ class RF24 { * Creates a new instance of this driver. Before using, you create an instance * and send in the unique pins that this chip is connected to. * - * See http://nRF24.github.io/RF24/pages.html for device specific information
+ * See [Related Pages](pages.html) for device specific information
* * @note Users can specify default SPI speed by modifying `#define RF24_SPI_SPEED` in RF24_config.h
* For Arduino, SPI speed will only be properly configured this way on devices supporting SPI TRANSACTIONS
@@ -1550,13 +1546,14 @@ class RF24 { /** * Open a pipe for reading - * @deprecated For compatibility with old code only, see new function + * @deprecated For compatibility with old code only, see newer function + * openReadingPipe() * * @warning Pipes 1-5 should share the first 32 bits. * Only the least significant byte should be unique, e.g. * @code - * openReadingPipe(1,0xF0F0F0F0AA); - * openReadingPipe(2,0xF0F0F0F066); + * openReadingPipe(1, 0xF0F0F0F0AA); + * openReadingPipe(2, 0xF0F0F0F066); * @endcode * * @warning Pipe 0 is also used by the writing pipe so should typically be avoided as a reading pipe.
@@ -1570,7 +1567,8 @@ class RF24 { /** * Open a pipe for writing - * @deprecated For compatibility with old code only, see new function + * @deprecated For compatibility with old code only, see newer function + * openWritingPipe() * * Addresses are 40-bit hex values, e.g.: * diff --git a/utility/ATXMegaD3/gpio.h b/utility/ATXMegaD3/gpio.h index 50acc91cc..01c0b1896 100644 --- a/utility/ATXMegaD3/gpio.h +++ b/utility/ATXMegaD3/gpio.h @@ -14,7 +14,7 @@ * @{ */ #ifndef GPIO_H -#define GPIO_H +#define GPIO_H #include #include "gpio_helper.h" @@ -46,7 +46,6 @@ class GPIO { /** * Similar to Arduino digitalRead(pin); * @param port - * @param value */ static int read(int port); @@ -62,4 +61,4 @@ class GPIO { }; #endif /* GPIO_H */ -/*@}*/ \ No newline at end of file +/*@}*/ \ No newline at end of file diff --git a/utility/MRAA/RF24_arch_config.h b/utility/MRAA/RF24_arch_config.h index c5a1ce11b..0699ca9d0 100644 --- a/utility/MRAA/RF24_arch_config.h +++ b/utility/MRAA/RF24_arch_config.h @@ -19,8 +19,8 @@ //#include // Precompiled arduino x86 based utiltime for timing functions // GCC a Arduino Missing -#define HIGH 1 -#define LOW 0 +#define HIGH 1 +#define LOW 0 #define _BV(x) (1<<(x)) #define pgm_read_word(p) (*(p)) #define pgm_read_byte(p) (*(p)) @@ -43,6 +43,7 @@ #endif #define digitalWrite(pin, value) gpio.write(pin, value) +#define digitalRead(pin) GPIO::read(pin) #define pinMode(pin, direction) gpio.open(pin, direction) #ifndef __TIME_H__ diff --git a/utility/MRAA/gpio.h b/utility/MRAA/gpio.h index 312aec906..e30935a6a 100644 --- a/utility/MRAA/gpio.h +++ b/utility/MRAA/gpio.h @@ -1,13 +1,13 @@ -/* +/* * TMRh20 2015 - * + * */ #ifndef RF24_ARCH_GPIO_H -#define RF24_ARCH_GPIO_H +#define RF24_ARCH_GPIO_H /** * @file spi.h -* \cond HIDDEN_SYMBOLS +* @cond HIDDEN_SYMBOLS * Class declaration for GPIO helper files */ #include @@ -46,7 +46,6 @@ class GPIO { /** * * @param port - * @param value */ int read(int port); @@ -64,7 +63,7 @@ class GPIO { //mraa::Gpio* gpio_1; /** gpio object for cs_pin **/ }; /** - * \endcond + * @endcond */ -#endif /* RF24_ARCH_GPIO_H */ +#endif /* RF24_ARCH_GPIO_H */ diff --git a/utility/Template/RF24_arch_config.h b/utility/Template/RF24_arch_config.h index 16cf975c8..50e1b4d25 100644 --- a/utility/Template/RF24_arch_config.h +++ b/utility/Template/RF24_arch_config.h @@ -1,25 +1,24 @@ /* - 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. - + * 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. + * */ /** -* @file RF24_arch_config.h -* General defines and includes for RF24/Linux -*/ + * @file RF24_arch_config.h + * General defines and includes for RF24/Linux + */ /** -* Example of RF24_arch_config.h for RF24 portability -* -* @defgroup Porting_General Porting: General -* -* -* @{ -*/ + * Example of RF24_arch_config.h for RF24 portability + * + * @defgroup Porting_General Porting: General + * + * @{ + */ #ifndef __ARCH_CONFIG_H__ diff --git a/utility/Template/compatibility.h b/utility/Template/compatibility.h index 7a55dcae8..6c53a7c88 100644 --- a/utility/Template/compatibility.h +++ b/utility/Template/compatibility.h @@ -6,18 +6,17 @@ */ /** -* @file compatibility.h -* Class declaration for SPI helper files -*/ + * @file compatibility.h + * Class declaration for SPI helper files + */ /** -* Example of compatibility.h class declaration for timing functions portability -* -* @defgroup Porting_Timing Porting: Timing -* -* -* @{ -*/ + * Example of compatibility.h class declaration for timing functions portability + * + * @defgroup Porting_Timing Porting: Timing + * + * @{ + */ #ifndef COMPATIBLITY_H #define COMPATIBLITY_H diff --git a/utility/Template/gpio.h b/utility/Template/gpio.h index d806a0115..57904cfc6 100644 --- a/utility/Template/gpio.h +++ b/utility/Template/gpio.h @@ -6,57 +6,55 @@ */ /** -* Example of gpio.h class declaration for GPIO portability -* -* @defgroup Porting_GPIO Porting: GPIO -* -* -* @{ -*/ -#ifndef H -#define H - -#include - -//class GPIO { -public: -/* Constants */ -static const int DIRECTION_OUT = 1; -static const int DIRECTION_IN = 0; - -static const int OUTPUT_HIGH = 1; -static const int OUTPUT_LOW = 0; - -GPIO(); - -/** - * Similar to Arduino pinMode(pin,mode); - * @param port - * @param DDR - */ -static void open(int port, int DDR); - -/** + * Example of gpio.h class declaration for GPIO portability + * + * @defgroup Porting_GPIO Porting: GPIO * - * @param port + * @{ */ -static void close(int port); +#include /** - * Similar to Arduino digitalRead(pin); - * @param port + * @brief generic class for guidance about porting to an unsupported platform */ -static int read(int port); - -/** -* Similar to Arduino digitalWrite(pin,state); -* @param port -* @param value -*/ -static void write(int port, int value); - -virtual ~ GPIO(); - +class GPIO { +public: + /* Constants */ + static const int DIRECTION_OUT = 1; + static const int DIRECTION_IN = 0; + + static const int OUTPUT_HIGH = 1; + static const int OUTPUT_LOW = 0; + + GPIO(); + + /** + * Similar to Arduino pinMode(pin,mode); + * @param port + * @param DDR + */ + static void open(int port, int DDR); + + /** + * + * @param port + */ + static void close(int port); + + /** + * Similar to Arduino digitalRead(pin); + * @param port + */ + static int read(int port); + + /** + * Similar to Arduino digitalWrite(pin,state); + * @param port + * @param value + */ + static void write(int port, int value); + + virtual ~ GPIO(); }; -/**@}*/ \ No newline at end of file +/**@}*/ \ No newline at end of file diff --git a/utility/Template/includes.h b/utility/Template/includes.h index 24730a4f3..04c67a7a8 100644 --- a/utility/Template/includes.h +++ b/utility/Template/includes.h @@ -1,16 +1,15 @@ /** -* @file includes.h -* Configuration defines for RF24/Linux -*/ + * @file includes.h + * Configuration defines for RF24/Linux + */ /** -* Example of includes.h for RF24 Linux portability -* -* @defgroup Porting_Includes Porting: Includes -* -* -* @{ -*/ + * Example of includes.h for RF24 Linux portability + * + * @defgroup Porting_Includes Porting: Includes + * + * @{ + */ #ifndef __RF24_INCLUDES_H__ #define __RF24_INCLUDES_H__ @@ -22,9 +21,9 @@ /** * Load the correct configuration for this platform -*/ + */ #include "BBB/RF24_arch_config.h" #endif -/**@}*/ \ No newline at end of file +/**@}*/ \ No newline at end of file diff --git a/utility/Template/spi.h b/utility/Template/spi.h index fa91e4158..24d4759ee 100644 --- a/utility/Template/spi.h +++ b/utility/Template/spi.h @@ -4,13 +4,12 @@ */ /** -* Example of spi.h class declaration for SPI portability -* -* @defgroup Porting_SPI Porting: SPI -* -* -* @{ -*/ + * Example of spi.h class declaration for SPI portability + * + * @defgroup Porting_SPI Porting: SPI + * + * @{ + */ #include #include #include @@ -24,58 +23,60 @@ #include using namespace std; -//class SPI { +/** + * @brief generic class for guidance about porting to an unsupported platform + */ +class SPI { public: -/** - * SPI constructor - */ -SPI(); + /** + * SPI constructor + */ + SPI(); -/** -* Start SPI -*/ -void begin(int busNo); + /** + * Start SPI + */ + void begin(int busNo); -/** -* Transfer a single byte -* @param tx_ Byte to send -* @return Data returned via spi -*/ -uint8_t transfer(uint8_t tx_); + /** + * Transfer a single byte + * @param tx_ Byte to send + * @return Data returned via spi + */ + uint8_t transfer(uint8_t tx_); -/** -* Transfer a buffer of data -* @param tbuf Transmit buffer -* @param rbuf Receive buffer -* @param len Length of the data -*/ -void transfernb(char* tbuf, char* rbuf, uint32_t len); + /** + * Transfer a buffer of data + * @param tbuf Transmit buffer + * @param rbuf Receive buffer + * @param len Length of the data + */ + void transfernb(char* tbuf, char* rbuf, uint32_t len); -/** -* Transfer a buffer of data without an rx buffer -* @param buf Pointer to a buffer of data -* @param len Length of the data -*/ -void transfern(char* buf, uint32_t len); + /** + * Transfer a buffer of data without an rx buffer + * @param buf Pointer to a buffer of data + * @param len Length of the data + */ + void transfern(char* buf, uint32_t len); -virtual ~ SPI(); + virtual ~ SPI(); private: -/** Default SPI device */ -string device; -/** SPI Mode set */ -uint8_t mode; -/** word size*/ -uint8_t bits; -/** Set SPI speed*/ -uint32_t speed; -int fd; + /** Default SPI device */ + string device; + /** SPI Mode set */ + uint8_t mode; + /** word size*/ + uint8_t bits; + /** Set SPI speed*/ + uint32_t speed; + int fd; -void init(); + void init(); }; - /**@}*/ \ No newline at end of file