@@ -117,8 +117,7 @@ static stmdev_ctx_t dev_ctx;
117117 * and are strictly related to the hardware platform used.
118118 *
119119 */
120- static int32_t platform_write (void * handle , uint8_t reg ,
121- uint8_t * bufp ,
120+ static int32_t platform_write (void * handle , uint8_t reg , const uint8_t * bufp ,
122121 uint16_t len );
123122static int32_t platform_read (void * handle , uint8_t reg , uint8_t * bufp ,
124123 uint16_t len );
@@ -191,20 +190,19 @@ void lps33w_read_data_polling(void)
191190 * @param len number of consecutive register to write
192191 *
193192 */
194- static int32_t platform_write (void * handle , uint8_t reg ,
195- uint8_t * bufp ,
193+ static int32_t platform_write (void * handle , uint8_t reg , const uint8_t * bufp ,
196194 uint16_t len )
197195{
198196#if defined(NUCLEO_F411RE )
199197 HAL_I2C_Mem_Write (handle , LPS33W_I2C_ADD_H , reg ,
200- I2C_MEMADD_SIZE_8BIT , bufp , len , 1000 );
198+ I2C_MEMADD_SIZE_8BIT , ( uint8_t * ) bufp , len , 1000 );
201199#elif defined(STEVAL_MKI109V3 )
202200 HAL_GPIO_WritePin (CS_up_GPIO_Port , CS_up_Pin , GPIO_PIN_RESET );
203201 HAL_SPI_Transmit (handle , & reg , 1 , 1000 );
204- HAL_SPI_Transmit (handle , bufp , len , 1000 );
202+ HAL_SPI_Transmit (handle , ( uint8_t * ) bufp , len , 1000 );
205203 HAL_GPIO_WritePin (CS_up_GPIO_Port , CS_up_Pin , GPIO_PIN_SET );
206204#elif defined(SPC584B_DIS )
207- i2c_lld_write (handle , LPS33W_I2C_ADD_H & 0xFE , reg , bufp , len );
205+ i2c_lld_write (handle , LPS33W_I2C_ADD_H & 0xFE , reg , ( uint8_t * ) bufp , len );
208206#endif
209207 return 0 ;
210208}
0 commit comments