Skip to content

Commit

Permalink
some more self-reviewed PR changes
Browse files Browse the repository at this point in the history
  • Loading branch information
2bndy5 committed Dec 7, 2020
1 parent 2c2775c commit ec63387
Show file tree
Hide file tree
Showing 10 changed files with 151 additions and 154 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 8 additions & 10 deletions RF24.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,31 +40,27 @@ typedef enum {
* -18 dBm | -6 dBm | -12 dBm
*/
RF24_PA_MIN = 0,

/**
* (1) represents:
* nRF24L01 | Si24R1 with<br>lnaEnabled = 1 | Si24R1 with<br>lnaEnabled = 0
* :-------:|:-----------------------------:|:----------------------------:
* -12 dBm | 0 dBm | -4 dBm
*/
RF24_PA_LOW,

/**
* (2) represents:
* nRF24L01 | Si24R1 with<br>lnaEnabled = 1 | Si24R1 with<br>lnaEnabled = 0
* :-------:|:-----------------------------:|:----------------------------:
* -6 dBm | 3 dBm | 1 dBm
*/
RF24_PA_HIGH,

/**
* (3) represents:
* nRF24L01 | Si24R1 with<br>lnaEnabled = 1 | Si24R1 with<br>lnaEnabled = 0
* :-------:|:-----------------------------:|:----------------------------:
* 0 dBm | 7 dBm | 4 dBm
*/
RF24_PA_MAX,

/**
* (4) This should not be used and remains for backward compatibility.
*/
Expand Down Expand Up @@ -109,7 +105,7 @@ typedef enum {

/**
* @}
* Driver for nRF24L01(+) 2.4GHz Wireless Transceiver
* @brief Driver class for nRF24L01(+) 2.4GHz Wireless Transceiver
*/

class RF24 {
Expand Down Expand Up @@ -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 <br>
* See [Related Pages](pages.html) for device specific information <br>
*
* @note Users can specify default SPI speed by modifying `#define RF24_SPI_SPEED` in RF24_config.h <br>
* For Arduino, SPI speed will only be properly configured this way on devices supporting SPI TRANSACTIONS <br>
Expand Down Expand Up @@ -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.<br>
Expand All @@ -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.:
*
Expand Down
5 changes: 2 additions & 3 deletions utility/ATXMegaD3/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @{
*/
#ifndef GPIO_H
#define GPIO_H
#define GPIO_H

#include <avr/io.h>
#include "gpio_helper.h"
Expand Down Expand Up @@ -46,7 +46,6 @@ class GPIO {
/**
* Similar to Arduino digitalRead(pin);
* @param port
* @param value
*/
static int read(int port);

Expand All @@ -62,4 +61,4 @@ class GPIO {
};

#endif /* GPIO_H */
/*@}*/
/*@}*/
5 changes: 3 additions & 2 deletions utility/MRAA/RF24_arch_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
//#include <UtilTime.h> // 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))
Expand All @@ -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__
Expand Down
13 changes: 6 additions & 7 deletions utility/MRAA/gpio.h
Original file line number Diff line number Diff line change
@@ -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 <cstdio>
Expand Down Expand Up @@ -46,7 +46,6 @@ class GPIO {
/**
*
* @param port
* @param value
*/
int read(int port);

Expand All @@ -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 */

31 changes: 15 additions & 16 deletions utility/Template/RF24_arch_config.h
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
/*
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.
* 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.
*
*/

/**
* @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__
Expand Down
19 changes: 9 additions & 10 deletions utility/Template/compatibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
92 changes: 45 additions & 47 deletions utility/Template/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,57 +6,55 @@
*/

/**
* Example of gpio.h class declaration for GPIO portability
*
* @defgroup Porting_GPIO Porting: GPIO
*
*
* @{
*/
#ifndef H
#define H

#include <cstdio>

//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 <cstdio>
/**
* 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();
};

/**@}*/
/**@}*/
23 changes: 11 additions & 12 deletions utility/Template/includes.h
Original file line number Diff line number Diff line change
@@ -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__
Expand All @@ -22,9 +21,9 @@

/**
* Load the correct configuration for this platform
*/
*/
#include "BBB/RF24_arch_config.h"

#endif

/**@}*/
/**@}*/
Loading

0 comments on commit ec63387

Please sign in to comment.