XDK API  3.6.0
Documentation
Data Structures | Macros | Typedefs
bmm050.h File Reference

BMM050 Sensor Driver Support Header File. More...

+ This graph shows which files directly or indirectly include this file:

Data Structures

struct  bmm050_mag_data_float_t
 Structure containing mag xyz data output of the data is float. More...
 
struct  bmm050_mag_data_s16_t
 Structure containing mag xyz data output of the data is s16. More...
 
struct  bmm050_mag_s32_data_t
 Structure containing mag xyz data output of the data is s32. More...
 
struct  bmm050_remapped_mag_data_float_t
 Structure containing mag remapped xyz data output of the data is float this only applicable for BMX055 sensor. More...
 
struct  bmm050_remapped_mag_s16_data_t
 Structure containing mag remapped xyz data output of the data is s16 this only applicable for BMX055 sensor. More...
 
struct  bmm050_remapped_mag_s32_data_t
 Structure containing mag remapped xyz data output of the data is s32 this only applicable for BMX055 sensor. More...
 
struct  bmm050_t
 Structure containing mag initial parameters. More...
 

Macros

#define MACHINE_32_BIT
 For Enabling and Disabling the floating point API's If your platform supports the FLOAT support, please enable this macro. More...
 
BUS READ AND WRITE FUNCTION POINTERS
#define BMM050_BUS_WR_RETURN_TYPE   s8
 Define the calling convention of YOUR bus communication routine. More...
 
#define BMM050_BUS_WR_PARAM_TYPES   u8, u8, u8 *, u8
 
#define BMM050_BUS_WR_PARAM_ORDER   (device_addr, register_addr, register_data, wr_len)
 
#define BMM050_BUS_WRITE_FUNC(device_addr, register_addr, register_data, wr_len)   bus_write(device_addr, register_addr, register_data, wr_len)
 
#define BMM050_BUS_RD_RETURN_TYPE   s8
 link macro between API function calls and bus read function More...
 
#define BMM050_BUS_RD_PARAM_TYPES   u8, u8, u8 *, u8
 
#define BMM050_BUS_RD_PARAM_ORDER   (device_addr, register_addr, register_data)
 
#define BMM050_BUS_READ_FUNC(device_addr, register_addr, register_data, rd_len)   bus_read(device_addr, register_addr, register_data, rd_len)
 
RETURN TYPE DEFINITIONS
#define BMM050_DELAY_RETURN_TYPE   void
 
#define BMM050_DELAY_FUNC(delay_in_msec)   delay_func(delay_in_msec)
 
#define BMM050_RETURN_FUNCTION_TYPE   s8
 
I2C ADDRESS DEFINITIONS
#define BMM050_I2C_ADDRESS   (0x10)
 
CHIP ID
#define BMM050_CHIP_ID   (0x40)
 
DATA REGISTERS
#define BMM050_DATA_X_LSB   (0x42)
 
#define BMM050_DATA_X_MSB   (0x43)
 
#define BMM050_DATA_Y_LSB   (0x44)
 
#define BMM050_DATA_Y_MSB   (0x45)
 
#define BMM050_DATA_Z_LSB   (0x46)
 
#define BMM050_DATA_Z_MSB   (0x47)
 
#define BMM050_DATA_R_LSB   (0x48)
 
#define BMM050_DATA_R_MSB   (0x49)
 
REMAPPED DATA REGISTERS
#define BMM050_REMAPPED_BMX055_DATA_Y_LSB   (0x42)
 
#define BMM050_REMAPPED_BMX055_DATA_Y_MSB   (0x43)
 
#define BMM050_REMAPPED_BMX055_DATA_X_LSB   (0x44)
 
#define BMM050_REMAPPED_BMX055_DATA_X_MSB   (0x45)
 
INTERRUPT STATUS
#define BMM050_INT_STAT_REG   (0x4A)
 
POWER MODE DEFINITIONS
#define BMM050_POWER_CONTROL   (0x4B)
 
#define BMM050_CONTROL   (0x4C)
 
#define BMM050_INT_CONTROL   (0x4D)
 
#define BMM050_SENS_CONTROL   (0x4E)
 
#define BMM050_LOW_THRES   (0x4F)
 
#define BMM050_HIGH_THRES   (0x50)
 
#define BMM050_NORMAL_MODE   (0x00)
 
#define BMM050_FORCED_MODE   (0x01)
 
#define BMM050_SUSPEND_MODE   (0x02)
 
#define BMM050_SLEEP_MODE   (0x03)
 
XY AND Z REPETITIONS DEFINITIONS
#define BMM050_REP_XY   (0x51)
 
#define BMM050_REP_Z   (0x52)
 
TRIM REGISTERS
#define BMM050_DIG_X1   (0x5D)
 
#define BMM050_DIG_Y1   (0x5E)
 
#define BMM050_DIG_Z4_LSB   (0x62)
 
#define BMM050_DIG_Z4_MSB   (0x63)
 
#define BMM050_DIG_X2   (0x64)
 
#define BMM050_DIG_Y2   (0x65)
 
#define BMM050_DIG_Z2_LSB   (0x68)
 
#define BMM050_DIG_Z2_MSB   (0x69)
 
#define BMM050_DIG_Z1_LSB   (0x6A)
 
#define BMM050_DIG_Z1_MSB   (0x6B)
 
#define BMM050_DIG_XYZ1_LSB   (0x6C)
 
#define BMM050_DIG_XYZ1_MSB   (0x6D)
 
#define BMM050_DIG_Z3_LSB   (0x6E)
 
#define BMM050_DIG_Z3_MSB   (0x6F)
 
#define BMM050_DIG_XY2   (0x70)
 
#define BMM050_DIG_XY1   (0x71)
 
BIT MASK, LENGTH AND POSITION OF DATA REGISTERS
#define BMM050_DATA_X_LSB_BIT__POS   (3)
 
#define BMM050_DATA_X_LSB_BIT__LEN   (5)
 
#define BMM050_DATA_X_LSB_BIT__MSK   (0xF8)
 
#define BMM050_DATA_X_LSB_BIT__REG   (BMM050_DATA_X_LSB)
 
#define BMM050_DATA_X_LSB_TESTX__POS   (0)
 
#define BMM050_DATA_X_LSB_TESTX__LEN   (1)
 
#define BMM050_DATA_X_LSB_TESTX__MSK   (0x01)
 
#define BMM050_DATA_X_LSB_TESTX__REG   (BMM050_DATA_X_LSB)
 
#define BMM050_DATA_Y_LSB_BIT__POS   (3)
 
#define BMM050_DATA_Y_LSB_BIT__LEN   (5)
 
#define BMM050_DATA_Y_LSB_BIT__MSK   (0xF8)
 
#define BMM050_DATA_Y_LSB_BIT__REG   (BMM050_DATA_Y_LSB)
 
#define BMM050_DATA_Y_LSB_TESTY__POS   (0)
 
#define BMM050_DATA_Y_LSB_TESTY__LEN   (1)
 
#define BMM050_DATA_Y_LSB_TESTY__MSK   (0x01)
 
#define BMM050_DATA_Y_LSB_TESTY__REG   (BMM050_DATA_Y_LSB)
 
#define BMM050_DATA_Z_LSB_BIT__POS   (1)
 
#define BMM050_DATA_Z_LSB_BIT__LEN   (7)
 
#define BMM050_DATA_Z_LSB_BIT__MSK   (0xFE)
 
#define BMM050_DATA_Z_LSB_BIT__REG   (BMM050_DATA_Z_LSB)
 
#define BMM050_DATA_Z_LSB_TESTZ__POS   (0)
 
#define BMM050_DATA_Z_LSB_TESTZ__LEN   (1)
 
#define BMM050_DATA_Z_LSB_TESTZ__MSK   (0x01)
 
#define BMM050_DATA_Z_LSB_TESTZ__REG   (BMM050_DATA_Z_LSB)
 
#define BMM050_DATA_R_LSB_BIT__POS   (2)
 
#define BMM050_DATA_R_LSB_BIT__LEN   (6)
 
