Skip to content

Commit f688cad

Browse files
committed
publicly expose ce() for advanced uses.
applied to python wrapper also
1 parent 293b841 commit f688cad

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

RF24.h

+19-11
Original file line numberDiff line numberDiff line change
@@ -644,17 +644,33 @@ class RF24
644644
*/
645645
/**@{*/
646646

647+
/**
648+
* Set radio's CE (Chip Enable) pin state.
649+
*
650+
* @warning Please see the datasheet for a much more detailed description of this pin.
651+
*
652+
* @note This is only publicly exposed for advanced use cases such as complex networking or
653+
* streaming consecutive payloads without robust error handling.
654+
* Typical uses are satisfied by simply using `startListening()` for RX mode or
655+
* `stopListening()` and `write()` for TX mode.
656+
*
657+
* @param level In RX mode, `HIGH` causes the radio to begin actively listening.
658+
* In TX mode, `HIGH` (+ 130 microsecond delay) causes the radio to begin transmitting.
659+
* Setting this to `LOW` will cause the radio to stop transmitting or receiving in any mode.
660+
*/
661+
void ce(bool level);
662+
647663
/**
648664
* Print a giant block of debugging information to stdout
649665
*
650666
* @warning Does nothing if stdout is not defined. See fdevopen in stdio.h
651667
* The printf.h file is included with the library for Arduino.
652668
* @code
653669
* #include <printf.h>
654-
* setup(){
670+
* setup() {
655671
* Serial.begin(115200);
656672
* printf_begin();
657-
* ...
673+
* // ...
658674
* }
659675
* @endcode
660676
*/
@@ -671,7 +687,7 @@ class RF24
671687
* The printf.h file is included with the library for Arduino.
672688
* @code
673689
* #include <printf.h>
674-
* setup(){
690+
* setup() {
675691
* Serial.begin(115200);
676692
* printf_begin();
677693
* // ...
@@ -2057,14 +2073,6 @@ class RF24
20572073
*/
20582074
void csn(bool mode);
20592075

2060-
/**
2061-
* Set chip enable
2062-
*
2063-
* @param level HIGH to actively begin transmission or LOW to put in standby. Please see data sheet
2064-
* for a much more detailed description of this pin.
2065-
*/
2066-
void ce(bool level);
2067-
20682076
/**
20692077
* Write a chunk of data to a register
20702078
*

pyRF24/pyRF24.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ BOOST_PYTHON_MODULE(RF24)
331331
.def("available_pipe", &available_wrap) // needed to rename this method as python does not allow such overloading
332332
.def("begin", (bool(::RF24::*)(void))(&::RF24::begin))
333333
.def("begin", &begin_with_pins)
334+
.def("ce", &::RF24::ce)
334335
.def("closeReadingPipe", &RF24::closeReadingPipe)
335336
.def("disableCRC", &RF24::disableCRC)
336337
.def("enableAckPayload", &RF24::enableAckPayload)

0 commit comments

Comments
 (0)