mokhwasomssi / stm32_hal_nrf24l01p

nRF24L01+ library with STM32 HAL driver
70 stars 9 forks source link

Multi byte command responses #1

Open Korporal opened 2 years ago

Korporal commented 2 years ago

I'm looking at your code and see that the read_register function seems to only work for commands that return single byte responses:

static uint8_t read_register(uint8_t reg)
{
    uint8_t command = NRF24L01P_CMD_R_REGISTER | reg;
    uint8_t status;
    uint8_t read_val;

    cs_low();
    HAL_SPI_TransmitReceive(NRF24L01P_SPI, &command, &status, 1, 2000);
    HAL_SPI_Receive(NRF24L01P_SPI, &read_val, 1, 2000);
    cs_high();

    return read_val;
}

If this were to support multibyte responses (like the 0A or 0B registers for example) how would you change that read_register function?

AlexisPapaioannou commented 1 year ago

Is there any update regarding this issue?