#define BMM050_DATA_R_LSB_BIT__MSK   (0xFC)
 
#define BMM050_DATA_R_LSB_BIT__REG   (BMM050_DATA_R_LSB)
 
#define BMM050_DATA_RDYSTAT__POS   (0)
 
#define BMM050_DATA_RDYSTAT__LEN   (1)
 
#define BMM050_DATA_RDYSTAT__MSK   (0x01)
 
#define BMM050_DATA_RDYSTAT__REG   (BMM050_DATA_R_LSB)
 
BIT MASK, LENGTH AND POSITION OF REMAPPED DATA REGISTERS
#define BMM050_REMAPPED_BMX055_DATA_X_LSB_BIT__POS   (3)
 
#define BMM050_REMAPPED_BMX055_DATA_X_LSB_BIT__LEN   (5)
 
#define BMM050_REMAPPED_BMX055_DATA_X_LSB_BIT__MSK   (0xF8)
 
#define BMM050_REMAPPED_BMX055_DATA_X_LSB_BIT__REG(BMM050_REMAPPED_BMX055_DATA_X_LSB)
 
#define BMM050_REMAPPED_BMX055_DATA_Y_LSB_BIT__POS   (3)
 
#define BMM050_REMAPPED_BMX055_DATA_Y_LSB_BIT__LEN   (5)
 
#define BMM050_REMAPPED_BMX055_DATA_Y_LSB_BIT__MSK   (0xF8)
 
#define BMM050_REMAPPED_BMX055_DATA_Y_LSB_BIT__REG(BMM050_REMAPPED_BMX055_DATA_Y_LSB)
 
BIT MASK, LENGTH AND POSITION OF INTERRUPT STATUS REGISTERS
#define BMM050_INT_STAT_DOR__POS   (7)
 
#define BMM050_INT_STAT_DOR__LEN   (1)
 
#define BMM050_INT_STAT_DOR__MSK   (0x80)
 
#define BMM050_INT_STAT_DOR__REG   (BMM050_INT_STAT_REG)
 
#define BMM050_INT_STAT_OVRFLOW__POS   (6)
 
#define BMM050_INT_STAT_OVRFLOW__LEN   (1)
 
#define BMM050_INT_STAT_OVRFLOW__MSK   (0x40)
 
#define BMM050_INT_STAT_OVRFLOW__REG   (BMM050_INT_STAT_REG)
 
#define BMM050_INT_STAT_HIGH_THZ__POS   (5)
 
#define BMM050_INT_STAT_HIGH_THZ__LEN   (1)
 
#define BMM050_INT_STAT_HIGH_THZ__MSK   (0x20)
 
#define BMM050_INT_STAT_HIGH_THZ__REG   (BMM050_INT_STAT_REG)
 
#define BMM050_INT_STAT_HIGH_THY__POS   (4)
 
#define BMM050_INT_STAT_HIGH_THY__LEN   (1)
 
#define BMM050_INT_STAT_HIGH_THY__MSK   (0x10)
 
#define BMM050_INT_STAT_HIGH_THY__REG   (BMM050_INT_STAT_REG)
 
#define BMM050_INT_STAT_HIGH_THX__POS   (3)
 
#define BMM050_INT_STAT_HIGH_THX__LEN   (1)
 
#define BMM050_INT_STAT_HIGH_THX__MSK   (0x08)
 
#define BMM050_INT_STAT_HIGH_THX__REG   (BMM050_INT_STAT_REG)
 
#define BMM050_INT_STAT_LOW_THZ__POS   (2)
 
#define BMM050_INT_STAT_LOW_THZ__LEN   (1)
 
#define BMM050_INT_STAT_LOW_THZ__MSK   (0x04)
 
#define BMM050_INT_STAT_LOW_THZ__REG   (BMM050_INT_STAT_REG)
 
#define BMM050_INT_STAT_LOW_THY__POS   (1)
 
#define BMM050_INT_STAT_LOW_THY__LEN   (1)
 
#define BMM050_INT_STAT_LOW_THY__MSK   (0x02)
 
#define BMM050_INT_STAT_LOW_THY__REG   (BMM050_INT_STAT_REG)
 
#define BMM050_INT_STAT_LOW_THX__POS   (0)
 
#define BMM050_INT_STAT_LOW_THX__LEN   (1)
 
#define BMM050_INT_STAT_LOW_THX__MSK   (0x01)
 
#define BMM050_INT_STAT_LOW_THX__REG   (BMM050_INT_STAT_REG)
 
BIT MASK, LENGTH AND POSITION OF SOFT RESET REGISTERS
#define BMM050_POWER_CONTROL_SOFT_RST_7__POS   (7)
 
#define BMM050_POWER_CONTROL_SOFT_RST_7__LEN   (1)
 
#define BMM050_POWER_CONTROL_SOFT_RST_7__MSK   (0x80)
 
#define BMM050_POWER_CONTROL_SOFT_RST_7__REG   (BMM050_POWER_CONTROL)
 
#define BMM050_POWER_CONTROL_SPI3_ENABLE__POS   (2)
 
#define BMM050_POWER_CONTROL_SPI3_ENABLE__LEN   (1)
 
#define BMM050_POWER_CONTROL_SPI3_ENABLE__MSK   (0x04)
 
#define BMM050_POWER_CONTROL_SPI3_ENABLE__REG   (BMM050_POWER_CONTROL)
 
#define BMM050_POWER_CONTROL_SOFT_RST_1__POS   (1)
 
#define BMM050_POWER_CONTROL_SOFT_RST_1__LEN   (1)
 
#define BMM050_POWER_CONTROL_SOFT_RST_1__MSK   (0x02)
 
#define BMM050_POWER_CONTROL_SOFT_RST_1__REG   (BMM050_POWER_CONTROL)
 
BIT MASK, LENGTH AND POSITION OF POWER MODE REGISTERS
#define BMM050_POWER_CONTROL_POWER_CONTROL_BIT__POS   (0)
 
#define BMM050_POWER_CONTROL_POWER_CONTROL_BIT__LEN   (1)
 
#define BMM050_POWER_CONTROL_POWER_CONTROL_BIT__MSK   (0x01)
 
#define BMM050_POWER_CONTROL_POWER_CONTROL_BIT__REG   (BMM050_POWER_CONTROL)
 
BIT MASK, LENGTH AND POSITION OF SELF TEST REGISTERS
#define BMM050_CONTROL_ADVANCED_SELFTEST__POS   (6)
 
#define BMM050_CONTROL_ADVANCED_SELFTEST__LEN   (2)
 
#define BMM050_CONTROL_ADVANCED_SELFTEST__MSK   (0xC0)
 
#define BMM050_CONTROL_ADVANCED_SELFTEST__REG   (BMM050_CONTROL)
 
#define BMM050_CONTROL_SELFTEST__POS   (0)
 
#define BMM050_CONTROL_SELFTEST__LEN   (1)
 
#define BMM050_CONTROL_SELFTEST__MSK   (0x01)
 
#define BMM050_CONTROL_SELFTEST__REG   (BMM050_CONTROL)
 
BIT MASK, LENGTH AND POSITION OF DATA RATE REGISTERS
#define BMM050_CONTROL_DATA_RATE__POS   (3)
 
#define BMM050_CONTROL_DATA_RATE__LEN   (3)
 
#define BMM050_CONTROL_DATA_RATE__MSK   (0x38)
 
#define BMM050_CONTROL_DATA_RATE__REG   (BMM050_CONTROL)
 
BIT MASK, LENGTH AND POSITION OF OPERATION MODE REGISTERS
#define BMM050_CONTROL_OPERATION_MODE__POS   (1)
 
#define BMM050_CONTROL_OPERATION_MODE__LEN   (2)
 
#define BMM050_CONTROL_OPERATION_MODE__MSK   (0x06)
 
#define BMM050_CONTROL_OPERATION_MODE__REG   (BMM050_CONTROL)
 
BIT MASK, LENGTH AND POSITION OF INTERRUPT CONTROL REGISTERS
#define BMM050_INT_CONTROL_DOR_EN__POS   (7)
 
