Commit 8e153101 authored by TMRh20's avatar TMRh20

More doc updates for coming changes

- Add Portability section to docs
- Add source file browser to docs
- Filter out GPIO and SPI classes from docs, but include in file lists
- Update doxyfile
parent 40b907c3
...@@ -651,14 +651,14 @@ MAX_INITIALIZER_LINES = 30 ...@@ -651,14 +651,14 @@ MAX_INITIALIZER_LINES = 30
# list will mention the files that were used to generate the documentation. # list will mention the files that were used to generate the documentation.
# The default value is: YES. # The default value is: YES.
SHOW_USED_FILES = NO SHOW_USED_FILES = YES
# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This # Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
# will remove the Files entry from the Quick Index and from the Folder Tree View # will remove the Files entry from the Quick Index and from the Folder Tree View
# (if specified). # (if specified).
# The default value is: YES. # The default value is: YES.
SHOW_FILES = NO SHOW_FILES = YES
# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces # Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
# page. This will remove the Namespaces entry from the Quick Index and from the # page. This will remove the Namespaces entry from the Quick Index and from the
...@@ -769,7 +769,8 @@ WARN_LOGFILE = ...@@ -769,7 +769,8 @@ WARN_LOGFILE =
# spaces. # spaces.
# Note: If this tag is empty the current directory is searched. # Note: If this tag is empty the current directory is searched.
INPUT = ./ INPUT = ./ \
./arch/BBB
# This tag can be used to specify the character encoding of the source files # This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
...@@ -862,8 +863,6 @@ EXCLUDE_SYMLINKS = NO ...@@ -862,8 +863,6 @@ EXCLUDE_SYMLINKS = NO
# exclude all test directories for example use the pattern */test/* # exclude all test directories for example use the pattern */test/*
EXCLUDE_PATTERNS = bcm2835* \ EXCLUDE_PATTERNS = bcm2835* \
gpio* \
spi* \
readme* \ readme* \
runtest* runtest*
...@@ -964,7 +963,7 @@ USE_MDFILE_AS_MAINPAGE = ...@@ -964,7 +963,7 @@ USE_MDFILE_AS_MAINPAGE =
# also VERBATIM_HEADERS is set to NO. # also VERBATIM_HEADERS is set to NO.
# The default value is: NO. # The default value is: NO.
SOURCE_BROWSER = NO SOURCE_BROWSER = YES
# Setting the INLINE_SOURCES tag to YES will include the body of functions, # Setting the INLINE_SOURCES tag to YES will include the body of functions,
# classes and enums directly into the documentation. # classes and enums directly into the documentation.
......
...@@ -1136,7 +1136,7 @@ private: ...@@ -1136,7 +1136,7 @@ private:
*/ */
/** /**
* @example GettingStarted_CallResponse.cpp * @example GettingStarted_Call_Response.cpp
* <b>For Raspberry Pi</b><br> * <b>For Raspberry Pi</b><br>
* <b>New: TMRh20 2014</b><br> * <b>New: TMRh20 2014</b><br>
* *
...@@ -1308,7 +1308,7 @@ private: ...@@ -1308,7 +1308,7 @@ private:
* *
* **Feb 2015**<br> * **Feb 2015**<br>
* - MRAA supported added ( Galileo, Edison, etc) * - MRAA supported added ( Galileo, Edison, etc)
* - BBB/Linux support via spidev * - BBB/Linux support via spidev & MRAA
* *
* <b>Dec 2014 </b><br> * <b>Dec 2014 </b><br>
* - New: Intel Galileo now supported * - New: Intel Galileo now supported
...@@ -1319,31 +1319,44 @@ private: ...@@ -1319,31 +1319,44 @@ private:
* *
* If issues are discovered with the documentation, please report them <a href="https://github.com/TMRh20/tmrh20.github.io/issues"> here</a> * If issues are discovered with the documentation, please report them <a href="https://github.com/TMRh20/tmrh20.github.io/issues"> here</a>
* *
* <br>
* @section Useful Useful References * @section Useful Useful References
* *
* Please refer to:
* *
* @li <a href="http://tmrh20.github.io/RF24/classRF24.html"><b>RF24</b> Class Documentation</a> * @li <a href="http://tmrh20.github.io/RF24/classRF24.html"><b>RF24</b> Class Documentation</a>
* @li <a href="https://github.com/TMRh20/RF24/archive/master.zip"><b>Download</b></a> * @li <a href="https://github.com/TMRh20/RF24/archive/master.zip"><b>Download</b></a>
* @li <a href="http://tmrh20.blogspot.com/2014/03/high-speed-data-transfers-and-wireless.html"><b>My Blog:</b> RF24 Optimization Overview</a> * @li <a href="https://github.com/tmrh20/RF24/"><b>Source Code</b></a>
* @li <a href="https://github.com/tmrh20/RF24/"><b>Source Code</b></a> * @li <a href="http://tmrh20.blogspot.com/2014/03/high-speed-data-transfers-and-wireless.html"><b>My Blog:</b> RF24 Optimization Overview</a>
* @li <a href="http://www.nordicsemi.com/files/Product/data_sheet/nRF24L01_Product_Specification_v2_0.pdf">Chip Datasheet</a> * @li <a href="http://www.nordicsemi.com/files/Product/data_sheet/nRF24L01_Product_Specification_v2_0.pdf">Chip Datasheet</a>
* *
* **Additional Information and Add-ons** * **Additional Information and Add-ons**
*
* @li <a href="http://tmrh20.github.io/RF24Network"> <b>RF24Network:</b> OSI Network Layer for multi-device communication. Create a home sensor network.</a> * @li <a href="http://tmrh20.github.io/RF24Network"> <b>RF24Network:</b> OSI Network Layer for multi-device communication. Create a home sensor network.</a>
* @li <a href="http://tmrh20.github.io/RF24Mesh"> <b>RF24Mesh:</b> Dynamic Mesh Layer for RF24Network</a> * @li <a href="http://tmrh20.github.io/RF24Mesh"> <b>RF24Mesh:</b> Dynamic Mesh Layer for RF24Network</a>
* @li <a href="http://tmrh20.github.io/RF24Ethernet"> <b>RF24Ethernet:</b> TCP/IP over RF24Network </a> * @li <a href="http://tmrh20.github.io/RF24Ethernet"> <b>RF24Ethernet:</b> TCP/IP over RF24Network </a>
* @li <a href="http://tmrh20.github.io/RF24Audio"> <b>RF24Audio:</b> Realtime Wireless Audio streaming</a> * @li <a href="http://tmrh20.github.io/RF24Audio"> <b>RF24Audio:</b> Realtime Wireless Audio streaming</a>
* @li <a href="http://tmrh20.github.io/">All TMRh20 Documentation Main Page</a> * @li <a href="http://tmrh20.github.io/">All TMRh20 Documentation Main Page</a>
* @li <a href="https://github.com/maniacbug/RF24">Original Library</a>
* *
* **More Information and RF24 Based Projects**
*
* @li <a href="http://TMRh20.blogspot.com"> Project Blog: TMRh20.blogspot.com </a>
* @li <a href="http://maniacalbits.blogspot.ca/"> Maniacal Bits Blog</a>
* @li <a href="http://www.mysensors.org/">MySensors.org (User friendly sensor networks/IoT)</a>
* @li <a href="https://github.com/mannkind/RF24Node_MsgProto"> RF24Node_MsgProto (MQTT)</a>
* @li <a href="https://bitbucket.org/pjhardy/rf24sensornet/"> RF24SensorNet </a>
* @li <a href="http://www.homeautomationforgeeks.com/rf24software.shtml">Home Automation for Geeks</a>
* @li <a href="https://maniacbug.wordpress.com/2012/03/30/rf24network/"> Original Maniacbug RF24Network Blog Post</a>
* @li <a href="https://github.com/maniacbug/RF24"> ManiacBug on GitHub (Original Library Author)</a>
*
*
* <br>
* *
* @section Platform_Support Platform Support Pages * @section Platform_Support Platform Support Pages
* *
* @li <a href="Arduino.html">Arduino</a> (Uno, Nano, Mega, Due, Galileo, etc) * @li <a href="Arduino.html"><b>Arduino</b></a> (Uno, Nano, Mega, Due, Galileo, etc)
* @li <a href="ATTiny.html">ATTiny</a> * @li <a href="ATTiny.html"><b>ATTiny</b></a>
* @li Linux ( <a href="RPi.html">RPi</a> , <a href="BBB.html">BBB</a>, <a href="MRAA.html">MRAA</a> supported boards ( Galileo, Edison, etc)) * @li Linux ( <a href="RPi.html"><b>RPi</b></a> , <a href="BBB.html"><b>BBB</b></a>, <a href="MRAA.html"><b>MRAA</b></a> supported boards ( Galileo, Edison, etc))
* @li <a href="Python.html">Python</a> wrapper available * @li <a href="Python.html"><b>Python</b></a> wrapper available for RPi
* *
* <br> * <br>
* **General µC Pin layout** (See the individual board support pages for more info) * **General µC Pin layout** (See the individual board support pages for more info)
...@@ -1362,21 +1375,9 @@ private: ...@@ -1362,21 +1375,9 @@ private:
* | 7 | MISO | digIO 12 | pin 5 | pin 8 | MISO * | 7 | MISO | digIO 12 | pin 5 | pin 8 | MISO
* | 8 | IRQ | - | - | - | - * | 8 | IRQ | - | - | - | -
* *
* @li https://learn.sparkfun.com/tutorials/tiny-avr-programmer-hookup-guide/attiny85-use-hints * @li [0] https://learn.sparkfun.com/tutorials/tiny-avr-programmer-hookup-guide/attiny85-use-hints
* @li http://highlowtech.org/?p=1695 * @li [1] http://highlowtech.org/?p=1695
* @li http://littlewire.cc/ * @li [2] http://littlewire.cc/
*
* @section More More Information and RF24 Based Projects
*
* @li <a href="http://TMRh20.blogspot.com"> Project Blog: TMRh20.blogspot.com </a>
* @li <a href="http://maniacalbits.blogspot.ca/"> Maniacal Bits Blog</a>
* @li <a href="http://www.mysensors.org/">MySensors.org (User friendly sensor networks/IoT)</a>
* @li <a href="https://github.com/mannkind/RF24Node_MsgProto"> RF24Node_MsgProto (MQTT)</a>
* @li <a href="https://bitbucket.org/pjhardy/rf24sensornet/"> RF24SensorNet </a>
* @li <a href="http://www.homeautomationforgeeks.com/rf24software.shtml">Home Automation for Geeks</a>
* @li <a href="https://maniacbug.wordpress.com/2012/03/30/rf24network/"> Original Maniacbug RF24Network Blog Post</a>
* @li <a href="https://github.com/maniacbug/RF24"> ManiacBug on GitHub (Original Library Author)</a>
*
* <br><br><br> * <br><br><br>
* *
* *
...@@ -1514,12 +1515,19 @@ private: ...@@ -1514,12 +1515,19 @@ private:
* *
* @page BBB BeagleBone Black * @page BBB BeagleBone Black
* *
* BeagleBone Black is supported via MRAA or SPIDev, with MRAA being the preferred choice due to performance. * BeagleBone Black is supported via MRAA or SPIDEV, with MRAA being the preferred choice due to performance.
* *
* @warning At the time of this writing MRAA support for BBB is not yet completed. RF24 support for MRAA via BBB is included
* but is untested.
*
* @note With SPIDEV, Users may need to edit the RF24/arch/BBB/spi.cpp file to configure the spi device. (Default:
* "/dev/spidev1.0";; )
*
* <br> * <br>
* @section AutoInstall Automated Install * @section AutoInstall Automated Install
*(**Designed & Tested on RPi** - Defaults to SPIDev on BBB) *(**Designed & Tested on RPi** - Defaults to SPIDEV on BBB)
* *
*
* 1. Download the install.sh file from http://tmrh20.github.io/RF24Installer/RPi/install.sh * 1. Download the install.sh file from http://tmrh20.github.io/RF24Installer/RPi/install.sh
* @code wget http://tmrh20.github.io/RF24Installer/RPi/install.sh @endcode * @code wget http://tmrh20.github.io/RF24Installer/RPi/install.sh @endcode
* 2. Make it executable: * 2. Make it executable:
...@@ -1600,7 +1608,7 @@ private: ...@@ -1600,7 +1608,7 @@ private:
* *
* *
* *
* * @page RPi Raspberry Pi * @page RPi Raspberry Pi
* *
* RF24 supports a variety of Linux based devices via various drivers. Some boards like RPi can utilize multiple methods * RF24 supports a variety of Linux based devices via various drivers. Some boards like RPi can utilize multiple methods
* to drive the GPIO and SPI functionality. * to drive the GPIO and SPI functionality.
...@@ -1763,7 +1771,7 @@ private: ...@@ -1763,7 +1771,7 @@ private:
* *
* Install the library * Install the library
* *
* @code ./setup.py install @endcode * @code sudo ./setup.py install @endcode
* *
* *
* See the additional <a href="pages.html">Platform Support</a> pages for information on connecting your hardware <br> * See the additional <a href="pages.html">Platform Support</a> pages for information on connecting your hardware <br>
...@@ -1775,13 +1783,55 @@ private: ...@@ -1775,13 +1783,55 @@ private:
* *
* @code nano pingpair_dyn.py @endcode * @code nano pingpair_dyn.py @endcode
* *
* Configure another device, Arduino or RPi with the pingpair_dyn example * Configure another device, Arduino or RPi with the <a href="pingpair_dyn_8py-example.html">pingpair_dyn</a> example
* *
* Run the example * Run the example
* *
* @code sudo ./pingpair_dyn.py @endcode * @code sudo ./pingpair_dyn.py @endcode
* *
* <br><br><br> * <br><br><br>
*
*
* @page Portability RF24 Portability
*
* The RF24 radio driver mainly utilizes the <a href="http://arduino.cc/en/reference/homePage">Arduino API</a> for GPIO, SPI, and timing functions, which are easily replicated
* on various platforms. <br>Support files for these platforms are stored under RF24/arch, and can be modified to provide
* the required functionality.
*
* <br>
* @section Hardware_Templates Basic Hardware Template
*
* **RF24/arch/**
*
* The RF24 library now includes a basic hardware template to assist in porting to various platforms. <br> The following files can be included
* to replicate standard Arduino functions as needed, allowing devices from ATTiny to Raspberry Pi to utilize the same core RF24 driver.
*
* | File | Purpose |
* |--------------------|------------------------------------------------------------------------------|
* | RF24_arch_config.h | Basic Arduino/AVR compatibility, includes for remaining support files, etc |
* | includes.h | Linux only. Defines specific platform, include correct RF24_arch_config file |
* | spi.h | Provides standardized SPI ( spi.transfer() ) methods |
* | gpio.h | Provides standardized GPIO ( digitalWrite() ) methods |
* | compatibility.h | Provides standardized timing (millis(), delay()) methods |
* | your_custom_file.h | Provides access to custom drivers for spi,gpio, etc |
*
* <br>
* Examples are provided via the included hardware support templates in **RF24/arch/** <br>
* See **RF24/arch/BBB** for a general Linux template.
*
*<br>
* @section Device_Detection Device Detection
*
* 1. The main detection for Linux devices is done in the Makefile, with the includes.h from the proper hardware directory copied to RF24/arch/includes.h <br>
* 2. Secondary detection is completed in RF24_config.h, causing the include.h file to be included for all supported Linux devices <br>
* 3. RF24.h contains the declaration for SPI and GPIO objects 'spi' and 'gpio' to be used for porting-in related functions.
*
* <br>
* @section Ported_Code Code
* To have your ported code included in this library, or for assistance in porting, create a pull request or open an issue at https://github.com/TMRh20/RF24
*
*
*<br><br><br>
*/ */
#endif // __RF24_H__ #endif // __RF24_H__
......
// ATTiny support code is from https://github.com/jscrane/RF24 // ATTiny support code is from https://github.com/jscrane/RF24
/**
* @file spi.h
* \cond HIDDEN_SYMBOLS
* Class declaration for SPI helper files
*/
#include <stdio.h> #include <stdio.h>
#include <Arduino.h> #include <Arduino.h>
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
...@@ -40,4 +46,8 @@ public: ...@@ -40,4 +46,8 @@ public:
static void setDataMode(uint8_t); static void setDataMode(uint8_t);
static void setClockDivider(uint8_t); static void setClockDivider(uint8_t);
}; };
extern SPIClass SPI; extern SPIClass SPI;
\ No newline at end of file
/**
* \endcond
*/
\ No newline at end of file
...@@ -14,6 +14,23 @@ ...@@ -14,6 +14,23 @@
#include <cstdio> #include <cstdio>
/**
* @file gpio.h
* \cond HIDDEN_SYMBOLS
* Class declaration for GPIO helper files
*/
/**
* Example GPIO.h file
*
* @defgroup GPIO GPIO Example
*
* See RF24_arch_config.h for additional information
* @{
*/
class GPIO { class GPIO {
public: public:
...@@ -27,7 +44,7 @@ public: ...@@ -27,7 +44,7 @@ public:
GPIO(); GPIO();
/** /**
* * Similar to Arduino pinMode(pin,mode);
* @param port * @param port
* @param DDR * @param DDR
*/ */
...@@ -38,13 +55,13 @@ public: ...@@ -38,13 +55,13 @@ public:
*/ */
static void close(int port); static void close(int port);
/** /**
* * Similar to Arduino digitalRead(pin);
* @param port * @param port
* @param value * @param value
*/ */
static int read(int port); static int read(int port);
/** /**
* * Similar to Arduino digitalWrite(pin,state);
* @param port * @param port
* @param value * @param value
*/ */
...@@ -55,6 +72,9 @@ public: ...@@ -55,6 +72,9 @@ public:
private: private:
}; };
/**
* \endcond
*/
/*@}*/
#endif /* H */ #endif /* H */
...@@ -8,6 +8,21 @@ ...@@ -8,6 +8,21 @@
#ifndef SPI_H #ifndef SPI_H
#define SPI_H #define SPI_H
/**
* @file spi.h
* \cond HIDDEN_SYMBOLS
* Class declaration for SPI helper files
*/
/**
* Example GPIO.h file
*
* @defgroup SPI SPI Example
*
* See RF24_arch_config.h for additional information
* @{
*/
#include <string> #include <string>
#include <stdint.h> #include <stdint.h>
#include <unistd.h> #include <unistd.h>
...@@ -27,27 +42,58 @@ using namespace std; ...@@ -27,27 +42,58 @@ using namespace std;
class SPI { class SPI {
public: public:
/**
* SPI constructor
*/
SPI(); SPI();
/**
* Start SPI
*/
void begin(); void begin();
/**
* Transfer a single byte
* @param tx_ Byte to send
* @return Data returned via spi
*/
uint8_t transfer(uint8_t tx_); 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); 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); void transfern(char* buf, uint32_t len);
virtual ~SPI(); virtual ~SPI();
private: private:
// Default SPI device /** Default SPI device */
string device; string device;
// SPI Mode set /** SPI Mode set */
uint8_t mode; uint8_t mode;
// word size /** word size*/
uint8_t bits; uint8_t bits;
// Set SPI speed /** Set SPI speed*/
uint32_t speed; uint32_t speed;
int fd; int fd;
void init(); void init();
}; };
/**
* \endcond
*/
/*@}*/
#endif /* SPI_H */ #endif /* SPI_H */
...@@ -5,7 +5,11 @@ ...@@ -5,7 +5,11 @@
#ifndef RF24_ARCH_GPIO_H #ifndef RF24_ARCH_GPIO_H
#define RF24_ARCH_GPIO_H #define RF24_ARCH_GPIO_H
/**
* @file spi.h
* \cond HIDDEN_SYMBOLS
* Class declaration for GPIO helper files
*/
#include <cstdio> #include <cstdio>
#include <stdio.h> #include <stdio.h>
#include "mraa.hpp" #include "mraa.hpp"
...@@ -56,6 +60,8 @@ private: ...@@ -56,6 +60,8 @@ private:
mraa::Gpio* gpio_0; /** gpio object for ce_pin **/ mraa::Gpio* gpio_0; /** gpio object for ce_pin **/
mraa::Gpio* gpio_1; /** gpio object for cs_pin **/ mraa::Gpio* gpio_1; /** gpio object for cs_pin **/
}; };
/**
* \endcond
*/
#endif /* RF24_ARCH_GPIO_H */ #endif /* RF24_ARCH_GPIO_H */
...@@ -5,7 +5,11 @@ ...@@ -5,7 +5,11 @@
#ifndef _SPI_H_INCLUDED #ifndef _SPI_H_INCLUDED
#define _SPI_H_INCLUDED #define _SPI_H_INCLUDED
/**
* @file spi.h
* \cond HIDDEN_SYMBOLS
* Class declaration for SPI helper files
*/
#include <stdio.h> #include <stdio.h>
#include "mraa.hpp" #include "mraa.hpp"
...@@ -45,5 +49,7 @@ void SPI::transfern(char* buf, uint32_t len) ...@@ -45,5 +49,7 @@ void SPI::transfern(char* buf, uint32_t len)
transfernb(buf, buf, len); transfernb(buf, buf, len);
} }
/**
* \endcond
*/
#endif #endif
...@@ -2,7 +2,11 @@ ...@@ -2,7 +2,11 @@
* TMRh20 2015 * TMRh20 2015
* SPI layer for RF24 <-> BCM2835 * SPI layer for RF24 <-> BCM2835
*/ */
/**
* @file spi.h
* \cond HIDDEN_SYMBOLS
* Class declaration for SPI helper files
*/
#ifndef _SPI_H_INCLUDED #ifndef _SPI_H_INCLUDED
#define _SPI_H_INCLUDED #define _SPI_H_INCLUDED
...@@ -41,5 +45,7 @@ void SPI::transfern(char* buf, uint32_t len) ...@@ -41,5 +45,7 @@ void SPI::transfern(char* buf, uint32_t len)
{ {
transfernb(buf, buf, len); transfernb(buf, buf, len);
} }
/**
* \endcond
*/
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment