uint8_t lsm6dsox_spi_read(uint8_t reg)
{
uint8_t tx_data = reg | 0x80;
uint8_t rx_data = 0;
// Pull CS low to select the sensor
HAL_GPIO_WritePin(CS_LSM6DSOX_GPIO_Port, CS_LSM6DSOX_Pin, GPIO_PIN_RESET);
// Transmit the register address and receive the response
HAL_SPI_Transmit(&hspi1, &tx_data, 1, HAL_MAX_DELAY);
HAL_SPI_Receive(&hspi1, &rx_data, 1, HAL_MAX_DELAY);
// Pull CS high to deselect the sensor
HAL_GPIO_WritePin(CS_LSM6DSOX_GPIO_Port, CS_LSM6DSOX_Pin, GPIO_PIN_SET);
return rx_data;
}
When I manually upload the .ucf file using Unico-GUI the gesture detection works and I get changes in the status register on the UI. What am I doing wrong?