#define BMM050_INT_CONTROL_DOR_EN__LEN   (1)
 
#define BMM050_INT_CONTROL_DOR_EN__MSK   (0x80)
 
#define BMM050_INT_CONTROL_DOR_EN__REG   (BMM050_INT_CONTROL)
 
#define BMM050_INT_CONTROL_OVRFLOW_EN__POS   (6)
 
#define BMM050_INT_CONTROL_OVRFLOW_EN__LEN   (1)
 
#define BMM050_INT_CONTROL_OVRFLOW_EN__MSK   (0x40)
 
#define BMM050_INT_CONTROL_OVRFLOW_EN__REG   (BMM050_INT_CONTROL)
 
#define BMM050_INT_CONTROL_HIGH_THZ_EN__POS   (5)
 
#define BMM050_INT_CONTROL_HIGH_THZ_EN__LEN   (1)
 
#define BMM050_INT_CONTROL_HIGH_THZ_EN__MSK   (0x20)
 
#define BMM050_INT_CONTROL_HIGH_THZ_EN__REG   (BMM050_INT_CONTROL)
 
#define BMM050_INT_CONTROL_HIGH_THY_EN__POS   (4)
 
#define BMM050_INT_CONTROL_HIGH_THY_EN__LEN   (1)
 
#define BMM050_INT_CONTROL_HIGH_THY_EN__MSK   (0x10)
 
#define BMM050_INT_CONTROL_HIGH_THY_EN__REG   (BMM050_INT_CONTROL)
 
#define BMM050_INT_CONTROL_HIGH_THX_EN__POS   (3)
 
#define BMM050_INT_CONTROL_HIGH_THX_EN__LEN   (1)
 
#define BMM050_INT_CONTROL_HIGH_THX_EN__MSK   (0x08)
 
#define BMM050_INT_CONTROL_HIGH_THX_EN__REG   (BMM050_INT_CONTROL)
 
#define BMM050_INT_CONTROL_LOW_THZ_EN__POS   (2)
 
#define BMM050_INT_CONTROL_LOW_THZ_EN__LEN   (1)
 
#define BMM050_INT_CONTROL_LOW_THZ_EN__MSK   (0x04)
 
#define BMM050_INT_CONTROL_LOW_THZ_EN__REG   (BMM050_INT_CONTROL)
 
#define BMM050_INT_CONTROL_LOW_THY_EN__POS   (1)
 
#define BMM050_INT_CONTROL_LOW_THY_EN__LEN   (1)
 
#define BMM050_INT_CONTROL_LOW_THY_EN__MSK   (0x02)
 
#define BMM050_INT_CONTROL_LOW_THY_EN__REG   (BMM050_INT_CONTROL)
 
#define BMM050_INT_CONTROL_LOW_THX_EN__POS   (0)
 
#define BMM050_INT_CONTROL_LOW_THX_EN__LEN   (1)
 
#define BMM050_INT_CONTROL_LOW_THX_EN__MSK   (0x01)
 
#define BMM050_INT_CONTROL_LOW_THX_EN__REG   (BMM050_INT_CONTROL)
 
#define BMM050_SENS_CONTROL_DRDY_EN__POS   (7)
 
#define BMM050_SENS_CONTROL_DRDY_EN__LEN   (1)
 
#define BMM050_SENS_CONTROL_DRDY_EN__MSK   (0x80)
 
#define BMM050_SENS_CONTROL_DRDY_EN__REG   (BMM050_SENS_CONTROL)
 
#define BMM050_SENS_CONTROL_IE__POS   (6)
 
#define BMM050_SENS_CONTROL_IE__LEN   (1)
 
#define BMM050_SENS_CONTROL_IE__MSK   (0x40)
 
#define BMM050_SENS_CONTROL_IE__REG   BMM050_SENS_CONTROL
 
#define BMM050_SENS_CONTROL_CHANNELZ__POS   (5)
 
#define BMM050_SENS_CONTROL_CHANNELZ__LEN   (1)
 
#define BMM050_SENS_CONTROL_CHANNELZ__MSK   (0x20)
 
#define BMM050_SENS_CONTROL_CHANNELZ__REG   (BMM050_SENS_CONTROL)
 
#define BMM050_SENS_CONTROL_CHANNELY__POS   (4)
 
#define BMM050_SENS_CONTROL_CHANNELY__LEN   (1)
 
#define BMM050_SENS_CONTROL_CHANNELY__MSK   (0x10)
 
#define BMM050_SENS_CONTROL_CHANNELY__REG   (BMM050_SENS_CONTROL)
 
#define BMM050_SENS_CONTROL_CHANNELX__POS   (3)
 
#define BMM050_SENS_CONTROL_CHANNELX__LEN   (1)
 
#define BMM050_SENS_CONTROL_CHANNELX__MSK   (0x08)
 
#define BMM050_SENS_CONTROL_CHANNELX__REG   (BMM050_SENS_CONTROL)
 
#define BMM050_SENS_CONTROL_DR_POLARITY__POS   (2)
 
#define BMM050_SENS_CONTROL_DR_POLARITY__LEN   (1)
 
#define BMM050_SENS_CONTROL_DR_POLARITY__MSK   (0x04)
 
#define BMM050_SENS_CONTROL_DR_POLARITY__REG   (BMM050_SENS_CONTROL)
 
#define BMM050_SENS_CONTROL_INTERRUPT_LATCH__POS   (1)
 
#define BMM050_SENS_CONTROL_INTERRUPT_LATCH__LEN   (1)
 
#define BMM050_SENS_CONTROL_INTERRUPT_LATCH__MSK   (0x02)
 
#define BMM050_SENS_CONTROL_INTERRUPT_LATCH__REG   (BMM050_SENS_CONTROL)
 
#define BMM050_SENS_CONTROL_INTERRUPT_POLARITY__POS   (0)
 
#define BMM050_SENS_CONTROL_INTERRUPT_POLARITY__LEN   (1)
 
#define BMM050_SENS_CONTROL_INTERRUPT_POLARITY__MSK   (0x01)
 
#define BMM050_SENS_CONTROL_INTERRUPT_POLARITY__REG   (BMM050_SENS_CONTROL)
 
BIT MASK, LENGTH AND POSITION OF TRIM REGISTER
#define BMM050_DIG_XYZ1_MSB__POS   (0)
 
#define BMM050_DIG_XYZ1_MSB__LEN   (7)
 
#define BMM050_DIG_XYZ1_MSB__MSK   (0x7F)
 
#define BMM050_DIG_XYZ1_MSB__REG   (BMM050_DIG_XYZ1_MSB)
 
ERROR CODE
#define E_BMM050_NULL_PTR   ((s8)-127)
 
#define ERROR   ((s8)-1)
 
#define E_BMM050_OUT_OF_RANGE   ((s8)-2)
 
#define BMM050_NULL   ((u8)0)
 
#define E_BMM050_UNDEFINED_MODE   (0)
 
RESET DEFINITIONS
#define BMM050_SOFT_RESET7_ON   (1)
 
#define BMM050_SOFT_RESET1_ON   (1)
 
#define BMM050_SOFT_RESET7_OFF   (0)
 
#define BMM050_SOFT_RESET1_OFF   (0)
 
#define BMM050_DELAY_SOFTRESET   (1)
 
DELAY DEFINITIONS
#define BMM050_DELAY_POWEROFF_SUSPEND   (1)
 
#define BMM050_DELAY_SUSPEND_SLEEP   (3)
 
#define BMM050_DELAY_SLEEP_ACTIVE   (1)
 
#define BMM050_DELAY_ACTIVE_SLEEP   (1)
 
#define BMM050_DELAY_SLEEP_SUSPEND   (1)
 
#define BMM050_DELAY_ACTIVE_SUSPEND   (1)
 
#define BMM050_DELAY_SLEEP_POWEROFF   (1)
 
#define BMM050_DELAY_ACTIVE_POWEROFF   (1)
 
#define BMM050_DELAY_SETTLING_TIME   (3)
 
#define BMM050_MDELAY_DATA_TYPE   u32
 
XYZ AXIS DEFINITIONS
#define BMM050_X_AXIS   (0)
 
#define BMM050_Y_AXIS   (1)
 
#define BMM050_Z_AXIS   (2)
 
#define BMM050_RESISTANCE   (3)
 
#define BMM050_X   (1)
 
#define BMM050_Y   (2)
 
#define BMM050_Z   (4)
 
#define BMM050_XYZ   (7)
 
ENABLE/DISABLE DEFINITIONS
#define BMM050_CHANNEL_DISABLE   (1)
 
#define BMM050_CHANNEL_ENABLE   (0)
 
#define BMM050_OFF   (0)
 
#define BMM050_ON   (1)
 
SELF TEST DEFINITIONS
#define BMM050_ADVANCED_SELFTEST_OFF   (0)
 
#define BMM050_ADVANCED_SELFTEST_NEGATIVE   (2)
 
#define BMM050_ADVANCED_SELFTEST_POSITIVE   (3)
 
#define BMM050_NEGATIVE_SATURATION_Z   (-32767)
 
#define BMM050_POSITIVE_SATURATION_Z   (32767)
 
SPI READ/WRITE DEFINITIONS
#define BMM050_SPI_RD_MASK   (0x80)
 
#define BMM050_READ_SET   (0x01)
 
READ AND WRITE FUNCTION POINTERS
#define BMM050_WR_FUNC_PTR
 
#define BMM050_RD_FUNC_PTR
 
NUMERIC DEFINITIONS
#define BMM050_GEN_READ_WRITE_DATA_LENGTH   ((u8)1)
 
#define BMM050_TRIM_DATA_LENGTH   ((u8)2)
 
#define BMM050_SELFTEST_DELAY   ((u8)4)
 
#define BMM050_SELFTEST_DATA_LENGTH   ((u8)5)
 
#define BMM050_ALL_DATA_FRAME_LENGTH   ((u8)8)
 
#define BMM050_INIT_VALUE   (0)
 
GET AND SET BITSLICE FUNCTIONS
#define BMM050_GET_BITSLICE(regvar, bitname)   ((regvar & bitname##__MSK) >> bitname##__POS)
 
#define BMM050_SET_BITSLICE(regvar, bitname, val)   ((regvar & ~bitname##__MSK) | ((val<<bitname##__POS)&bitname##__MSK))
 
OVERFLOW DEFINITIONS
#define BMM050_OVERFLOW_OUTPUT   -32768
 
#define BMM050_OVERFLOW_OUTPUT_S32   ((s32)(-2147483647-1))
 
#define BMM050_OVERFLOW_OUTPUT_FLOAT   0.0f
 
#define BMM050_FLIP_OVERFLOW_ADCVAL   -4096
 
#define BMM050_HALL_OVERFLOW_ADCVAL   -16384
 
PRESET MODE DEFINITIONS
#define BMM050_PRESETMODE_LOWPOWER   (1)
 
#define BMM050_PRESETMODE_REGULAR   (2)
 
#define BMM050_PRESETMODE_HIGHACCURACY   (3)
 
#define BMM050_PRESETMODE_ENHANCED   (4)
 
#define BMM050_LOWPOWER_DR   (BMM050_DR_10HZ)
 
#define BMM050_REGULAR_DR   (BMM050_DR_10HZ)
 
#define BMM050_HIGHACCURACY_DR   (BMM050_DR_20HZ)
 
#define BMM050_ENHANCED_DR   (BMM050_DR_10HZ)
 
#define BMM050_LOWPOWER_REPXY   (1)
 
#define BMM050_REGULAR_REPXY   (4)
 
#define BMM050_HIGHACCURACY_REPXY   (23)
 
#define BMM050_ENHANCED_REPXY   (7)
 
#define BMM050_LOWPOWER_REPZ   (2)
 
#define BMM050_REGULAR_REPZ   (14)
 
#define BMM050_HIGHACCURACY_REPZ   (82)
 
#define BMM050_ENHANCED_REPZ   (26)
 
DATA RATE DEFINITIONS
#define BMM050_DR_10HZ   (0)
 
#define BMM050_DR_02HZ   (1)
 
#define BMM050_DR_06HZ   (2)
 
#define BMM050_DR_08HZ   (3)
 
#define BMM050_DR_15HZ   (4)
 
#define BMM050_DR_20HZ   (5)
 
#define BMM050_DR_25HZ   (6)
 
#define BMM050_DR_30HZ   (7)
 
#define BMM050_DATA_RATE_10HZ   (0x00)
 
#define BMM050_DATA_RATE_02HZ   (0x01)
 
#define BMM050_DATA_RATE_06HZ   (0x02)
 
#define BMM050_DATA_RATE_08HZ   (0x03)
 
#define BMM050_DATA_RATE_15HZ   (0x04)
 
#define BMM050_DATA_RATE_20HZ   (0x05)
 
#define BMM050_DATA_RATE_25HZ   (0x06)
 
#define BMM050_DATA_RATE_30HZ   (0x07)
 
BIT SHIFTING DEFINITIONS
#define BMM050_SHIFT_BIT_POSITION_BY_01_BIT   (1)
 
#define BMM050_SHIFT_BIT_POSITION_BY_02_BITS   (2)
 
#define BMM050_SHIFT_BIT_POSITION_BY_03_BITS   (3)
 
#define BMM050_SHIFT_BIT_POSITION_BY_05_BITS   (5)
 
#define BMM050_SHIFT_BIT_POSITION_BY_06_BITS   (6)
 
#define BMM050_SHIFT_BIT_POSITION_BY_07_BITS   (7)
 
#define BMM050_SHIFT_BIT_POSITION_BY_08_BITS   (8)
 
#define BMM050_SHIFT_BIT_POSITION_BY_09_BITS   (9)
 
#define BMM050_SHIFT_BIT_POSITION_BY_12_BITS   (12)
 
#define BMM050_SHIFT_BIT_POSITION_BY_13_BITS   (13)
 
#define BMM050_SHIFT_BIT_POSITION_BY_16_BITS   (16)
 
#define BMM050_SHIFT_BIT_POSITION_BY_14_BITS   (14)
 
#define BMM050_SHIFT_BIT_POSITION_BY_15_BITS   (15)
 
ARRAY SIZE DEFINITIONS
#define BMM050_DATA_FRAME_SIZE   (8)
 
#define BMM050_INIT_DATA_SIZE   (2)
 
#define BMM050_CHIP_ID_DATA   (0)
 
#define BMM050_SELFTEST_DATA_SIZE   (5)
 
#define BMM050_TRIM_DATA_SIZE   (2)
 
#define BMM050_XLSB_DATA   (0)
 
#define BMM050_XMSB_DATA   (1)
 
#define BMM050_YLSB_DATA   (2)
 
#define BMM050_YMSB_DATA   (3)
 
#define BMM050_ZLSB_DATA   (4)
 
#define BMM050_ZMSB_DATA   (5)
 
#define BMM050_RLSB_DATA   (6)
 
#define BMM050_RMSB_DATA   (7)
 
#define BMM050_TRIM_DIG_Z1_LSB_DATA   (0)
 
#define BMM050_TRIM_DIG_Z1_MSB_DATA   (1)
 
#define BMM050_TRIM_DIG_Z2_LSB_DATA   (0)
 
#define BMM050_TRIM_DIG_Z2_MSB_DATA   (1)
 
#define BMM050_TRIM_DIG_Z3_LSB_DATA   (0)
 
#define BMM050_TRIM_DIG_Z3_MSB_DATA   (1)
 
#define BMM050_TRIM_DIG_Z4_LSB_DATA   (0)
 
#define BMM050_TRIM_DIG_Z4_MSB_DATA   (1)
 
#define BMM050_TRIM_DIG_XYZ1_LSB_DATA   (0)
 
#define BMM050_TRIM_DIG_XYZ1_MSB_DATA   (1)
 
#define BMM050_REMAPPED_YLSB_DATA   (0)
 
#define BMM050_REMAPPED_YMSB_DATA   (1)
 
#define BMM050_REMAPPED_XLSB_DATA   (2)
 
#define BMM050_REMAPPED_XMSB_DATA   (3)
 

Typedefs

typedef signed short int s16
 
typedef signed int s32
 
typedef signed long long int s64
 
typedef signed char s8
 If your machine support 16 bit define the MACHINE_16_BIT. More...
 
typedef unsigned short int u16
 
typedef unsigned int u32
 
typedef unsigned long long int u64
 
typedef unsigned char u8
 

Functions

INITIALIZATION
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...
 
DATA READ FUNCTIONS
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_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_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_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...
 
COMMON READ AND WRITE FUNCTIONS
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_write_register (u8 v_addr_u8, u8 *v_data_u8, u8 v_len_u8)
 This API write the data to the given register. More...
 
SELF TEST FUNCTION
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_get_selftest_XYZ (u8 *v_selftest_xyz)
 This API used to read the selftest of the sensor. More...
 
SPI ENABLE FUNCTION
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...
 
DATA RATE FUNCTIONS
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_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...
 
FUNCTIONAL STATE FUNCTION
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_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...
 
ADVANCED SELFTEST
BMM050_RETURN_FUNCTION_TYPE bmm050_perform_advanced_selftest (s16 *v_diff_z_s16)
 This API used to perform the advanced self test. More...
 
TRIM REGISTER
BMM050_RETURN_FUNCTION_TYPE bmm050_init_trim_registers (void)
 This API used to get the trim values. More...
 
SET ADVANCED SELFTEST
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_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...
 
POWER MODE
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_set_power_mode (u8 v_power_mode_u8)
 This API used to set the power control bit in the register 0x4B bit 0. More...
 
XY AND Z REPETITIONS
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_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_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_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...
 
PRESET MODE
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_set_presetmode (u8 v_presetmode_u8)
 This API used to set the preset modes. More...
 
COMPENSATE X DATA
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...
 
COMPENSATE Y DATA
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...
 
COMPENSATE Z DATA
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...
 
CONTROL MEASUREMENT OF X AND Y
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...
 
SOFT RESET
BMM050_RETURN_FUNCTION_TYPE bmm050_soft_rst (void)
 This API used reset the register values to default in the register 0x4B. More...
 
RAW XYZ DATA
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...
 
REMAPPED RAW XYZ DATA
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...
 

Macro Definition Documentation

#define BMM050_ADVANCED_SELFTEST_NEGATIVE   (2)
#define BMM050_ADVANCED_SELFTEST_OFF   (0)
#define BMM050_ADVANCED_SELFTEST_POSITIVE   (3)
#define BMM050_ALL_DATA_FRAME_LENGTH   ((u8)8)

Frame length refers the x,y,z and r values

#define BMM050_BUS_RD_PARAM_ORDER   (device_addr, register_addr, register_data)
#define BMM050_BUS_RD_PARAM_TYPES   u8, u8, u8 *, u8
#define BMM050_BUS_RD_RETURN_TYPE   s8
Note
The bus write function can change since this is a system dependant issue.
If the bus_read parameter calling order is like: reg_addr, reg_data, wr_len it would be as it is here.
If the parameters are differently ordered or your communication function like I2C need to know the device address, you can change this macro accordingly.
BMM050_BUS_READ_FUNC(dev_addr, reg_addr, reg_data, wr_len)\ bus_read(dev_addr, reg_addr, reg_data, wr_len)
This macro lets all API functions call YOUR communication routine in a way that equals your definition in the refer BMM050_RD_FUNC_PTR definition.
: this macro also includes the "MSB='1' for reading BMM050 addresses.
#define BMM050_BUS_READ_FUNC (   device_addr,
  register_addr,
  register_data,
  rd_len 
)    bus_read(device_addr, register_addr, register_data, rd_len)
#define BMM050_BUS_WR_PARAM_ORDER   (device_addr, register_addr, register_data, wr_len)
#define BMM050_BUS_WR_PARAM_TYPES   u8, u8, u8 *, u8
#define BMM050_BUS_WR_RETURN_TYPE   s8
Note
This includes types of parameters. This example shows the configuration for an SPI bus link.

If your communication function looks like this:

write_my_bus_xy(u8 device_addr, u8 register_addr, u8 * data, u8 length);

The BMM050_WR_FUNC_PTR would equal:

BMM050_WR_FUNC_PTR s8 (* bus_write)(u8, u8, u8 *, u8)

Parameters can be mixed as needed refer to the refer BMM050_BUS_WRITE_FUNC macro.

