code: def _wait_ready(self, timeout_sec=1):
          
          start = time.time()
          # Send a SPI status read command and read response.
          self._gpio.set_low(self._cs)
          self._busy_wait_ms(2)
          response = self._spi.transfer([PN532_SPI_STATREAD, 0x00])
          self._gpio.set_high(self._cs)
          # Loop until a ready response is received.
          while response[1] != PN532_SPI_READY:
              # Check if the timeout has been exceeded.
              if time.time() - start >= timeout_sec:
                  return False
              # Wait a little while and try reading the status again.
              time.sleep(0.01)
              self._gpio.set_low(self._cs)
              self._busy_wait_ms(2)
              response = self._spi.transfer([PN532_SPI_STATREAD, 0x00])
              self._gpio.set_high(self._cs)
          return True
docs: Wait until the PN532 is ready to receive commands.  At most wait
          timeout_sec seconds for the PN532 to be ready.  If the PN532 is ready
          before the timeout is exceeded then True will be returned, otherwise
          False is returned when the timeout is exceeded.