select the RFM69 transceiver (save SPI settings, set CS low)
| 556 | |
| 557 | // select the RFM69 transceiver (save SPI settings, set CS low) |
| 558 | void RFM69::select() { |
| 559 | #if defined (SPCR) && defined (SPSR) |
| 560 | // save current SPI settings |
| 561 | _SPCR = SPCR; |
| 562 | _SPSR = SPSR; |
| 563 | #endif |
| 564 | |
| 565 | #ifdef SPI_HAS_TRANSACTION |
| 566 | _spi->beginTransaction(_settings); |
| 567 | #else |
| 568 | // set RFM69 SPI settings explicitly |
| 569 | _spi->setDataMode(SPI_MODE0); |
| 570 | _spi->setBitOrder(MSBFIRST); |
| 571 | #if defined(__STM32F1__) |
| 572 | _spi->setClockDivider(SPI_CLOCK_DIV8); |
| 573 | #elif defined(__arm__) |
| 574 | _spi->setClockDivider(SPI_CLOCK_DIV16); |
| 575 | #else |
| 576 | _spi->setClockDivider(SPI_CLOCK_DIV2); |
| 577 | #endif |
| 578 | #endif |
| 579 | digitalWrite(_slaveSelectPin, LOW); |
| 580 | } |
| 581 | |
| 582 | // unselect the RFM69 transceiver (set CS high, restore SPI settings) |
| 583 | void RFM69::unselect() { |
nothing calls this directly
no outgoing calls
no test coverage detected