HI,
I am trying to use STTS751-1DP3F temp. sensor with nr52832. The drivers for sensors are given on:
https://github.com/STMicroelectronics/STMems_Standard_C_drivers/tree/master/stts751_STdC
i tried to change the platform write and read function as follows
static int32_t platform_write(void *handle, uint8_t reg, uint8_t *bufp, uint16_t len) { ret_code_t err_code; //HAL_I2C_Mem_Write(handle, STTS751_0xxxx_ADD_7K5, reg, // I2C_MEMADD_SIZE_8BIT, bufp, len, 1000); m_xfer_done = false; err_code = nrf_drv_twi_tx(handle, reg, bufp, len, false); APP_ERROR_CHECK(err_code); while (m_xfer_done == false); return 0; } static int32_t platform_read(void *handle, uint8_t reg, uint8_t *bufp, uint16_t len) { ret_code_t err_code; //HAL_I2C_Mem_Read(handle, STTS751_0xxxx_ADD_7K5, reg, // I2C_MEMADD_SIZE_8BIT, bufp, len, 1000); m_xfer_done = false; err_code = nrf_drv_twi_rx(handle, reg, bufp, len); APP_ERROR_CHECK(err_code); return 0; }
i also tried to redefine the structure as:
typedef struct { /** Component mandatory fields **/ stmdev_write_ptr write_reg; stmdev_read_ptr read_reg; /** Customizable optional pointer **/ //void *handle; nrf_drv_twi_t *handle; } stmdev_ctx_t;
but am getting following error
.\..\..\main.c(135): error: #513: a value of type "nrf_drv_twi_t" cannot be assigned to an entity of type "nrf_drv_twi_t *"
dev_ctx.handle = SENSOR_BUS;
please help me for the same
thanks and regards
Rajat