Some improvement on mrcrsch's RF24 library
Fork of RF24_fork by
Revision 13:d295c8b3f742, committed 2018-09-19
- Comitter:
- gume
- Date:
- Wed Sep 19 22:50:11 2018 +0000
- Parent:
- 12:9a4127130006
- Commit message:
- adapted radio presence test
Changed in this revision
RF24.cpp | Show annotated file Show diff for this revision Revisions of this file |
RF24.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 9a4127130006 -r d295c8b3f742 RF24.cpp --- a/RF24.cpp Sat Apr 22 10:52:01 2017 +0000 +++ b/RF24.cpp Wed Sep 19 22:50:11 2018 +0000 @@ -1315,3 +1315,11 @@ write_register(SETUP_RETR,(delay&0xf)<<ARD | (count&0xf)<<ARC); } +/****************************************************************************/ +bool RF24::isChipConnected() +{ + uint8_t setup = read_register(SETUP_AW); + if(setup >= 1 && setup <= 3) return true; + + return false; +} \ No newline at end of file
diff -r 9a4127130006 -r d295c8b3f742 RF24.h --- a/RF24.h Sat Apr 22 10:52:01 2017 +0000 +++ b/RF24.h Wed Sep 19 22:50:11 2018 +0000 @@ -943,6 +943,11 @@ */ void openWritingPipe(uint64_t address); + /** + * Checks if the chip is connected to the SPI bus + */ + bool isChipConnected(); + private: /**