#include "nrf24_hal.h"
extern SPI_HandleTypeDef hspi1;
uint8_t dataOut;
// Low level SPI transmit/receive function (hardware depended)
// input: data - value to transmit via SPI
// return: value received from SPI
uint8_t nRF24_LL_RW(uint8_t data) {
while (__HAL_SPI_GET_FLAG(&hspi1, SPI_FLAG_TXE) == RESET);
HAL_SPI_Transmit(&hspi1, &data, 1,100 );
while (__HAL_SPI_GET_FLAG(&hspi1, SPI_FLAG_RXNE) == RESET);
HAL_SPI_Receive(&hspi1, &dataOut, 1,100);
return dataOut;
}