[nRF24] Rework SPI config interface

This commit is contained in:
jgromes 2024-04-07 15:47:39 +01:00
parent 8b9c26cd88
commit 5dfaf00302

View file

@ -8,8 +8,8 @@ nRF24::nRF24(Module* mod) : PhysicalLayer(RADIOLIB_NRF24_FREQUENCY_STEP_SIZE, RA
int16_t nRF24::begin(int16_t freq, int16_t dr, int8_t pwr, uint8_t addrWidth) { int16_t nRF24::begin(int16_t freq, int16_t dr, int8_t pwr, uint8_t addrWidth) {
// set module properties // set module properties
this->mod->SPIreadCommand = RADIOLIB_NRF24_CMD_READ; this->mod->spiConfig.cmds[RADIOLIB_MODULE_SPI_COMMAND_READ] = RADIOLIB_NRF24_CMD_READ;
this->mod->SPIwriteCommand = RADIOLIB_NRF24_CMD_WRITE; this->mod->spiConfig.cmds[RADIOLIB_MODULE_SPI_COMMAND_WRITE] = RADIOLIB_NRF24_CMD_WRITE;
this->mod->init(); this->mod->init();
this->mod->hal->pinMode(this->mod->getIrq(), this->mod->hal->GpioModeInput); this->mod->hal->pinMode(this->mod->getIrq(), this->mod->hal->GpioModeInput);