lib/LPS22HB/src/LPS22HBSensor.h
/**
     * @brief Utility function to read data.
     * @param  pBuffer: pointer to data to be read.
     * @param  RegisterAddr: specifies internal address register to be read.
     * @param  NumByteToRead: number of bytes to be read.
     * @retval 0 if ok, an error code otherwise.
     */
@brief Utility function to read data.
@param  pBuffer: pointer to data to be read.
@param  RegisterAddr: specifies internal address register to be read.
@param  NumByteToRead: number of bytes to be read.
@retval 0 if ok, an error code otherwise.
@brief Utility function to read data . @param pBuffer : pointer to data to be read . @param RegisterAddr : specifies internal address register to be read . @param NumByteToRead : number of bytes to be read . @retval 0 if ok an error code otherwise .
uint8_t IO_Read(uint8_t* pBuffer, uint8_t RegisterAddr, uint16_t NumByteToRead)
    {
      dev_i2c->beginTransmission(((uint8_t)(((address) >> 1) & 0x7F)));
      dev_i2c->write(RegisterAddr);
      dev_i2c->endTransmission(false);
      dev_i2c->requestFrom(((uint8_t)(((address) >> 1) & 0x7F)), (byte) NumByteToRead);
      int i=0;
      while (dev_i2c->available())
      {
        pBuffer[i] = dev_i2c->read();
        i++;
      }
      return 0;
    }
uint8_t IO_Read ( uint8_t * pBuffer , uint8_t RegisterAddr , uint16_t NumByteToRead ) { dev_i2c -> beginTransmission ( ( ( uint8_t ) ( ( ( address ) >> 1 ) & 0x7F ) ) ) ; dev_i2c -> write ( RegisterAddr ) ; dev_i2c -> endTransmission ( false ) ; dev_i2c -> requestFrom ( ( ( uint8_t ) ( ( ( address ) >> 1 ) & 0x7F ) ) , ( byte ) NumByteToRead ) ; int i = 0 ; while ( dev_i2c -> available ( ) ) { pBuffer [ i ] = dev_i2c -> read ( ) ; i ++ ; } return 0 ; }
@brief Utility function to read data.
@brief Utility function to read data .