Skip to content

Commit

Permalink
Added isChipConnected(). (#291)
Browse files Browse the repository at this point in the history
Fix for #272
  • Loading branch information
wmarkow authored and Avamander committed May 3, 2017
1 parent 7eb704a commit 6341dd0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
13 changes: 13 additions & 0 deletions RF24.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,19 @@ bool RF24::begin(void)

/****************************************************************************/

bool RF24::isChipConnected()
{
uint8_t setup = read_register(SETUP_AW);
if(setup >= 1 && setup <= 3)
{
return true;
}

return false;
}

/****************************************************************************/

void RF24::startListening(void)
{
#if !defined (RF24_TINY) && ! defined(LITTLEWIRE)
Expand Down
5 changes: 5 additions & 0 deletions RF24.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ class RF24
*/
bool begin(void);

/**
* Checks if the chip is connected to the SPI bus
*/
bool isChipConnected();

/**
* Start listening on the pipes opened for reading.
*
Expand Down

0 comments on commit 6341dd0

Please sign in to comment.