Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RF24
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
RF24
Commits
0a8b1d3d
Commit
0a8b1d3d
authored
Aug 02, 2015
by
komby
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/TMRh20/RF24
parents
c4d222ce
7005c479
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
24 deletions
+38
-24
RF24.cpp
RF24.cpp
+8
-12
RF24.h
RF24.h
+4
-0
RF24_config.h
RF24_config.h
+0
-11
examples_RPi/gettingstarted_call_response.cpp
examples_RPi/gettingstarted_call_response.cpp
+1
-1
library.json
library.json
+25
-0
No files found.
RF24.cpp
View file @
0a8b1d3d
...
@@ -388,11 +388,9 @@ void RF24::print_byte_register(const char* name, uint8_t reg, uint8_t qty)
...
@@ -388,11 +388,9 @@ void RF24::print_byte_register(const char* name, uint8_t reg, uint8_t qty)
//char extra_tab = strlen_P(name) < 8 ? '\t' : 0;
//char extra_tab = strlen_P(name) < 8 ? '\t' : 0;
//printf_P(PSTR(PRIPSTR"\t%c ="),name,extra_tab);
//printf_P(PSTR(PRIPSTR"\t%c ="),name,extra_tab);
#if defined (RF24_LINUX)
#if defined (RF24_LINUX)
char
extra_tab
=
strlen_P
(
name
)
<
8
?
'\t'
:
0
;
printf
(
"%s
\t
="
,
name
);
printf
(
"%s
\t
%c ="
,
name
,
extra_tab
);
#else
#else
char
extra_tab
=
strlen_P
(
name
)
<
8
?
'\t'
:
0
;
printf_P
(
PSTR
(
PRIPSTR
"
\t
="
),
name
);
printf_P
(
PSTR
(
PRIPSTR
"
\t
%c ="
),
name
,
extra_tab
);
#endif
#endif
while
(
qty
--
)
while
(
qty
--
)
printf_P
(
PSTR
(
" 0x%02x"
),
read_register
(
reg
++
));
printf_P
(
PSTR
(
" 0x%02x"
),
read_register
(
reg
++
));
...
@@ -405,11 +403,9 @@ void RF24::print_address_register(const char* name, uint8_t reg, uint8_t qty)
...
@@ -405,11 +403,9 @@ void RF24::print_address_register(const char* name, uint8_t reg, uint8_t qty)
{
{
#if defined (RF24_LINUX)
#if defined (RF24_LINUX)
char
extra_tab
=
strlen_P
(
name
)
<
8
?
'\t'
:
0
;
printf
(
"%s
\t
="
,
name
);
printf
(
"%s
\t
%c ="
,
name
,
extra_tab
);
#else
#else
char
extra_tab
=
strlen_P
(
name
)
<
8
?
'\t'
:
0
;
printf_P
(
PSTR
(
PRIPSTR
"
\t
="
),
name
);
printf_P
(
PSTR
(
PRIPSTR
"
\t
%c ="
),
name
,
extra_tab
);
#endif
#endif
while
(
qty
--
)
while
(
qty
--
)
{
{
...
@@ -560,14 +556,14 @@ void RF24::printDetails(void)
...
@@ -560,14 +556,14 @@ void RF24::printDetails(void)
print_address_register
(
PSTR
(
"RX_ADDR_P0-1"
),
RX_ADDR_P0
,
2
);
print_address_register
(
PSTR
(
"RX_ADDR_P0-1"
),
RX_ADDR_P0
,
2
);
print_byte_register
(
PSTR
(
"RX_ADDR_P2-5"
),
RX_ADDR_P2
,
4
);
print_byte_register
(
PSTR
(
"RX_ADDR_P2-5"
),
RX_ADDR_P2
,
4
);
print_address_register
(
PSTR
(
"TX_ADDR"
),
TX_ADDR
);
print_address_register
(
PSTR
(
"TX_ADDR
\t
"
),
TX_ADDR
);
print_byte_register
(
PSTR
(
"RX_PW_P0-6"
),
RX_PW_P0
,
6
);
print_byte_register
(
PSTR
(
"RX_PW_P0-6"
),
RX_PW_P0
,
6
);
print_byte_register
(
PSTR
(
"EN_AA"
),
EN_AA
);
print_byte_register
(
PSTR
(
"EN_AA
\t
"
),
EN_AA
);
print_byte_register
(
PSTR
(
"EN_RXADDR"
),
EN_RXADDR
);
print_byte_register
(
PSTR
(
"EN_RXADDR"
),
EN_RXADDR
);
print_byte_register
(
PSTR
(
"RF_CH"
),
RF_CH
);
print_byte_register
(
PSTR
(
"RF_CH
\t
"
),
RF_CH
);
print_byte_register
(
PSTR
(
"RF_SETUP"
),
RF_SETUP
);
print_byte_register
(
PSTR
(
"RF_SETUP"
),
RF_SETUP
);
print_byte_register
(
PSTR
(
"CONFIG"
),
CONFIG
);
print_byte_register
(
PSTR
(
"CONFIG
\t
"
),
CONFIG
);
print_byte_register
(
PSTR
(
"DYNPD/FEATURE"
),
DYNPD
,
2
);
print_byte_register
(
PSTR
(
"DYNPD/FEATURE"
),
DYNPD
,
2
);
#if defined(__arm__) || defined (RF24_LINUX) || defined (__ARDUINO_X86__) || defined(LITTLEWIRE) || defined (RF24_BBB)
#if defined(__arm__) || defined (RF24_LINUX) || defined (__ARDUINO_X86__) || defined(LITTLEWIRE) || defined (RF24_BBB)
...
...
RF24.h
View file @
0a8b1d3d
...
@@ -502,6 +502,8 @@ s *
...
@@ -502,6 +502,8 @@ s *
* @warning Only three of these can be pending at any time as there are only 3 FIFO buffers.<br> Dynamic payloads must be enabled.
* @warning Only three of these can be pending at any time as there are only 3 FIFO buffers.<br> Dynamic payloads must be enabled.
* @note Ack payloads are handled automatically by the radio chip when a payload is received. Users should generally
* @note Ack payloads are handled automatically by the radio chip when a payload is received. Users should generally
* write an ack payload as soon as startListening() is called, so one is available when a regular payload is received.
* write an ack payload as soon as startListening() is called, so one is available when a regular payload is received.
* @note Ack payloads are dynamic payloads. This only works on pipes 0&1 by default. Call
* enableDynamicPayloads() to enable on all pipes.
*
*
* @param pipe Which pipe# (typically 1-5) will get this response.
* @param pipe Which pipe# (typically 1-5) will get this response.
* @param buf Pointer to data that is sent
* @param buf Pointer to data that is sent
...
@@ -768,6 +770,8 @@ s *
...
@@ -768,6 +770,8 @@ s *
* Ack payloads are a handy way to return data back to senders without
* Ack payloads are a handy way to return data back to senders without
* manually changing the radio modes on both units.
* manually changing the radio modes on both units.
*
*
* @note Ack payloads are dynamic payloads. This only works on pipes 0&1 by default. Call
* enableDynamicPayloads() to enable on all pipes.
*/
*/
void
enableAckPayload
(
void
);
void
enableAckPayload
(
void
);
...
...
RF24_config.h
View file @
0a8b1d3d
...
@@ -112,17 +112,6 @@
...
@@ -112,17 +112,6 @@
#define _BV(bit) (1<<(bit))
#define _BV(bit) (1<<(bit))
#endif
#endif
// Avoid spurious warnings
// Arduino DUE is arm and uses traditional PROGMEM constructs
#if 1
#if ! defined( NATIVE ) && defined( ARDUINO ) && ! defined(__arm__)
#undef PROGMEM
#define PROGMEM __attribute__(( section(".progmem.data") ))
#undef PSTR
#define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];}))
#endif
#endif
// Progmem is Arduino-specific
// Progmem is Arduino-specific
// Arduino DUE is arm and does not include avr/pgmspace
// Arduino DUE is arm and does not include avr/pgmspace
#if defined(ARDUINO) && ! defined(__arm__) && !defined (__ARDUINO_X86__)
#if defined(ARDUINO) && ! defined(__arm__) && !defined (__ARDUINO_X86__)
...
...
examples_RPi/gettingstarted_call_response.cpp
View file @
0a8b1d3d
...
@@ -84,7 +84,7 @@ int main(int argc, char** argv){
...
@@ -84,7 +84,7 @@ int main(int argc, char** argv){
printf
(
"RPi/RF24/examples/gettingstarted_call_response
\n
"
);
printf
(
"RPi/RF24/examples/gettingstarted_call_response
\n
"
);
radio
.
begin
();
radio
.
begin
();
radio
.
enableAckPayload
();
// Allow optional ack payloads
radio
.
enableAckPayload
();
// Allow optional ack payloads
radio
.
enableDynamic
Ack
();
radio
.
enableDynamic
Payloads
();
radio
.
printDetails
();
// Dump the configuration of the rf unit for debugging
radio
.
printDetails
();
// Dump the configuration of the rf unit for debugging
...
...
library.json
0 → 100644
View file @
0a8b1d3d
{
"name"
:
"RF24"
,
"keywords"
:
"rf, radio, wireless, spi"
,
"description"
:
"Optimized High Speed Driver for nRF24L01(+) 2.4GHz Wireless Transceiver"
,
"repository"
:
{
"type"
:
"git"
,
"url"
:
"https://github.com/TMRh20/RF24.git"
},
"include"
:
[
"*.h"
,
"*.c"
,
"*.cpp"
,
"arch/ATTiny/*"
,
"arch/Due/*"
,
"arch/Teensy/*"
,
"examples/*/*.ino"
],
"frameworks"
:
"arduino"
,
"platforms"
:
[
"atmelavr"
,
"atmelsam"
,
"teensy"
]
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment