XDK API  3.6.0
Documentation
Functions | Variables
bmm050.c File Reference
#include "bmm050.h"
+ Include dependency graph for bmm050.c:

Functions

s16 bmm050_compensate_X (s16 mag_data_x, u16 data_r)
 This API used to get the compensated X data the out put of X as s16. More...
 
s32 bmm050_compensate_X_s32 (s16 mag_data_x, u16 data_r)
 This API used to get the compensated X data the out put of X as s32. More...
 
s16 bmm050_compensate_Y (s16 mag_data_y, u16 data_r)
 This API used to get the compensated Y data the out put of Y as s16. More...
 
s32 bmm050_compensate_Y_s32 (s16 mag_data_y, u16 data_r)
 This API used to get the compensated Y data the out put of Y as s32. More...
 
s16 bmm050_compensate_Z (s16 mag_data_z, u16 data_r)
 This API used to get the compensated Z data the out put of Z as s16. More...
 
s32 bmm050_compensate_Z_s32 (s16 mag_data_z, u16 data_r)
 This API used to get the compensated Z data the out put of Z as s32. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_get_advanced_selftest (u8 *v_advanced_selftest_u8)
 This API used to get the advanced self test in the register 0x4C bit 6 and 7. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_get_bmx055_remapped_raw_xyz (struct bmm050_remapped_mag_s16_data_t *mag_data)
 This API reads remapped Magnetometer raw data of X,Y,Z values and RHALL values from location 0x42 to 0x49. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_get_data_rate (u8 *v_data_rate_u8)
 This API used to get the data rate of the sensor in the register 0x4C bit 3 to 5. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_get_functional_state (u8 *v_functional_state_u8)
 This API used to get the functional state in the register 0x4C bit 1 and 2. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_get_power_mode (u8 *v_power_mode_u8)
 This API used to get the power control bit in the register 0x4B bit 0. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_get_presetmode (u8 *v_presetmode_u8)
 This API used to get the preset modes. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_get_raw_xyz (struct bmm050_mag_data_s16_t *mag_data)
 This API reads Magnetometer raw data of X,Y,Z values and RHALL values from location 0x42 to 0x49. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_get_rep_XY (u8 *v_rep_xy_u8)
 This API used to get the x and y repetition in the register 0x51 bit 0 to 7. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_get_rep_Z (u8 *v_rep_z_u8)
 This API used to get the z repetition in the register 0x52 bit 0 to 7. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_get_selftest_XYZ (u8 *v_selftest_xyz)
 This API used to read the selftest of the sensor. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_init (struct bmm050_t *bmm050)
 This function is used for initialize bus read and bus write functions assign the chip id and device address chip id is read in the register 0x40 bit from 0 to 7. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_init_trim_registers (void)
 This API used to get the trim values. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_perform_advanced_selftest (s16 *v_diff_z_s16)
 This API used to perform the advanced self test. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_read_bmx055_remapped_mag_data_XYZ (struct bmm050_remapped_mag_s16_data_t *mag_data)
 This API reads remapped compensated Magnetometer data of X,Y,Z values. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_read_bmx055_remapped_mag_data_XYZ_s32 (struct bmm050_remapped_mag_s32_data_t *mag_data)
 This API reads remapped compensated magnetometer data of X,Y,Z values. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_read_mag_data_XYZ (struct bmm050_mag_data_s16_t *mag_data)
 This API reads compensated Magnetometer data of X,Y,Z values from location 0x42 to 0x49. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_read_mag_data_XYZ_s32 (struct bmm050_mag_s32_data_t *mag_data)
 This API reads compensated magnetometer data of X,Y,Z values. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_read_register (u8 v_addr_u8, u8 *v_data_u8, u8 v_len_u8)
 This API reads the data from the given register. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_set_advanced_selftest (u8 v_advanced_selftest_u8)
 This API used to set the advanced self test in the register 0x4C bit 6 and 7. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_set_control_measurement_x (u8 v_enable_disable_u8)
 This API used to set the control measurement X data in the register 0x4E bit 3. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_set_control_measurement_y (u8 v_enable_disable_u8)
 This API used to set the control measurement Y data in the register 0x4E bit 4. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_set_data_rate (u8 v_data_rate_u8)
 This API used to set the data rate of the sensor in the register 0x4C bit 3 to 5. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_set_functional_state (u8 v_functional_state_u8)
 This API used to set the functional state in the register 0x4C and 0x4B. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_set_power_mode (u8 v_power_mode_u8)
 This API used to set the power control bit in the register 0x4B bit 0. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_set_presetmode (u8 v_presetmode_u8)
 This API used to set the preset modes. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_set_rep_XY (u8 v_rep_xy_u8)
 This API used to set the x and y repetition in the register 0x51 bit 0 to 7. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_set_rep_Z (u8 v_rep_z_u8)
 This API used to set the z repetition in the register 0x52 bit 0 to 7. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_set_selftest (u8 v_selftest_u8)
 This API used to set the self test of the sensor in the register 0x4C bit 0. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_set_spi3 (u8 v_value_u8)
 This API used to set the spi3 in the register 0x4B bit 2. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_soft_rst (void)
 This API used reset the register values to default in the register 0x4B. More...
 
BMM050_RETURN_FUNCTION_TYPE bmm050_write_register (u8 v_addr_u8, u8 *v_data_u8, u8 v_len_u8)
 This API write the data to the given register. More...
 

Variables

static struct bmm050_tp_bmm050
 

Function Documentation

s16 bmm050_compensate_X ( s16  mag_data_x,
u16  data_r 
)
Parameters
mag_data_x: The value of raw X data
data_r: The value of R data
Returns
results of compensated X data value output as s16

+ Here is the caller graph for this function:

s32 bmm050_compensate_X_s32 ( s16  mag_data_x,
u16  data_r 
)
Parameters
mag_data_x: The value of raw X data
data_r: The value of R data
Returns
results of compensated X data value output as s32

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

s16 bmm050_compensate_Y ( s16  mag_data_y,
u16  data_r 
)
Parameters
mag_data_y: The value of raw Y data
data_r: The value of R data
Returns
results of compensated Y data value output as s16

+ Here is the caller graph for this function:

s32 bmm050_compensate_Y_s32 ( s16  mag_data_y,
u16  data_r 
)
Parameters
mag_data_y: The value of raw Y data
data_r: The value of R data
Returns
results of compensated Y data value output as s32

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

s16 bmm050_compensate_Z ( s16  mag_data_z,
u16  data_r 
)
Parameters
mag_data_z: The value of raw Z data
data_r: The value of R data
Returns
results of compensated Z data value output as s16

+ Here is the caller graph for this function:

s32 bmm050_compensate_Z_s32 ( s16  mag_data_z,
u16  data_r 
)
Parameters
mag_data_z: The value of raw Z data
data_r: The value of R data
Returns
results of compensated Z data value output as s32

+ Here is the caller graph for this function:

BMM050_RETURN_FUNCTION_TYPE bmm050_get_advanced_selftest ( u8 v_advanced_selftest_u8)
Parameters
v_advanced_selftest_u8: The output value of advanced self test
value Status
0 BMM050_ADVANCED_SELFTEST_OFF
2 BMM050_ADVANCED_SELFTEST_NEGATIVE
3 BMM050_ADVANCED_SELFTEST_POSITIVE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMM050_RETURN_FUNCTION_TYPE bmm050_get_bmx055_remapped_raw_xyz ( struct bmm050_remapped_mag_s16_data_t mag_data)
Note
In this function X and Y axis is remapped
X is read from the address 0x44 & 0x45
Y is read from the address 0x42 & 0x43
this API is only applicable for BMX055 sensor
Parameters
mag_data: The data of remapped raw XYZ data
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMM050_RETURN_FUNCTION_TYPE bmm050_get_data_rate ( u8 v_data_rate_u8)
Parameters
v_data_rate_u8: The value of data rate
value Description
0x00 BMM050_DATA_RATE_10HZ
0x01 BMM050_DATA_RATE_02HZ
0x02 BMM050_DATA_RATE_06HZ
0x03 BMM050_DATA_RATE_08HZ
0x04 BMM050_DATA_RATE_15HZ
0x05 BMM050_DATA_RATE_20HZ
0x06 BMM050_DATA_RATE_25HZ
0x07 BMM050_DATA_RATE_30HZ
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMM050_RETURN_FUNCTION_TYPE bmm050_get_functional_state ( u8 v_functional_state_u8)
Parameters
v_functional_state_u8The value of functional mode
value functional state
0x00 Normal
0x03 Sleep
Note
If user set the functional state as Force mode(0x01) and read the register it returns the value as 0x03 that is sleep mode.
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMM050_RETURN_FUNCTION_TYPE bmm050_get_power_mode ( u8 v_power_mode_u8)
Parameters
v_power_mode_u8: The value of power control bit enable
value status
0 Disable the power control bit
1 Enable the power control bit
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMM050_RETURN_FUNCTION_TYPE bmm050_get_presetmode ( u8 v_presetmode_u8)
Note
The preset mode setting is depend on Data Rate, XY and Z repetitions
Parameters
v_presetmode_u8The value of selected preset mode
value preset_mode
1 BMM050_PRESETMODE_LOWPOWER
2 BMM050_PRESETMODE_REGULAR
3 BMM050_PRESETMODE_HIGHACCURACY
4 BMM050_PRESETMODE_ENHANCED
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

BMM050_RETURN_FUNCTION_TYPE bmm050_get_raw_xyz ( struct bmm050_mag_data_s16_t mag_data)
Parameters
mag_data: The data of raw XYZ data
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMM050_RETURN_FUNCTION_TYPE bmm050_get_rep_XY ( u8 v_rep_xy_u8)
Parameters
v_rep_xy_u8: The value of x and y repetitions
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMM050_RETURN_FUNCTION_TYPE bmm050_get_rep_Z ( u8 v_rep_z_u8)
Parameters
v_rep_z_u8: The value of z repetitions
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMM050_RETURN_FUNCTION_TYPE bmm050_get_selftest_XYZ ( u8 v_selftest_xyz)
Parameters
v_selftest_xyzThe self test value of XYZ
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMM050_RETURN_FUNCTION_TYPE bmm050_init ( struct bmm050_t bmm050)
Note
While changing the parameter of the bmm050 consider the following point:
Changing the reference value of the parameter will changes the local copy or local reference make sure your changes will not affect the reference value of the parameter (Better case don't change the reference value of the parameter)
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

BMM050_RETURN_FUNCTION_TYPE bmm050_init_trim_registers ( void  )
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMM050_RETURN_FUNCTION_TYPE bmm050_perform_advanced_selftest ( s16 v_diff_z_s16)
Parameters
v_diff_z_s16: The output of advance self test
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the call graph for this function:

BMM050_RETURN_FUNCTION_TYPE bmm050_read_bmx055_remapped_mag_data_XYZ ( struct bmm050_remapped_mag_s16_data_t mag_data)
Note
In this function X and Y axis is remapped
X is read from the address 0x44 & 0x45
Y is read from the address 0x42 & 0x43
this API is only applicable for BMX055 sensor
Parameters
mag_data: The data of remapped compensated mag xyz data
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the call graph for this function:

BMM050_RETURN_FUNCTION_TYPE bmm050_read_bmx055_remapped_mag_data_XYZ_s32 ( struct bmm050_remapped_mag_s32_data_t mag_data)
Note
The output value of compensated X, Y, Z as s32
In this function X and Y axis is remapped
X is read from the address 0x44 & 0x45
Y is read from the address 0x42 & 0x43
this API is only applicable for BMX055 sensor
Parameters
mag_data: The data of remapped compensated XYZ data
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the call graph for this function:

BMM050_RETURN_FUNCTION_TYPE bmm050_read_mag_data_XYZ ( struct bmm050_mag_data_s16_t mag_data)
Parameters
mag_data: The data of mag compensated XYZ data
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

BMM050_RETURN_FUNCTION_TYPE bmm050_read_mag_data_XYZ_s32 ( struct bmm050_mag_s32_data_t mag_data)
Note
The output value of compensated X, Y, Z as s32
Parameters
mag_data: The data of compensated XYZ data
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

BMM050_RETURN_FUNCTION_TYPE bmm050_read_register ( u8  v_addr_u8,
u8 v_data_u8,
u8  v_len_u8 
)
Parameters
v_addr_u8-> Address of the register
v_data_u8-> The data from the register
v_len_u8-> no of bytes to read
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMM050_RETURN_FUNCTION_TYPE bmm050_set_advanced_selftest ( u8  v_advanced_selftest_u8)
Parameters
v_advanced_selftest_u8: The output value of advanced self test
value Status
0 BMM050_ADVANCED_SELFTEST_OFF
2 BMM050_ADVANCED_SELFTEST_NEGATIVE
3 BMM050_ADVANCED_SELFTEST_POSITIVE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMM050_RETURN_FUNCTION_TYPE bmm050_set_control_measurement_x ( u8  v_enable_disable_u8)
Parameters
v_enable_disable_u8The value of control measurement-x
value Status
1 ENABLE
0 DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMM050_RETURN_FUNCTION_TYPE bmm050_set_control_measurement_y ( u8  v_enable_disable_u8)
Parameters
v_enable_disable_u8The value of control measurement-y
value Status
1 ENABLE
0 DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMM050_RETURN_FUNCTION_TYPE bmm050_set_data_rate ( u8  v_data_rate_u8)
Parameters
v_data_rate_u8: The value of data rate
value Description
0x00 BMM050_DATA_RATE_10HZ
0x01 BMM050_DATA_RATE_02HZ
0x02 BMM050_DATA_RATE_06HZ
0x03 BMM050_DATA_RATE_08HZ
0x04 BMM050_DATA_RATE_15HZ
0x05 BMM050_DATA_RATE_20HZ
0x06 BMM050_DATA_RATE_25HZ
0x07 BMM050_DATA_RATE_30HZ
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMM050_RETURN_FUNCTION_TYPE bmm050_set_functional_state ( u8  v_functional_state_u8)
Note
0x4C bit 1 and 2
0x4B bit 0
Parameters
v_functional_state_u8The value of functional mode
value functional state
0x00 BMM050_NORMAL_MODE
0x01 BMM050_SUSPEND_MODE
0x02 BMM050_FORCED_MODE
0x03 BMM050_SLEEP_MODE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

BMM050_RETURN_FUNCTION_TYPE bmm050_set_power_mode ( u8  v_power_mode_u8)
Parameters
v_power_mode_u8: The value of power control bit enable
value status
0 Disable the power control bit
1 Enable the power control bit
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMM050_RETURN_FUNCTION_TYPE bmm050_set_presetmode ( u8  v_presetmode_u8)
Note
The preset mode setting is depend on Data Rate, XY and Z repetitions
Parameters
v_presetmode_u8The value of selected preset mode
value preset_mode
1 BMM050_PRESETMODE_LOWPOWER
2 BMM050_PRESETMODE_REGULAR
3 BMM050_PRESETMODE_HIGHACCURACY
4 BMM050_PRESETMODE_ENHANCED
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

BMM050_RETURN_FUNCTION_TYPE bmm050_set_rep_XY ( u8  v_rep_xy_u8)
Parameters
v_rep_xy_u8: The value of x and y repetitions
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMM050_RETURN_FUNCTION_TYPE bmm050_set_rep_Z ( u8  v_rep_z_u8)
Parameters
v_rep_z_u8: The value of z repetitions
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMM050_RETURN_FUNCTION_TYPE bmm050_set_selftest ( u8  v_selftest_u8)
Parameters
v_selftest_u8: The value of selftest
Note
write 0x01 to start self test
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMM050_RETURN_FUNCTION_TYPE bmm050_set_spi3 ( u8  v_value_u8)
Parameters
v_value_u8: the value of spi3
value Description
0 Disable
1 Enable
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMM050_RETURN_FUNCTION_TYPE bmm050_soft_rst ( void  )
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMM050_RETURN_FUNCTION_TYPE bmm050_write_register ( u8  v_addr_u8,
u8 v_data_u8,
u8  v_len_u8 
)
Parameters
v_addr_u8-> Address of the register
v_data_u8-> The data from the register
v_len_u8-> no of bytes to read
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

Variable Documentation

struct bmm050_t* p_bmm050
static

All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Thu Mar 14 2019 19:12:43 by doxygen 1.8.8