#define BMM050_BUS_WRITE_FUNC (   device_addr,
  register_addr,
  register_data,
  wr_len 
)    bus_write(device_addr, register_addr, register_data, wr_len)
#define BMM050_CHANNEL_DISABLE   (1)
#define BMM050_CHANNEL_ENABLE   (0)
#define BMM050_CHIP_ID   (0x40)
#define BMM050_CHIP_ID_DATA   (0)
#define BMM050_CONTROL   (0x4C)
#define BMM050_CONTROL_ADVANCED_SELFTEST__LEN   (2)
#define BMM050_CONTROL_ADVANCED_SELFTEST__MSK   (0xC0)
#define BMM050_CONTROL_ADVANCED_SELFTEST__POS   (6)
#define BMM050_CONTROL_ADVANCED_SELFTEST__REG   (BMM050_CONTROL)
#define BMM050_CONTROL_DATA_RATE__LEN   (3)
#define BMM050_CONTROL_DATA_RATE__MSK   (0x38)
#define BMM050_CONTROL_DATA_RATE__POS   (3)
#define BMM050_CONTROL_DATA_RATE__REG   (BMM050_CONTROL)
#define BMM050_CONTROL_OPERATION_MODE__LEN   (2)
#define BMM050_CONTROL_OPERATION_MODE__MSK   (0x06)
#define BMM050_CONTROL_OPERATION_MODE__POS   (1)
#define BMM050_CONTROL_OPERATION_MODE__REG   (BMM050_CONTROL)
#define BMM050_CONTROL_SELFTEST__LEN   (1)
#define BMM050_CONTROL_SELFTEST__MSK   (0x01)
#define BMM050_CONTROL_SELFTEST__POS   (0)
#define BMM050_CONTROL_SELFTEST__REG   (BMM050_CONTROL)
#define BMM050_DATA_FRAME_SIZE   (8)
#define BMM050_DATA_R_LSB   (0x48)
#define BMM050_DATA_R_LSB_BIT__LEN   (6)
#define BMM050_DATA_R_LSB_BIT__MSK   (0xFC)
#define BMM050_DATA_R_LSB_BIT__POS   (2)
#define BMM050_DATA_R_LSB_BIT__REG   (BMM050_DATA_R_LSB)
#define BMM050_DATA_R_MSB   (0x49)
#define BMM050_DATA_RATE_02HZ   (0x01)
#define BMM050_DATA_RATE_06HZ   (0x02)
#define BMM050_DATA_RATE_08HZ   (0x03)
#define BMM050_DATA_RATE_10HZ   (0x00)
#define BMM050_DATA_RATE_15HZ   (0x04)
#define BMM050_DATA_RATE_20HZ   (0x05)
#define BMM050_DATA_RATE_25HZ   (0x06)
#define BMM050_DATA_RATE_30HZ   (0x07)
#define BMM050_DATA_RDYSTAT__LEN   (1)
#define BMM050_DATA_RDYSTAT__MSK   (0x01)
#define BMM050_DATA_RDYSTAT__POS   (0)
#define BMM050_DATA_RDYSTAT__REG   (BMM050_DATA_R_LSB)
#define BMM050_DATA_X_LSB   (0x42)
#define BMM050_DATA_X_LSB_BIT__LEN   (5)
#define BMM050_DATA_X_LSB_BIT__MSK   (0xF8)
#define BMM050_DATA_X_LSB_BIT__POS   (3)
#define BMM050_DATA_X_LSB_BIT__REG   (BMM050_DATA_X_LSB)
#define BMM050_DATA_X_LSB_TESTX__LEN   (1)
#define BMM050_DATA_X_LSB_TESTX__MSK   (0x01)
#define BMM050_DATA_X_LSB_TESTX__POS   (0)
#define BMM050_DATA_X_LSB_TESTX__REG   (BMM050_DATA_X_LSB)
#define BMM050_DATA_X_MSB   (0x43)
#define BMM050_DATA_Y_LSB   (0x44)
#define BMM050_DATA_Y_LSB_BIT__LEN   (5)
#define BMM050_DATA_Y_LSB_BIT__MSK   (0xF8)
#define BMM050_DATA_Y_LSB_BIT__POS   (3)
#define BMM050_DATA_Y_LSB_BIT__REG   (BMM050_DATA_Y_LSB)
#define BMM050_DATA_Y_LSB_TESTY__LEN   (1)
#define BMM050_DATA_Y_LSB_TESTY__MSK   (0x01)
#define BMM050_DATA_Y_LSB_TESTY__POS   (0)
#define BMM050_DATA_Y_LSB_TESTY__REG   (BMM050_DATA_Y_LSB)
#define BMM050_DATA_Y_MSB   (0x45)
#define BMM050_DATA_Z_LSB   (0x46)
#define BMM050_DATA_Z_LSB_BIT__LEN   (7)
#define BMM050_DATA_Z_LSB_BIT__MSK   (0xFE)
#define BMM050_DATA_Z_LSB_BIT__POS   (1)
#define BMM050_DATA_Z_LSB_BIT__REG   (BMM050_DATA_Z_LSB)
#define BMM050_DATA_Z_LSB_TESTZ__LEN   (1)
#define BMM050_DATA_Z_LSB_TESTZ__MSK   (0x01)
#define BMM050_DATA_Z_LSB_TESTZ__POS   (0)
#define BMM050_DATA_Z_LSB_TESTZ__REG   (BMM050_DATA_Z_LSB)
#define BMM050_DATA_Z_MSB   (0x47)
#define BMM050_DELAY_ACTIVE_POWEROFF   (1)
#define BMM050_DELAY_ACTIVE_SLEEP   (1)
#define BMM050_DELAY_ACTIVE_SUSPEND   (1)
#define BMM050_DELAY_FUNC (   delay_in_msec)    delay_func(delay_in_msec)
#define BMM050_DELAY_POWEROFF_SUSPEND   (1)
#define BMM050_DELAY_RETURN_TYPE   void
#define BMM050_DELAY_SETTLING_TIME   (3)
#define BMM050_DELAY_SLEEP_ACTIVE   (1)
#define BMM050_DELAY_SLEEP_POWEROFF   (1)
#define BMM050_DELAY_SLEEP_SUSPEND   (1)
#define BMM050_DELAY_SOFTRESET   (1)
#define BMM050_DELAY_SUSPEND_SLEEP   (3)
#define BMM050_DIG_X1   (0x5D)
#define BMM050_DIG_X2   (0x64)
#define BMM050_DIG_XY1   (0x71)
#define BMM050_DIG_XY2   (0x70)
#define BMM050_DIG_XYZ1_LSB   (0x6C)
#define BMM050_DIG_XYZ1_MSB   (0x6D)
#define BMM050_DIG_XYZ1_MSB__LEN   (7)
#define BMM050_DIG_XYZ1_MSB__MSK   (0x7F)
#define BMM050_DIG_XYZ1_MSB__POS   (0)
#define BMM050_DIG_XYZ1_MSB__REG   (BMM050_DIG_XYZ1_MSB)
#define BMM050_DIG_Y1   (0x5E)
#define BMM050_DIG_Y2   (0x65)
#define BMM050_DIG_Z1_LSB   (0x6A)
#define BMM050_DIG_Z1_MSB   (0x6B)
#define BMM050_DIG_Z2_LSB   (0x68)
#define BMM050_DIG_Z2_MSB   (0x69)
#define BMM050_DIG_Z3_LSB   (0x6E)
#define BMM050_DIG_Z3_MSB   (0x6F)
#define BMM050_DIG_Z4_LSB   (0x62)
#define BMM050_DIG_Z4_MSB   (0x63)
#define BMM050_DR_02HZ   (1)
#define BMM050_DR_06HZ   (2)
#define BMM050_DR_08HZ   (3)
#define BMM050_DR_10HZ   (0)
#define BMM050_DR_15HZ   (4)
#define BMM050_DR_20HZ   (5)
#define BMM050_DR_25HZ   (6)
#define BMM050_DR_30HZ   (7)
#define BMM050_ENHANCED_DR   (BMM050_DR_10HZ)
#define BMM050_ENHANCED_REPXY   (7)
#define BMM050_ENHANCED_REPZ   (26)
#define BMM050_FLIP_OVERFLOW_ADCVAL   -4096
#define BMM050_FORCED_MODE   (0x01)
#define BMM050_GEN_READ_WRITE_DATA_LENGTH   ((u8)1)
#define BMM050_GET_BITSLICE (   regvar,
  bitname 
)    ((regvar & bitname##__MSK) >> bitname##__POS)
#define BMM050_HALL_OVERFLOW_ADCVAL   -16384
#define BMM050_HIGH_THRES   (0x50)
#define BMM050_HIGHACCURACY_DR   (BMM050_DR_20HZ)
#define BMM050_HIGHACCURACY_REPXY   (23)
#define BMM050_HIGHACCURACY_REPZ   (82)
#define BMM050_I2C_ADDRESS   (0x10)
#define BMM050_INIT_DATA_SIZE   (2)
#define BMM050_INIT_VALUE   (0)
#define BMM050_INT_CONTROL   (0x4D)
#define BMM050_INT_CONTROL_DOR_EN__LEN   (1)
#define BMM050_INT_CONTROL_DOR_EN__MSK   (0x80)
#define BMM050_INT_CONTROL_DOR_EN__POS   (7)
#define BMM050_INT_CONTROL_DOR_EN__REG   (BMM050_INT_CONTROL)
#define BMM050_INT_CONTROL_HIGH_THX_EN__LEN   (1)
#define BMM050_INT_CONTROL_HIGH_THX_EN__MSK   (0x08)
#define BMM050_INT_CONTROL_HIGH_THX_EN__POS   (3)
#define BMM050_INT_CONTROL_HIGH_THX_EN__REG   (BMM050_INT_CONTROL)
#define BMM050_INT_CONTROL_HIGH_THY_EN__LEN   (1)
#define BMM050_INT_CONTROL_HIGH_THY_EN__MSK   (0x10)
#define BMM050_INT_CONTROL_HIGH_THY_EN__POS   (4)
#define BMM050_INT_CONTROL_HIGH_THY_EN__REG   (BMM050_INT_CONTROL)
#define BMM050_INT_CONTROL_HIGH_THZ_EN__LEN   (1)
#define BMM050_INT_CONTROL_HIGH_THZ_EN__MSK   (0x20)
#define BMM050_INT_CONTROL_HIGH_THZ_EN__POS   (5)
#define BMM050_INT_CONTROL_HIGH_THZ_EN__REG   (BMM050_INT_CONTROL)
#define BMM050_INT_CONTROL_LOW_THX_EN__LEN   (1)
#define BMM050_INT_CONTROL_LOW_THX_EN__MSK   (0x01)
#define BMM050_INT_CONTROL_LOW_THX_EN__POS   (0)
#define BMM050_INT_CONTROL_LOW_THX_EN__REG   (BMM050_INT_CONTROL)
#define BMM050_INT_CONTROL_LOW_THY_EN__LEN   (1)
#define BMM050_INT_CONTROL_LOW_THY_EN__MSK   (0x02)
#define BMM050_INT_CONTROL_LOW_THY_EN__POS   (1)
#define BMM050_INT_CONTROL_LOW_THY_EN__REG   (BMM050_INT_CONTROL)
#define BMM050_INT_CONTROL_LOW_THZ_EN__LEN   (1)
#define BMM050_INT_CONTROL_LOW_THZ_EN__MSK   (0x04)
#define BMM050_INT_CONTROL_LOW_THZ_EN__POS   (2)
#define BMM050_INT_CONTROL_LOW_THZ_EN__REG   (BMM050_INT_CONTROL)
#define BMM050_INT_CONTROL_OVRFLOW_EN__LEN   (1)
#define BMM050_INT_CONTROL_OVRFLOW_EN__MSK   (0x40)
#define BMM050_INT_CONTROL_OVRFLOW_EN__POS   (6)
#define BMM050_INT_CONTROL_OVRFLOW_EN__REG   (BMM050_INT_CONTROL)
#define BMM050_INT_STAT_DOR__LEN   (1)
#define BMM050_INT_STAT_DOR__MSK   (0x80)
#define BMM050_INT_STAT_DOR__POS   (7)
#define BMM050_INT_STAT_DOR__REG   (BMM050_INT_STAT_REG)
#define BMM050_INT_STAT_HIGH_THX__LEN   (1)
#define BMM050_INT_STAT_HIGH_THX__MSK   (0x08)
#define BMM050_INT_STAT_HIGH_THX__POS   (3)
#define BMM050_INT_STAT_HIGH_THX__REG   (BMM050_INT_STAT_REG)
#define BMM050_INT_STAT_HIGH_THY__LEN   (1)
#define BMM050_INT_STAT_HIGH_THY__MSK   (0x10)
#define BMM050_INT_STAT_HIGH_THY__POS   (4)
#define BMM050_INT_STAT_HIGH_THY__REG   (BMM050_INT_STAT_REG)
#define BMM050_INT_STAT_HIGH_THZ__LEN   (1)
#define BMM050_INT_STAT_HIGH_THZ__MSK   (0x20)
#define BMM050_INT_STAT_HIGH_THZ__POS   (5)
#define BMM050_INT_STAT_HIGH_THZ__REG   (BMM050_INT_STAT_REG)
#define BMM050_INT_STAT_LOW_THX__LEN   (1)
#define BMM050_INT_STAT_LOW_THX__MSK   (0x01)
#define BMM050_INT_STAT_LOW_THX__POS   (0)
#define BMM050_INT_STAT_LOW_THX__REG   (BMM050_INT_STAT_REG)
#define BMM050_INT_STAT_LOW_THY__LEN   (1)
#define BMM050_INT_STAT_LOW_THY__MSK   (0x02)
#define BMM050_INT_STAT_LOW_THY__POS   (1)
#define BMM050_INT_STAT_LOW_THY__REG   (BMM050_INT_STAT_REG)
#define BMM050_INT_STAT_LOW_THZ__LEN   (1)
#define BMM050_INT_STAT_LOW_THZ__MSK   (0x04)
#define BMM050_INT_STAT_LOW_THZ__POS   (2)
#define BMM050_INT_STAT_LOW_THZ__REG   (BMM050_INT_STAT_REG)
#define BMM050_INT_STAT_OVRFLOW__LEN   (1)
#define BMM050_INT_STAT_OVRFLOW__MSK   (0x40)
#define BMM050_INT_STAT_OVRFLOW__POS   (6)
#define BMM050_INT_STAT_OVRFLOW__REG   (BMM050_INT_STAT_REG)
#define BMM050_INT_STAT_REG   (0x4A)
#define BMM050_LOW_THRES   (0x4F)
#define BMM050_LOWPOWER_DR   (BMM050_DR_10HZ)
#define BMM050_LOWPOWER_REPXY   (1)
#define BMM050_LOWPOWER_REPZ   (2)
#define BMM050_MDELAY_DATA_TYPE   u32
#define BMM050_NEGATIVE_SATURATION_Z   (-32767)
#define BMM050_NORMAL_MODE   (0x00)
#define BMM050_NULL   ((u8)0)
#define BMM050_OFF   (0)
#define BMM050_ON   (1)
#define BMM050_OVERFLOW_OUTPUT   -32768
#define BMM050_OVERFLOW_OUTPUT_FLOAT   0.0f
#define BMM050_OVERFLOW_OUTPUT_S32   ((s32)(-2147483647-1))
#define BMM050_POSITIVE_SATURATION_Z   (32767)
#define BMM050_POWER_CONTROL   (0x4B)
#define BMM050_POWER_CONTROL_POWER_CONTROL_BIT__LEN   (1)
#define BMM050_POWER_CONTROL_POWER_CONTROL_BIT__MSK   (0x01)
#define BMM050_POWER_CONTROL_POWER_CONTROL_BIT__POS   (0)
#define BMM050_POWER_CONTROL_POWER_CONTROL_BIT__REG   (BMM050_POWER_CONTROL)
#define BMM050_POWER_CONTROL_SOFT_RST_1__LEN   (1)
#define BMM050_POWER_CONTROL_SOFT_RST_1__MSK   (0x02)
#define BMM050_POWER_CONTROL_SOFT_RST_1__POS   (1)
#define BMM050_POWER_CONTROL_SOFT_RST_1__REG   (BMM050_POWER_CONTROL)
#define BMM050_POWER_CONTROL_SOFT_RST_7__LEN   (1)
#define BMM050_POWER_CONTROL_SOFT_RST_7__MSK   (0x80)
#define BMM050_POWER_CONTROL_SOFT_RST_7__POS   (7)
#define BMM050_POWER_CONTROL_SOFT_RST_7__REG   (BMM050_POWER_CONTROL)
#define BMM050_POWER_CONTROL_SPI3_ENABLE__LEN   (1)
#define BMM050_POWER_CONTROL_SPI3_ENABLE__MSK   (0x04)
#define BMM050_POWER_CONTROL_SPI3_ENABLE__POS   (2)
#define BMM050_POWER_CONTROL_SPI3_ENABLE__REG   (BMM050_POWER_CONTROL)
#define BMM050_PRESETMODE_ENHANCED   (4)
#define BMM050_PRESETMODE_HIGHACCURACY   (3)
#define BMM050_PRESETMODE_LOWPOWER   (1)
#define BMM050_PRESETMODE_REGULAR   (2)
#define BMM050_RD_FUNC_PTR
Value:
s8 (*bus_read)(u8, u8, \
u8 *, u8)
signed char s8
If your machine support 16 bit define the MACHINE_16_BIT.
Definition: bmm050.h:194
unsigned char u8
Definition: bmm050.h:200
#define BMM050_READ_SET   (0x01)
#define BMM050_REGULAR_DR   (BMM050_DR_10HZ)
#define BMM050_REGULAR_REPXY   (4)
#define BMM050_REGULAR_REPZ   (14)
#define BMM050_REMAPPED_BMX055_DATA_X_LSB   (0x44)
#define BMM050_REMAPPED_BMX055_DATA_X_LSB_BIT__LEN   (5)
#define BMM050_REMAPPED_BMX055_DATA_X_LSB_BIT__MSK   (0xF8)
#define BMM050_REMAPPED_BMX055_DATA_X_LSB_BIT__POS   (3)
#define BMM050_REMAPPED_BMX055_DATA_X_LSB_BIT__REG (   BMM050_REMAPPED_BMX055_DATA_X_LSB)
#define BMM050_REMAPPED_BMX055_DATA_X_MSB   (0x45)
#define BMM050_REMAPPED_BMX055_DATA_Y_LSB   (0x42)
#define BMM050_REMAPPED_BMX055_DATA_Y_LSB_BIT__LEN   (5)
#define BMM050_REMAPPED_BMX055_DATA_Y_LSB_BIT__MSK   (0xF8)
#define BMM050_REMAPPED_BMX055_DATA_Y_LSB_BIT__POS   (3)
#define BMM050_REMAPPED_BMX055_DATA_Y_LSB_BIT__REG (   BMM050_REMAPPED_BMX055_DATA_Y_LSB)
#define BMM050_REMAPPED_BMX055_DATA_Y_MSB   (0x43)
#define BMM050_REMAPPED_XLSB_DATA   (2)
#define BMM050_REMAPPED_XMSB_DATA   (3)
#define BMM050_REMAPPED_YLSB_DATA   (0)
#define BMM050_REMAPPED_YMSB_DATA   (1)
#define BMM050_REP_XY   (0x51)
#define BMM050_REP_Z   (0x52)
#define BMM050_RESISTANCE   (3)
#define BMM050_RETURN_FUNCTION_TYPE   s8
#define BMM050_RLSB_DATA   (6)
#define BMM050_RMSB_DATA   (7)
#define BMM050_SELFTEST_DATA_LENGTH   ((u8)5)
#define BMM050_SELFTEST_DATA_SIZE   (5)
#define BMM050_SELFTEST_DELAY   ((u8)4)
#define BMM050_SENS_CONTROL   (0x4E)
#define BMM050_SENS_CONTROL_CHANNELX__LEN   (1)
#define BMM050_SENS_CONTROL_CHANNELX__MSK   (0x08)
#define BMM050_SENS_CONTROL_CHANNELX__POS   (3)
#define BMM050_SENS_CONTROL_CHANNELX__REG   (BMM050_SENS_CONTROL)
#define BMM050_SENS_CONTROL_CHANNELY__LEN   (1)
#define BMM050_SENS_CONTROL_CHANNELY__MSK   (0x10)
#define BMM050_SENS_CONTROL_CHANNELY__POS   (4)
#define BMM050_SENS_CONTROL_CHANNELY__REG   (BMM050_SENS_CONTROL)
#define BMM050_SENS_CONTROL_CHANNELZ__LEN   (1)
#define BMM050_SENS_CONTROL_CHANNELZ__MSK   (0x20)
#define BMM050_SENS_CONTROL_CHANNELZ__POS   (5)
#define BMM050_SENS_CONTROL_CHANNELZ__REG   (BMM050_SENS_CONTROL)
#define BMM050_SENS_CONTROL_DR_POLARITY__LEN   (1)
#define BMM050_SENS_CONTROL_DR_POLARITY__MSK   (0x04)
#define BMM050_SENS_CONTROL_DR_POLARITY__POS   (2)
#define BMM050_SENS_CONTROL_DR_POLARITY__REG   (BMM050_SENS_CONTROL)
#define BMM050_SENS_CONTROL_DRDY_EN__LEN   (1)
#define BMM050_SENS_CONTROL_DRDY_EN__MSK   (0x80)
#define BMM050_SENS_CONTROL_DRDY_EN__POS   (7)
#define BMM050_SENS_CONTROL_DRDY_EN__REG   (BMM050_SENS_CONTROL)
#define BMM050_SENS_CONTROL_IE__LEN   (1)
#define BMM050_SENS_CONTROL_IE__MSK   (0x40)
#define BMM050_SENS_CONTROL_IE__POS   (6)
#define BMM050_SENS_CONTROL_IE__REG   BMM050_SENS_CONTROL
#define BMM050_SENS_CONTROL_INTERRUPT_LATCH__LEN   (1)
#define BMM050_SENS_CONTROL_INTERRUPT_LATCH__MSK   (0x02)
#define BMM050_SENS_CONTROL_INTERRUPT_LATCH__POS   (1)
#define BMM050_SENS_CONTROL_INTERRUPT_LATCH__REG   (BMM050_SENS_CONTROL)
#define BMM050_SENS_CONTROL_INTERRUPT_POLARITY__LEN   (1)
#define BMM050_SENS_CONTROL_INTERRUPT_POLARITY__MSK   (0x01)
#define BMM050_SENS_CONTROL_INTERRUPT_POLARITY__POS   (0)
#define BMM050_SENS_CONTROL_INTERRUPT_POLARITY__REG   (BMM050_SENS_CONTROL)
#define BMM050_SET_BITSLICE (   regvar,
  bitname,
  val 
)    ((regvar & ~bitname##__MSK) | ((val<<bitname##__POS)&bitname##__MSK))
#define BMM050_SHIFT_BIT_POSITION_BY_01_BIT   (1)
#define BMM050_SHIFT_BIT_POSITION_BY_02_BITS   (2)
#define BMM050_SHIFT_BIT_POSITION_BY_03_BITS   (3)
#define BMM050_SHIFT_BIT_POSITION_BY_05_BITS   (5)
#define BMM050_SHIFT_BIT_POSITION_BY_06_BITS   (6)
#define BMM050_SHIFT_BIT_POSITION_BY_07_BITS   (7)
#define BMM050_SHIFT_BIT_POSITION_BY_08_BITS   (8)
#define BMM050_SHIFT_BIT_POSITION_BY_09_BITS   (9)
#define BMM050_SHIFT_BIT_POSITION_BY_12_BITS   (12)
#define BMM050_SHIFT_BIT_POSITION_BY_13_BITS   (13)
#define BMM050_SHIFT_BIT_POSITION_BY_14_BITS   (14)
#define BMM050_SHIFT_BIT_POSITION_BY_15_BITS   (15)
#define BMM050_SHIFT_BIT_POSITION_BY_16_BITS   (16)
#define BMM050_SLEEP_MODE   (0x03)
#define BMM050_SOFT_RESET1_OFF   (0)
#define BMM050_SOFT_RESET1_ON   (1)
#define BMM050_SOFT_RESET7_OFF   (0)
#define BMM050_SOFT_RESET7_ON   (1)
#define BMM050_SPI_RD_MASK   (0x80)
#define BMM050_SUSPEND_MODE   (0x02)
#define BMM050_TRIM_DATA_LENGTH   ((u8)2)
#define BMM050_TRIM_DATA_SIZE   (2)
#define BMM050_TRIM_DIG_XYZ1_LSB_DATA   (0)
#define BMM050_TRIM_DIG_XYZ1_MSB_DATA   (1)
#define BMM050_TRIM_DIG_Z1_LSB_DATA   (0)
#define BMM050_TRIM_DIG_Z1_MSB_DATA   (1)
#define BMM050_TRIM_DIG_Z2_LSB_DATA   (0)
#define BMM050_TRIM_DIG_Z2_MSB_DATA   (1)
#define BMM050_TRIM_DIG_Z3_LSB_DATA   (0)
#define BMM050_TRIM_DIG_Z3_MSB_DATA   (1)
#define BMM050_TRIM_DIG_Z4_LSB_DATA   (0)
#define BMM050_TRIM_DIG_Z4_MSB_DATA   (1)
#define BMM050_WR_FUNC_PTR
Value:
s8 (*bus_write)(u8, u8, \
u8 *, u8)
signed char s8
If your machine support 16 bit define the MACHINE_16_BIT.
Definition: bmm050.h:194
unsigned char u8
Definition: bmm050.h:200
#define BMM050_X   (1)
#define BMM050_X_AXIS   (0)
#define BMM050_XLSB_DATA   (0)
#define BMM050_XMSB_DATA   (1)
#define BMM050_XYZ   (7)
#define BMM050_Y   (2)
#define BMM050_Y_AXIS   (1)
#define BMM050_YLSB_DATA   (2)
#define BMM050_YMSB_DATA   (3)
#define BMM050_Z   (4)
#define BMM050_Z_AXIS   (2)
#define BMM050_ZLSB_DATA   (4)
#define BMM050_ZMSB_DATA   (5)
#define E_BMM050_NULL_PTR   ((s8)-127)

Error code definitions

#define E_BMM050_OUT_OF_RANGE   ((s8)-2)
#define E_BMM050_UNDEFINED_MODE   (0)
#define ERROR   ((s8)-1)
#define MACHINE_32_BIT

The following definition uses for define the data types

Note
While porting the API please consider the following
Please check the version of C standard
Are you using Linux platform

For the Linux platform support Please use the types.h for your data types definitions

By default it is defined as 32 bit machine configuration define your data types based on your machine/compiler/controller configuration

Typedef Documentation

typedef signed short int s16

used for signed 16bit

typedef signed int s32

used for signed 32bit

typedef signed long long int s64

used for signed 64bit

typedef signed char s8

used for signed 8bit

typedef unsigned short int u16

used for unsigned 16bit

typedef unsigned int u32

used for unsigned 32bit

typedef unsigned long long int u64

used for unsigned 64bit

typedef unsigned char u8

used for unsigned 8bit

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

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