#ifndef __SPI_H__
#define __SPI_H__

#include "nrf_drv_spi.h"
#include "nrfx_spi.h"

#undef SPI_HANDLER
#ifdef SPI_HANDLER
extern uint8_t spim_tx_buf[];
extern uint8_t spim_rx_buf[];
#endif // SPI_HANDLER

#define SPI_MAX_TX_LENGTH    64
#define SPI_MAX_RX_LENGTH    64

const extern nrf_drv_spi_t icm_spi_instance;


void spi_init(void);

ret_code_t spi_transfer(uint8_t const *tx_buf, uint8_t tx_len, uint8_t *rx_buf, uint8_t rx_len);

void spi_disable(void);

#endif

