DroneOS/Drivers/Source/drvHMC5883.c
///////////////////////////////////////////////////////////////////////////////
//! Sets HMC5883 device configration byte
//! \param Configuration byte goes to Config A register
//! \param Configuration byte goes to Config B register
//! \return dosTrue if configuration bytes were successfully updated
Sets HMC5883 device configration byte
\param Configuration byte goes to Config A register
\param Configuration byte goes to Config B register
\return dosTrue if configuration bytes were successfully updated
Sets HMC5883 device configration byte \ param Configuration byte goes to Config A register \ param Configuration byte goes to Config B register \ return dosTrue if configuration bytes were successfully updated
dosBool drvHMC5883SetConfiguration(dosByte in_config_a, dosByte in_config_b)
{
	dosBool ack = HMC5883_I2C_Start(HMC5883_I2C, drvI2C_WRITE, drvHMC5883_BASE_ADDRESS);
  if( ack )
  {
  	HMC5883_I2C_WriteByte(HMC5883_I2C, drvHMC5883_RA_CONFIG_A);
		HMC5883_I2C_WriteByte(HMC5883_I2C, in_config_a);
		HMC5883_I2C_WriteByte(HMC5883_I2C, in_config_b);
	}      
	HMC5883_I2C_Stop(HMC5883_I2C);
	return ack;
}
dosBool drvHMC5883SetConfiguration ( dosByte in_config_a , dosByte in_config_b ) { dosBool ack = HMC5883_I2C_Start ( HMC5883_I2C , drvI2C_WRITE , drvHMC5883_BASE_ADDRESS ) ; if ( ack ) { HMC5883_I2C_WriteByte ( HMC5883_I2C , drvHMC5883_RA_CONFIG_A ) ; HMC5883_I2C_WriteByte ( HMC5883_I2C , in_config_a ) ; HMC5883_I2C_WriteByte ( HMC5883_I2C , in_config_b ) ; } HMC5883_I2C_Stop ( HMC5883_I2C ) ; return ack ; }
Sets HMC5883 device configration byte
\param Configuration byte goes to Config A register
\param Configuration byte goes to Config B register
\return dosTrue if configuration bytes were successfully updated
Sets HMC5883 device configration byte \ param Configuration byte goes to Config A register \ param Configuration byte goes to Config B register \ return dosTrue if configuration bytes were successfully updated