Beta
Dependencies: ST_INTERFACES X_NUCLEO_COMMON
Fork of X_NUCLEO_IKS01A2 by
Diff: Components/LSM303AGRSensor/LSM303AGRMagSensor.cpp
- Revision:
- 9:038121268b07
- Parent:
- 6:671fd10a51b7
--- a/Components/LSM303AGRSensor/LSM303AGRMagSensor.cpp Tue Mar 14 13:56:20 2017 +0100 +++ b/Components/LSM303AGRSensor/LSM303AGRMagSensor.cpp Tue Mar 14 13:30:55 2017 +0000 @@ -50,16 +50,16 @@ * @param i2c object of an helper class which handles the I2C peripheral * @param address the address of the component's instance */ -LSM303AGRMagSensor::LSM303AGRMagSensor(DevI2C &i2c) : dev_i2c(i2c) +LSM303AGRMagSensor::LSM303AGRMagSensor(DevI2C &i2c) : _dev_i2c(i2c) { - address = LSM303AGR_MAG_I2C_ADDRESS; + _address = LSM303AGR_MAG_I2C_ADDRESS; }; /** Constructor * @param i2c object of an helper class which handles the I2C peripheral * @param address the address of the component's instance */ -LSM303AGRMagSensor::LSM303AGRMagSensor(DevI2C &i2c, uint8_t address) : dev_i2c(i2c), address(address) +LSM303AGRMagSensor::LSM303AGRMagSensor(DevI2C &i2c, uint8_t address) : _dev_i2c(i2c), _address(address) { }; @@ -105,7 +105,7 @@ * @brief Enable LSM303AGR magnetometer * @retval 0 in case of success, an error code otherwise */ -int LSM303AGRMagSensor::Enable(void) +int LSM303AGRMagSensor::enable(void) { /* Operating mode selection */ if ( LSM303AGR_MAG_W_MD( (void *)this, LSM303AGR_MAG_MD_CONTINUOS_MODE ) == MEMS_ERROR ) @@ -120,7 +120,7 @@ * @brief Disable LSM303AGR magnetometer * @retval 0 in case of success, an error code otherwise */ -int LSM303AGRMagSensor::Disable(void) +int LSM303AGRMagSensor::disable(void) { /* Operating mode selection - power down */ if ( LSM303AGR_MAG_W_MD( (void *)this, LSM303AGR_MAG_MD_IDLE1_MODE ) == MEMS_ERROR ) @@ -163,7 +163,7 @@ float sensitivity = 0; /* Read raw data from LSM303AGR output register. */ - if ( get_m_axesRaw( pDataRaw ) == 1 ) + if ( get_m_axes_raw( pDataRaw ) == 1 ) { return 1; } @@ -199,7 +199,7 @@ * @param pData the pointer where the magnetomer raw data are stored * @retval 0 in case of success, an error code otherwise */ -int LSM303AGRMagSensor::get_m_axesRaw(int16_t *pData) +int LSM303AGRMagSensor::get_m_axes_raw(int16_t *pData) { uint8_t regValue[6] = {0, 0, 0, 0, 0, 0}; int16_t *regValueInt16;