pelion-example-disco-iot01/sensors/LPS22HB/LPS22HBSensor.h
uint8_t io_write(uint8_t* pBuffer, uint8_t RegisterAddr, uint16_t NumByteToWrite)
    {
        if (_dev_spi) { 
            _dev_spi->lock();
            _cs_pin = 0;
            int data = _dev_spi->write(RegisterAddr);                    
            _dev_spi->write((char *)pBuffer, (int) NumByteToWrite, NULL, 0);                     
            _cs_pin = 1;                    
            _dev_spi->unlock();
            return data;                    
        }        
        if (_dev_i2c) return (uint8_t) _dev_i2c->i2c_write(pBuffer, _address, RegisterAddr, NumByteToWrite);    
        return 1;
    }
/**
     * @brief Utility function to write data.
     * @param  pBuffer: pointer to data to be written.
     * @param  RegisterAddr: specifies internal address register to be written.
     * @param  NumByteToWrite: number of bytes to write.
     * @retval 0 if ok, an error code otherwise.
     */
@brief Utility function to write data.
@param  pBuffer: pointer to data to be written.
@param  RegisterAddr: specifies internal address register to be written.
@param  NumByteToWrite: number of bytes to write.
@retval 0 if ok, an error code otherwise.
@brief Utility function to write data . @param pBuffer : pointer to data to be written . @param RegisterAddr : specifies internal address register to be written . @param NumByteToWrite : number of bytes to write . @retval 0 if ok an error code otherwise .
uint8_t io_write(uint8_t* pBuffer, uint8_t RegisterAddr, uint16_t NumByteToWrite)
    {
        if (_dev_spi) { 
            _dev_spi->lock();
            _cs_pin = 0;
            int data = _dev_spi->write(RegisterAddr);                    
            _dev_spi->write((char *)pBuffer, (int) NumByteToWrite, NULL, 0);                     
            _cs_pin = 1;                    
            _dev_spi->unlock();
            return data;                    
        }        
        if (_dev_i2c) return (uint8_t) _dev_i2c->i2c_write(pBuffer, _address, RegisterAddr, NumByteToWrite);    
        return 1;
    }
uint8_t io_write ( uint8_t * pBuffer , uint8_t RegisterAddr , uint16_t NumByteToWrite ) { if ( _dev_spi ) { _dev_spi -> lock ( ) ; _cs_pin = 0 ; int data = _dev_spi -> write ( RegisterAddr ) ; _dev_spi -> write ( ( char * ) pBuffer , ( int ) NumByteToWrite , NULL , 0 ) ; _cs_pin = 1 ; _dev_spi -> unlock ( ) ; return data ; } if ( _dev_i2c ) return ( uint8_t ) _dev_i2c -> i2c_write ( pBuffer , _address , RegisterAddr , NumByteToWrite ) ; return 1 ; }
@brief Utility function to write data.
@brief Utility function to write data .