Hi, I'm trying to connect DWM1000 with SPI using spi_master.h. When I have written to registry e.g. 0x11, 0x12 and read it I've got bytes: 0xFF, 0x11. If I read three bytes I've got 0xFF, 0x11, 0x12. When I connect with DWM1000 on Raspberry using wiringPi library it works great, and there isn't any byte 0xFF.
Could be 0xFF some kind of DWM's header?
To write I'm using:
spi_master_send_recv(SPI_MASTER_0, tx_buffer, headerLength+bodyLength, NULL, 0);
To read:
spi_master_send_recv(SPI_MASTER_0, tx_buffer, headerLength, rx_buffer, readLength);
To make header I'm using function given by DecaWave. My settings of SPI:
config.SPI_Pin_SCK = (uint32_t) SPI_SCK; // 24
config.SPI_Pin_MISO = (uint32_t) SPI_MISO; // 23
config.SPI_Pin_MOSI = (uint32_t) SPI_MOSI; // 22
config.SPI_Pin_SS = (uint32_t) SPI_SS; // 21
config.SPI_Freq = SPI_FREQUENCY_FREQUENCY_M2;
config.SPI_CONFIG_ORDER = SPI_CONFIG_ORDER_MsbFirst;
config.SPI_CONFIG_CPOL = SPI_CONFIG_CPOL_ActiveHigh;
config.SPI_CONFIG_CPHA = SPI_CONFIG_CPHA_Leading;
config.SPI_DisableAllIRQ = 1;
config.SPI_PriorityIRQ = 1;