@@ -463,13 +463,13 @@ class RF24
463
463
* that received the next available payload. According to the datasheet,
464
464
* the data about the pipe number that received the next available payload
465
465
* is "unreliable" during a FALLING transition on the IRQ pin. This means
466
- * you should call whatHappened () before calling this function
466
+ * you should call clearStatusFlags () before calling this function
467
467
* during an ISR (Interrupt Service Routine). For example:
468
468
* @code
469
469
* void isrCallbackFunction() {
470
470
* bool tx_ds, tx_df, rx_dr;
471
- * radio.whatHappened(tx_ds, tx_df, rx_dr ); // resets the IRQ pin to HIGH
472
- * radio.available(); // returned data should now be reliable
471
+ * uint8_t flags = radio.clearStatusFlags( ); // resets the IRQ pin to HIGH
472
+ * radio.available(); // returned data should now be reliable
473
473
* }
474
474
*
475
475
* void setup() {
@@ -884,7 +884,7 @@ class RF24
884
884
*
885
885
* @warning According to the datasheet, the data saved to `pipe_num` is
886
886
* "unreliable" during a FALLING transition on the IRQ pin. This means you
887
- * should call whatHappened () before calling this function during
887
+ * should call clearStatusFlags () before calling this function during
888
888
* an ISR (Interrupt Service Routine). For example:
889
889
* @code
890
890
* void isrCallbackFunction() {
@@ -1241,38 +1241,6 @@ class RF24
1241
1241
*/
1242
1242
bool writeAckPayload (uint8_t pipe, const void * buf, uint8_t len);
1243
1243
1244
- /* *
1245
- * Call this when you get an Interrupt Request (IRQ) to find out why
1246
- *
1247
- * This function describes what event triggered the IRQ pin to go active
1248
- * LOW and clears the status of all events.
1249
- *
1250
- * @see maskIRQ()
1251
- *
1252
- * @param[out] tx_ok The transmission attempt completed (TX_DS). This does
1253
- * not imply that the transmitted data was received by another radio, rather
1254
- * this only reports if the attempt to send was completed. This will
1255
- * always be `true` when the auto-ack feature is disabled.
1256
- * @param[out] tx_fail The transmission failed to be acknowledged, meaning
1257
- * too many retries (MAX_RT) were made while expecting an ACK packet. This
1258
- * event is only triggered when auto-ack feature is enabled.
1259
- * @param[out] rx_ready There is a newly received payload (RX_DR) saved to
1260
- * RX FIFO buffers. Remember that the RX FIFO can only hold up to 3
1261
- * payloads. Once the RX FIFO is full, all further received transmissions
1262
- * are rejected until there is space to save new data in the RX FIFO
1263
- * buffers.
1264
- *
1265
- * @note This function expects no parameters in the python wrapper.
1266
- * Instead, this function returns a 3 item tuple describing the IRQ
1267
- * events' status. To use this function in the python wrapper:
1268
- * @code{.py}
1269
- * # let`radio` be the instantiated RF24 object
1270
- * tx_ds, tx_df, rx_dr = radio.whatHappened() # get IRQ status flags
1271
- * print("tx_ds: {}, tx_df: {}, rx_dr: {}".format(tx_ds, tx_df, rx_dr))
1272
- * @endcode
1273
- */
1274
- void whatHappened (bool & tx_ok, bool & tx_fail, bool & rx_ready);
1275
-
1276
1244
/* *
1277
1245
* Clear the StatusFlags that caused an interrupt event.
1278
1246
*
@@ -1369,13 +1337,13 @@ class RF24
1369
1337
* Non-blocking write to the open writing pipe
1370
1338
*
1371
1339
* Just like write(), but it returns immediately. To find out what happened
1372
- * to the send, catch the IRQ and then call whatHappened ().
1340
+ * to the send, catch the IRQ and then call clearStatusFlags() or getStatusFlags ().
1373
1341
*
1374
1342
* @see
1375
1343
* - write()
1376
1344
* - writeFast()
1377
1345
* - startFastWrite()
1378
- * - whatHappened ()
1346
+ * - clearStatusFlags ()
1379
1347
* - setAutoAck() (for single noAck writes)
1380
1348
*
1381
1349
* @param buf Pointer to the data to be sent
@@ -1892,38 +1860,6 @@ class RF24
1892
1860
*/
1893
1861
void disableCRC (void );
1894
1862
1895
- /* *
1896
- * This function is used to configure what events will trigger the Interrupt
1897
- * Request (IRQ) pin active LOW.
1898
- * The following events can be configured:
1899
- * 1. "data sent": This does not mean that the data transmitted was
1900
- * received, only that the attempt to send it was complete.
1901
- * 2. "data failed": This means the data being sent was not received. This
1902
- * event is only triggered when the auto-ack feature is enabled.
1903
- * 3. "data received": This means that data from a receiving payload has
1904
- * been loaded into the RX FIFO buffers. Remember that there are only 3
1905
- * levels available in the RX FIFO buffers.
1906
- *
1907
- * By default, all events are configured to trigger the IRQ pin active LOW.
1908
- * When the IRQ pin is active, use whatHappened() to determine what events
1909
- * triggered it. Remember that calling whatHappened() also clears these
1910
- * events' status, and the IRQ pin will then be reset to inactive HIGH.
1911
- *
1912
- * The following code configures the IRQ pin to only reflect the "data received"
1913
- * event:
1914
- * @code
1915
- * radio.maskIRQ(1, 1, 0);
1916
- * @endcode
1917
- *
1918
- * @param tx_ok `true` ignores the "data sent" event, `false` reflects the
1919
- * "data sent" event on the IRQ pin.
1920
- * @param tx_fail `true` ignores the "data failed" event, `false` reflects the
1921
- * "data failed" event on the IRQ pin.
1922
- * @param rx_ready `true` ignores the "data received" event, `false` reflects the
1923
- * "data received" event on the IRQ pin.
1924
- */
1925
- void maskIRQ (bool tx_ok, bool tx_fail, bool rx_ready);
1926
-
1927
1863
/* *
1928
1864
*
1929
1865
* The driver will delay for this duration when stopListening() is called
@@ -2059,6 +1995,76 @@ class RF24
2059
1995
*/
2060
1996
bool isAckPayloadAvailable (void );
2061
1997
1998
+ /* *
1999
+ * This function is used to configure what events will trigger the Interrupt
2000
+ * Request (IRQ) pin active LOW.
2001
+ *
2002
+ * @deprecated Use setStatusFlags() instead.
2003
+ *
2004
+ * The following events can be configured:
2005
+ * 1. "data sent": This does not mean that the data transmitted was
2006
+ * received, only that the attempt to send it was complete.
2007
+ * 2. "data failed": This means the data being sent was not received. This
2008
+ * event is only triggered when the auto-ack feature is enabled.
2009
+ * 3. "data received": This means that data from a receiving payload has
2010
+ * been loaded into the RX FIFO buffers. Remember that there are only 3
2011
+ * levels available in the RX FIFO buffers.
2012
+ *
2013
+ * By default, all events are configured to trigger the IRQ pin active LOW.
2014
+ * When the IRQ pin is active, use clearStatusFlags() or getStatusFlags() to
2015
+ * determine what events triggered it.
2016
+ * Remember that calling clearStatusFlags() also clears these
2017
+ * events' status, and the IRQ pin will then be reset to inactive HIGH.
2018
+ *
2019
+ * The following code configures the IRQ pin to only reflect the "data received"
2020
+ * event:
2021
+ * @code
2022
+ * radio.maskIRQ(1, 1, 0);
2023
+ * @endcode
2024
+ *
2025
+ * @param tx_ok `true` ignores the "data sent" event, `false` reflects the
2026
+ * "data sent" event on the IRQ pin.
2027
+ * @param tx_fail `true` ignores the "data failed" event, `false` reflects the
2028
+ * "data failed" event on the IRQ pin.
2029
+ * @param rx_ready `true` ignores the "data received" event, `false` reflects the
2030
+ * "data received" event on the IRQ pin.
2031
+ */
2032
+ void maskIRQ (bool tx_ok, bool tx_fail, bool rx_ready);
2033
+
2034
+ /* *
2035
+ * Call this when you get an Interrupt Request (IRQ) to find out why
2036
+ *
2037
+ * This function describes what event triggered the IRQ pin to go active
2038
+ * LOW and clears the status of all events.
2039
+ *
2040
+ * @deprecated Use clearStatusFlags() instead.
2041
+ *
2042
+ * @see setStatusFlags()
2043
+ *
2044
+ * @param[out] tx_ok The transmission attempt completed (TX_DS). This does
2045
+ * not imply that the transmitted data was received by another radio, rather
2046
+ * this only reports if the attempt to send was completed. This will
2047
+ * always be `true` when the auto-ack feature is disabled.
2048
+ * @param[out] tx_fail The transmission failed to be acknowledged, meaning
2049
+ * too many retries (MAX_RT) were made while expecting an ACK packet. This
2050
+ * event is only triggered when auto-ack feature is enabled.
2051
+ * @param[out] rx_ready There is a newly received payload (RX_DR) saved to
2052
+ * RX FIFO buffers. Remember that the RX FIFO can only hold up to 3
2053
+ * payloads. Once the RX FIFO is full, all further received transmissions
2054
+ * are rejected until there is space to save new data in the RX FIFO
2055
+ * buffers.
2056
+ *
2057
+ * @note This function expects no parameters in the python wrapper.
2058
+ * Instead, this function returns a 3 item tuple describing the IRQ
2059
+ * events' status. To use this function in the python wrapper:
2060
+ * @code{.py}
2061
+ * # let`radio` be the instantiated RF24 object
2062
+ * tx_ds, tx_df, rx_dr = radio.whatHappened() # get IRQ status flags
2063
+ * print("tx_ds: {}, tx_df: {}, rx_dr: {}".format(tx_ds, tx_df, rx_dr))
2064
+ * @endcode
2065
+ */
2066
+ void whatHappened (bool & tx_ok, bool & tx_fail, bool & rx_ready);
2067
+
2062
2068
private:
2063
2069
/* *@}*/
2064
2070
/* *
0 commit comments