LibDriver BMM150
Loading...
Searching...
No Matches
bmm150 basic driver function

bmm150 basic driver modules More...

Collaboration diagram for bmm150 basic driver function:

Data Structures

struct  bmm150_handle_s
 bmm150 handle structure definition More...
struct  bmm150_info_s
 bmm150 information structure definition More...

Typedefs

typedef struct bmm150_handle_s bmm150_handle_t
 bmm150 handle structure definition
typedef struct bmm150_info_s bmm150_info_t
 bmm150 information structure definition

Enumerations

enum  bmm150_interface_t { BMM150_INTERFACE_IIC = 0x00 , BMM150_INTERFACE_SPI = 0x01 }
 bmm150 interface enumeration definition More...
enum  bmm150_address_t { BMM150_ADDRESS_CSB_SDO_00 = (0x10 << 1) , BMM150_ADDRESS_CSB_SDO_01 = (0x11 << 1) , BMM150_ADDRESS_CSB_SDO_10 = (0x12 << 1) , BMM150_ADDRESS_CSB_SDO_11 = (0x13 << 1) }
 bmm150 address enumeration definition More...
enum  bmm150_bool_t { BMM150_BOOL_FALSE = 0x00 , BMM150_BOOL_TRUE = 0x01 }
 bmm150 bool enumeration definition More...
enum  bmm150_interrupt_status_t {
  BMM150_INTERRUPT_STATUS_DATA_OVERRUN = 7 , BMM150_INTERRUPT_STATUS_OVERFLOW = 6 , BMM150_INTERRUPT_STATUS_HIGH_THRESHOLD_Z = 5 , BMM150_INTERRUPT_STATUS_HIGH_THRESHOLD_Y = 4 ,
  BMM150_INTERRUPT_STATUS_HIGH_THRESHOLD_X = 3 , BMM150_INTERRUPT_STATUS_LOW_THRESHOLD_Z = 2 , BMM150_INTERRUPT_STATUS_LOW_THRESHOLD_Y = 1 , BMM150_INTERRUPT_STATUS_LOW_THRESHOLD_X = 0
}
 bmm150 interrupt status enumeration definition More...
enum  bmm150_spi_wire_t { BMM150_SPI_WIRE_4 = 0x00 , BMM150_SPI_WIRE_3 = 0x01 }
 bmm150 spi wire enumeration definition More...
enum  bmm150_advanced_self_test_t { BMM150_ADVANCED_SELF_TEST_NORMAL = 0x00 , BMM150_ADVANCED_SELF_TEST_NEGATIVE = 0x02 , BMM150_ADVANCED_SELF_TEST_POSITIVE = 0x03 }
 bmm150 advanced self test enumeration definition More...
enum  bmm150_data_rate_t {
  BMM150_DATA_RATE_10HZ = 0x00 , BMM150_DATA_RATE_2HZ = 0x01 , BMM150_DATA_RATE_6HZ = 0x02 , BMM150_DATA_RATE_8HZ = 0x03 ,
  BMM150_DATA_RATE_15HZ = 0x04 , BMM150_DATA_RATE_20HZ = 0x05 , BMM150_DATA_RATE_25HZ = 0x06 , BMM150_DATA_RATE_30HZ = 0x07
}
 bmm150 data rate enumeration definition More...
enum  bmm150_mode_t { BMM150_MODE_NORMAL = 0x00 , BMM150_MODE_FORCED = 0x01 , BMM150_MODE_SLEEP = 0x03 }
 bmm150 mode enumeration definition More...
enum  bmm150_data_ready_pin_polarity_t { BMM150_DATA_READY_PIN_POLARITY_LOW = 0x00 , BMM150_DATA_READY_PIN_POLARITY_HIGH = 0x01 }
 bmm150 data ready pin polarity enumeration definition More...
enum  bmm150_interrupt_pin_polarity_t { BMM150_INTERRUPT_PIN_POLARITY_LOW = 0x00 , BMM150_INTERRUPT_PIN_POLARITY_HIGH = 0x01 }
 bmm150 interrupt pin polarity enumeration definition More...

Functions

uint8_t bmm150_info (bmm150_info_t *info)
 get chip's information
uint8_t bmm150_set_interface (bmm150_handle_t *handle, bmm150_interface_t interface)
 set the chip interface
uint8_t bmm150_get_interface (bmm150_handle_t *handle, bmm150_interface_t *interface)
 get the chip interface
uint8_t bmm150_set_addr_pin (bmm150_handle_t *handle, bmm150_address_t addr_pin)
 set the iic address pin
uint8_t bmm150_get_addr_pin (bmm150_handle_t *handle, bmm150_address_t *addr_pin)
 get the iic address pin
uint8_t bmm150_irq_handler (bmm150_handle_t *handle)
 irq handler
uint8_t bmm150_init (bmm150_handle_t *handle)
 initialize the chip
uint8_t bmm150_deinit (bmm150_handle_t *handle)
 close the chip
uint8_t bmm150_read (bmm150_handle_t *handle, int16_t raw[3], float ut[3])
 read data
uint8_t bmm150_get_self_test_x (bmm150_handle_t *handle, bmm150_bool_t *enable)
 get self test x result
uint8_t bmm150_get_self_test_y (bmm150_handle_t *handle, bmm150_bool_t *enable)
 get self test y result
uint8_t bmm150_get_self_test_z (bmm150_handle_t *handle, bmm150_bool_t *enable)
 get self test z result
uint8_t bmm150_get_data_ready_status (bmm150_handle_t *handle, bmm150_bool_t *enable)
 get data ready status
uint8_t bmm150_get_interrupt_status (bmm150_handle_t *handle, bmm150_interrupt_status_t status, bmm150_bool_t *enable)
 get interrupt status
uint8_t bmm150_soft_reset (bmm150_handle_t *handle)
 soft reset
uint8_t bmm150_set_power_on (bmm150_handle_t *handle, bmm150_bool_t enable)
 set power on
uint8_t bmm150_get_power_on (bmm150_handle_t *handle, bmm150_bool_t *enable)
 get power on
uint8_t bmm150_set_spi_wire (bmm150_handle_t *handle, bmm150_spi_wire_t wire)
 set spi wire
uint8_t bmm150_get_spi_wire (bmm150_handle_t *handle, bmm150_spi_wire_t *wire)
 get spi wire
uint8_t bmm150_set_advanced_self_test (bmm150_handle_t *handle, bmm150_advanced_self_test_t test)
 set advanced self test
uint8_t bmm150_get_advanced_self_test (bmm150_handle_t *handle, bmm150_advanced_self_test_t *test)
 get advanced self test
uint8_t bmm150_set_data_rate (bmm150_handle_t *handle, bmm150_data_rate_t rate)
 set data rate
uint8_t bmm150_get_data_rate (bmm150_handle_t *handle, bmm150_data_rate_t *rate)
 get data rate
uint8_t bmm150_set_mode (bmm150_handle_t *handle, bmm150_mode_t mode)
 set mode
uint8_t bmm150_get_mode (bmm150_handle_t *handle, bmm150_mode_t *mode)
 get mode
uint8_t bmm150_set_self_test (bmm150_handle_t *handle, bmm150_bool_t enable)
 enable or disable self test
uint8_t bmm150_get_self_test (bmm150_handle_t *handle, bmm150_bool_t *enable)
 get self test status
uint8_t bmm150_set_interrupt (bmm150_handle_t *handle, bmm150_interrupt_status_t status, bmm150_bool_t enable)
 enable or disable interrupt
uint8_t bmm150_get_interrupt (bmm150_handle_t *handle, bmm150_interrupt_status_t status, bmm150_bool_t *enable)
 get interrupt status
uint8_t bmm150_set_data_ready_pin (bmm150_handle_t *handle, bmm150_bool_t enable)
 enable or disable data ready pin
uint8_t bmm150_get_data_ready_pin (bmm150_handle_t *handle, bmm150_bool_t *enable)
 get data ready pin status
uint8_t bmm150_set_interrupt_pin (bmm150_handle_t *handle, bmm150_bool_t enable)
 enable or disable interrupt pin
uint8_t bmm150_get_interrupt_pin (bmm150_handle_t *handle, bmm150_bool_t *enable)
 get interrupt pin status
uint8_t bmm150_set_channel_z (bmm150_handle_t *handle, bmm150_bool_t enable)
 enable or disable channel z
uint8_t bmm150_get_channel_z (bmm150_handle_t *handle, bmm150_bool_t *enable)
 get channel z status
uint8_t bmm150_set_channel_y (bmm150_handle_t *handle, bmm150_bool_t enable)
 enable or disable channel y
uint8_t bmm150_get_channel_y (bmm150_handle_t *handle, bmm150_bool_t *enable)
 get channel y status
uint8_t bmm150_set_channel_x (bmm150_handle_t *handle, bmm150_bool_t enable)
 enable or disable channel x
uint8_t bmm150_get_channel_x (bmm150_handle_t *handle, bmm150_bool_t *enable)
 get channel x status
uint8_t bmm150_set_data_ready_pin_polarity (bmm150_handle_t *handle, bmm150_data_ready_pin_polarity_t polarity)
 set data ready pin polarity
uint8_t bmm150_get_data_ready_pin_polarity (bmm150_handle_t *handle, bmm150_data_ready_pin_polarity_t *polarity)
 get data ready pin polarity
uint8_t bmm150_set_interrupt_latch (bmm150_handle_t *handle, bmm150_bool_t enable)
 enable or disable interrupt latch
uint8_t bmm150_get_interrupt_latch (bmm150_handle_t *handle, bmm150_bool_t *enable)
 get interrupt latch status
uint8_t bmm150_set_interrupt_pin_polarity (bmm150_handle_t *handle, bmm150_interrupt_pin_polarity_t polarity)
 set interrupt pin polarity
uint8_t bmm150_get_interrupt_pin_polarity (bmm150_handle_t *handle, bmm150_interrupt_pin_polarity_t *polarity)
 get interrupt pin polarity
uint8_t bmm150_set_low_threshold (bmm150_handle_t *handle, int8_t threshold)
 set low threshold
uint8_t bmm150_get_low_threshold (bmm150_handle_t *handle, int8_t *threshold)
 get low threshold
uint8_t bmm150_set_high_threshold (bmm150_handle_t *handle, int8_t threshold)
 set high threshold
uint8_t bmm150_get_high_threshold (bmm150_handle_t *handle, int8_t *threshold)
 get high threshold
uint8_t bmm150_set_repxy_number (bmm150_handle_t *handle, uint8_t number)
 set repxy number
uint8_t bmm150_get_repxy_number (bmm150_handle_t *handle, uint8_t *number)
 get repxy number
uint8_t bmm150_set_repz_number (bmm150_handle_t *handle, uint8_t number)
 set repz number
uint8_t bmm150_get_repz_number (bmm150_handle_t *handle, uint8_t *number)
 get repz number
uint8_t bmm150_interrupt_threshold_convert_to_register (bmm150_handle_t *handle, float ut, int8_t *reg)
 convert the interrupt threshold to the register raw data
uint8_t bmm150_interrupt_threshold_convert_to_data (bmm150_handle_t *handle, int8_t reg, float *ut)
 convert the register raw data to the interrupt threshold

Detailed Description

bmm150 basic driver modules

Typedef Documentation

◆ bmm150_handle_t

bmm150 handle structure definition

◆ bmm150_info_t

typedef struct bmm150_info_s bmm150_info_t

bmm150 information structure definition

Enumeration Type Documentation

◆ bmm150_address_t

bmm150 address enumeration definition

Enumerator
BMM150_ADDRESS_CSB_SDO_00 

csb = gnd, sdo = gnd

BMM150_ADDRESS_CSB_SDO_01 

csb = gnd, sdo = vcc

BMM150_ADDRESS_CSB_SDO_10 

csb = vcc, sdo = gnd

BMM150_ADDRESS_CSB_SDO_11 

csb = vcc, sdo = vcc

Definition at line 71 of file driver_bmm150.h.

◆ bmm150_advanced_self_test_t

bmm150 advanced self test enumeration definition

Enumerator
BMM150_ADVANCED_SELF_TEST_NORMAL 

normal mode

BMM150_ADVANCED_SELF_TEST_NEGATIVE 

negative mode

BMM150_ADVANCED_SELF_TEST_POSITIVE 

positive mode

Definition at line 115 of file driver_bmm150.h.

◆ bmm150_bool_t

bmm150 bool enumeration definition

Enumerator
BMM150_BOOL_FALSE 

false

BMM150_BOOL_TRUE 

true

Definition at line 82 of file driver_bmm150.h.

◆ bmm150_data_rate_t

bmm150 data rate enumeration definition

Enumerator
BMM150_DATA_RATE_10HZ 

10hz

BMM150_DATA_RATE_2HZ 

2hz

BMM150_DATA_RATE_6HZ 

6hz

BMM150_DATA_RATE_8HZ 

8hz

BMM150_DATA_RATE_15HZ 

15hz

BMM150_DATA_RATE_20HZ 

20hz

BMM150_DATA_RATE_25HZ 

25hz

BMM150_DATA_RATE_30HZ 

30hz

Definition at line 125 of file driver_bmm150.h.

◆ bmm150_data_ready_pin_polarity_t

bmm150 data ready pin polarity enumeration definition

Enumerator
BMM150_DATA_READY_PIN_POLARITY_LOW 

active low

BMM150_DATA_READY_PIN_POLARITY_HIGH 

active high

Definition at line 150 of file driver_bmm150.h.

◆ bmm150_interface_t

bmm150 interface enumeration definition

Enumerator
BMM150_INTERFACE_IIC 

iic interface function

BMM150_INTERFACE_SPI 

spi interface function

Definition at line 62 of file driver_bmm150.h.

◆ bmm150_interrupt_pin_polarity_t

bmm150 interrupt pin polarity enumeration definition

Enumerator
BMM150_INTERRUPT_PIN_POLARITY_LOW 

active low

BMM150_INTERRUPT_PIN_POLARITY_HIGH 

active high

Definition at line 159 of file driver_bmm150.h.

◆ bmm150_interrupt_status_t

bmm150 interrupt status enumeration definition

Enumerator
BMM150_INTERRUPT_STATUS_DATA_OVERRUN 

data overrun

BMM150_INTERRUPT_STATUS_OVERFLOW 

overflow

BMM150_INTERRUPT_STATUS_HIGH_THRESHOLD_Z 

high threshold z

BMM150_INTERRUPT_STATUS_HIGH_THRESHOLD_Y 

high threshold y

BMM150_INTERRUPT_STATUS_HIGH_THRESHOLD_X 

high threshold x

BMM150_INTERRUPT_STATUS_LOW_THRESHOLD_Z 

low threshold z

BMM150_INTERRUPT_STATUS_LOW_THRESHOLD_Y 

low threshold y

BMM150_INTERRUPT_STATUS_LOW_THRESHOLD_X 

low threshold x

Definition at line 91 of file driver_bmm150.h.

◆ bmm150_mode_t

bmm150 mode enumeration definition

Enumerator
BMM150_MODE_NORMAL 

normal mode

BMM150_MODE_FORCED 

forced mode

BMM150_MODE_SLEEP 

sleep mode

Definition at line 140 of file driver_bmm150.h.

◆ bmm150_spi_wire_t

bmm150 spi wire enumeration definition

Enumerator
BMM150_SPI_WIRE_4 

4 wire

BMM150_SPI_WIRE_3 

3 wire

Definition at line 106 of file driver_bmm150.h.

Function Documentation

◆ bmm150_deinit()

uint8_t bmm150_deinit ( bmm150_handle_t * handle)

close the chip

Parameters
[in]*handlepointer to a bmm150 handle structure
Returns
status code
  • 0 success
  • 1 deinit failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2716 of file driver_bmm150.c.

◆ bmm150_get_addr_pin()

uint8_t bmm150_get_addr_pin ( bmm150_handle_t * handle,
bmm150_address_t * addr_pin )

get the iic address pin

Parameters
[in]*handlepointer to a bmm150 handle structure
[out]*addr_pinpointer to an address pin buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 425 of file driver_bmm150.c.

◆ bmm150_get_advanced_self_test()

uint8_t bmm150_get_advanced_self_test ( bmm150_handle_t * handle,
bmm150_advanced_self_test_t * test )

get advanced self test

Parameters
[in]*handlepointer to a bmm150 handle structure
[out]*testpointer to an advanced self test mode buffer
Returns
status code
  • 0 success
  • 1 get advanced self test failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 889 of file driver_bmm150.c.

◆ bmm150_get_channel_x()

uint8_t bmm150_get_channel_x ( bmm150_handle_t * handle,
bmm150_bool_t * enable )

get channel x status

Parameters
[in]*handlepointer to a bmm150 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get channel x failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1643 of file driver_bmm150.c.

◆ bmm150_get_channel_y()

uint8_t bmm150_get_channel_y ( bmm150_handle_t * handle,
bmm150_bool_t * enable )

get channel y status

Parameters
[in]*handlepointer to a bmm150 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get channel y failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1561 of file driver_bmm150.c.

◆ bmm150_get_channel_z()

uint8_t bmm150_get_channel_z ( bmm150_handle_t * handle,
bmm150_bool_t * enable )

get channel z status

Parameters
[in]*handlepointer to a bmm150 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get channel z failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1479 of file driver_bmm150.c.

◆ bmm150_get_data_rate()

uint8_t bmm150_get_data_rate ( bmm150_handle_t * handle,
bmm150_data_rate_t * rate )

get data rate

Parameters
[in]*handlepointer to a bmm150 handle structure
[out]*ratepointer to a data rate buffer
Returns
status code
  • 0 success
  • 1 get data rate failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 971 of file driver_bmm150.c.

◆ bmm150_get_data_ready_pin()

uint8_t bmm150_get_data_ready_pin ( bmm150_handle_t * handle,
bmm150_bool_t * enable )

get data ready pin status

Parameters
[in]*handlepointer to a bmm150 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get data ready pin failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1315 of file driver_bmm150.c.

◆ bmm150_get_data_ready_pin_polarity()

uint8_t bmm150_get_data_ready_pin_polarity ( bmm150_handle_t * handle,
bmm150_data_ready_pin_polarity_t * polarity )

get data ready pin polarity

Parameters
[in]*handlepointer to a bmm150 handle structure
[out]*polaritypointer to a data ready pin polarity buffer
Returns
status code
  • 0 success
  • 1 get data ready pin polarity failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1725 of file driver_bmm150.c.

◆ bmm150_get_data_ready_status()

uint8_t bmm150_get_data_ready_status ( bmm150_handle_t * handle,
bmm150_bool_t * enable )

get data ready status

Parameters
[in]*handlepointer to a bmm150 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get data ready status failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 559 of file driver_bmm150.c.

◆ bmm150_get_high_threshold()

uint8_t bmm150_get_high_threshold ( bmm150_handle_t * handle,
int8_t * threshold )

get high threshold

Parameters
[in]*handlepointer to a bmm150 handle structure
[out]*thresholdpointer to a high threshold buffer
Returns
status code
  • 0 success
  • 1 get high threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2037 of file driver_bmm150.c.

◆ bmm150_get_interface()

uint8_t bmm150_get_interface ( bmm150_handle_t * handle,
bmm150_interface_t * interface )

get the chip interface

Parameters
[in]*handlepointer to a bmm150 handle structure
[out]*interfacepointer to a chip interface buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 383 of file driver_bmm150.c.

◆ bmm150_get_interrupt()

uint8_t bmm150_get_interrupt ( bmm150_handle_t * handle,
bmm150_interrupt_status_t status,
bmm150_bool_t * enable )

get interrupt status

Parameters
[in]*handlepointer to a bmm150 handle structure
[in]statusinterrupt index
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1226 of file driver_bmm150.c.

◆ bmm150_get_interrupt_latch()

uint8_t bmm150_get_interrupt_latch ( bmm150_handle_t * handle,
bmm150_bool_t * enable )

get interrupt latch status

Parameters
[in]*handlepointer to a bmm150 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get interrupt latch failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1807 of file driver_bmm150.c.

◆ bmm150_get_interrupt_pin()

uint8_t bmm150_get_interrupt_pin ( bmm150_handle_t * handle,
bmm150_bool_t * enable )

get interrupt pin status

Parameters
[in]*handlepointer to a bmm150 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get interrupt pin failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1397 of file driver_bmm150.c.

◆ bmm150_get_interrupt_pin_polarity()

uint8_t bmm150_get_interrupt_pin_polarity ( bmm150_handle_t * handle,
bmm150_interrupt_pin_polarity_t * polarity )

get interrupt pin polarity

Parameters
[in]*handlepointer to a bmm150 handle structure
[out]*polaritypointer to an interrupt pin polarity buffer
Returns
status code
  • 0 success
  • 1 get interrupt pin polarity failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1889 of file driver_bmm150.c.

◆ bmm150_get_interrupt_status()

uint8_t bmm150_get_interrupt_status ( bmm150_handle_t * handle,
bmm150_interrupt_status_t status,
bmm150_bool_t * enable )

get interrupt status

Parameters
[in]*handlepointer to a bmm150 handle structure
[in]statusinterrupt status
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get interrupt status failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 597 of file driver_bmm150.c.

◆ bmm150_get_low_threshold()

uint8_t bmm150_get_low_threshold ( bmm150_handle_t * handle,
int8_t * threshold )

get low threshold

Parameters
[in]*handlepointer to a bmm150 handle structure
[out]*thresholdpointer to a low threshold buffer
Returns
status code
  • 0 success
  • 1 get low threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1963 of file driver_bmm150.c.

◆ bmm150_get_mode()

uint8_t bmm150_get_mode ( bmm150_handle_t * handle,
bmm150_mode_t * mode )

get mode

Parameters
[in]*handlepointer to a bmm150 handle structure
[out]*modepointer to a chip mode buffer
Returns
status code
  • 0 success
  • 1 get mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1053 of file driver_bmm150.c.

◆ bmm150_get_power_on()

uint8_t bmm150_get_power_on ( bmm150_handle_t * handle,
bmm150_bool_t * enable )

get power on

Parameters
[in]*handlepointer to a bmm150 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get power on failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 725 of file driver_bmm150.c.

◆ bmm150_get_repxy_number()

uint8_t bmm150_get_repxy_number ( bmm150_handle_t * handle,
uint8_t * number )

get repxy number

Parameters
[in]*handlepointer to a bmm150 handle structure
[out]*numberpointer to a repxy number buffer
Returns
status code
  • 0 success
  • 1 get repxy number failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2115 of file driver_bmm150.c.

◆ bmm150_get_repz_number()

uint8_t bmm150_get_repz_number ( bmm150_handle_t * handle,
uint8_t * number )

get repz number

Parameters
[in]*handlepointer to a bmm150 handle structure
[out]*numberpointer to a repz number buffer
Returns
status code
  • 0 success
  • 1 get repz number failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2191 of file driver_bmm150.c.

◆ bmm150_get_self_test()

uint8_t bmm150_get_self_test ( bmm150_handle_t * handle,
bmm150_bool_t * enable )

get self test status

Parameters
[in]*handlepointer to a bmm150 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get self test failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1135 of file driver_bmm150.c.

◆ bmm150_get_self_test_x()

uint8_t bmm150_get_self_test_x ( bmm150_handle_t * handle,
bmm150_bool_t * enable )

get self test x result

Parameters
[in]*handlepointer to a bmm150 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get self test x failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 448 of file driver_bmm150.c.

◆ bmm150_get_self_test_y()

uint8_t bmm150_get_self_test_y ( bmm150_handle_t * handle,
bmm150_bool_t * enable )

get self test y result

Parameters
[in]*handlepointer to a bmm150 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get self test y failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 485 of file driver_bmm150.c.

◆ bmm150_get_self_test_z()

uint8_t bmm150_get_self_test_z ( bmm150_handle_t * handle,
bmm150_bool_t * enable )

get self test z result

Parameters
[in]*handlepointer to a bmm150 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get self test z failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 522 of file driver_bmm150.c.

◆ bmm150_get_spi_wire()

uint8_t bmm150_get_spi_wire ( bmm150_handle_t * handle,
bmm150_spi_wire_t * wire )

get spi wire

Parameters
[in]*handlepointer to a bmm150 handle structure
[out]*wirepointer to a spi wire buffer
Returns
status code
  • 0 success
  • 1 get spi wire failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 807 of file driver_bmm150.c.

◆ bmm150_info()

uint8_t bmm150_info ( bmm150_info_t * info)

get chip's information

Parameters
[out]*infopointer to a bmm150 info structure
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 2820 of file driver_bmm150.c.

◆ bmm150_init()

uint8_t bmm150_init ( bmm150_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to a bmm150 handle structure
Returns
status code
  • 0 success
  • 1 spi or iic initialization failed
  • 2 handle is NULL
  • 3 linked functions is NULL
  • 4 soft reset failed
  • 5 power on failed
  • 6 id is invalid
  • 7 load trim failed
Note
none

Definition at line 2553 of file driver_bmm150.c.

◆ bmm150_interrupt_threshold_convert_to_data()

uint8_t bmm150_interrupt_threshold_convert_to_data ( bmm150_handle_t * handle,
int8_t reg,
float * ut )

convert the register raw data to the interrupt threshold

Parameters
[in]*handlepointer to a bmm150 handle structure
[in]regregister raw data
[out]*utpointer to an interrupt threshold buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2523 of file driver_bmm150.c.

◆ bmm150_interrupt_threshold_convert_to_register()

uint8_t bmm150_interrupt_threshold_convert_to_register ( bmm150_handle_t * handle,
float ut,
int8_t * reg )

convert the interrupt threshold to the register raw data

Parameters
[in]*handlepointer to a bmm150 handle structure
[in]utinterrupt threshold in ut
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2496 of file driver_bmm150.c.

◆ bmm150_irq_handler()

uint8_t bmm150_irq_handler ( bmm150_handle_t * handle)

irq handler

Parameters
[in]*handlepointer to a bmm150 handle structure
Returns
status code
  • 0 success
  • 1 run failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2400 of file driver_bmm150.c.

◆ bmm150_read()

uint8_t bmm150_read ( bmm150_handle_t * handle,
int16_t raw[3],
float ut[3] )

read data

Parameters
[in]*handlepointer to a bmm150 handle structure
[out]*rawpointer to a raw data buffer
[out]*utpointer to a converted data buffer
Returns
status code
  • 0 success
  • 1 read failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 read timeout
Note
none

Definition at line 2228 of file driver_bmm150.c.

◆ bmm150_set_addr_pin()

uint8_t bmm150_set_addr_pin ( bmm150_handle_t * handle,
bmm150_address_t addr_pin )

set the iic address pin

Parameters
[in]*handlepointer to a bmm150 handle structure
[in]addr_pinaddress pin
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 404 of file driver_bmm150.c.

◆ bmm150_set_advanced_self_test()

uint8_t bmm150_set_advanced_self_test ( bmm150_handle_t * handle,
bmm150_advanced_self_test_t test )

set advanced self test

Parameters
[in]*handlepointer to a bmm150 handle structure
[in]testadvanced self test mode
Returns
status code
  • 0 success
  • 1 set advanced self test failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 844 of file driver_bmm150.c.

◆ bmm150_set_channel_x()

uint8_t bmm150_set_channel_x ( bmm150_handle_t * handle,
bmm150_bool_t enable )

enable or disable channel x

Parameters
[in]*handlepointer to a bmm150 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set channel x failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1598 of file driver_bmm150.c.

◆ bmm150_set_channel_y()

uint8_t bmm150_set_channel_y ( bmm150_handle_t * handle,
bmm150_bool_t enable )

enable or disable channel y

Parameters
[in]*handlepointer to a bmm150 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set channel y failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1516 of file driver_bmm150.c.

◆ bmm150_set_channel_z()

uint8_t bmm150_set_channel_z ( bmm150_handle_t * handle,
bmm150_bool_t enable )

enable or disable channel z

Parameters
[in]*handlepointer to a bmm150 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set channel z failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1434 of file driver_bmm150.c.

◆ bmm150_set_data_rate()

uint8_t bmm150_set_data_rate ( bmm150_handle_t * handle,
bmm150_data_rate_t rate )

set data rate

Parameters
[in]*handlepointer to a bmm150 handle structure
[in]ratedata rate
Returns
status code
  • 0 success
  • 1 set data rate failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 926 of file driver_bmm150.c.

◆ bmm150_set_data_ready_pin()

uint8_t bmm150_set_data_ready_pin ( bmm150_handle_t * handle,
bmm150_bool_t enable )

enable or disable data ready pin

Parameters
[in]*handlepointer to a bmm150 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set data ready pin failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1270 of file driver_bmm150.c.

◆ bmm150_set_data_ready_pin_polarity()

uint8_t bmm150_set_data_ready_pin_polarity ( bmm150_handle_t * handle,
bmm150_data_ready_pin_polarity_t polarity )

set data ready pin polarity

Parameters
[in]*handlepointer to a bmm150 handle structure
[in]polaritydata ready pin polarity
Returns
status code
  • 0 success
  • 1 set data ready pin polarity failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1680 of file driver_bmm150.c.

◆ bmm150_set_high_threshold()

uint8_t bmm150_set_high_threshold ( bmm150_handle_t * handle,
int8_t threshold )

set high threshold

Parameters
[in]*handlepointer to a bmm150 handle structure
[in]thresholdhigh threshold
Returns
status code
  • 0 success
  • 1 set high threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2000 of file driver_bmm150.c.

◆ bmm150_set_interface()

uint8_t bmm150_set_interface ( bmm150_handle_t * handle,
bmm150_interface_t interface )

set the chip interface

Parameters
[in]*handlepointer to a bmm150 handle structure
[in]interfacechip interface
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 362 of file driver_bmm150.c.

◆ bmm150_set_interrupt()

uint8_t bmm150_set_interrupt ( bmm150_handle_t * handle,
bmm150_interrupt_status_t status,
bmm150_bool_t enable )

enable or disable interrupt

Parameters
[in]*handlepointer to a bmm150 handle structure
[in]statusinterrupt index
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1173 of file driver_bmm150.c.

◆ bmm150_set_interrupt_latch()

uint8_t bmm150_set_interrupt_latch ( bmm150_handle_t * handle,
bmm150_bool_t enable )

enable or disable interrupt latch

Parameters
[in]*handlepointer to a bmm150 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set interrupt latch failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1762 of file driver_bmm150.c.

◆ bmm150_set_interrupt_pin()

uint8_t bmm150_set_interrupt_pin ( bmm150_handle_t * handle,
bmm150_bool_t enable )

enable or disable interrupt pin

Parameters
[in]*handlepointer to a bmm150 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set interrupt pin failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1352 of file driver_bmm150.c.

◆ bmm150_set_interrupt_pin_polarity()

uint8_t bmm150_set_interrupt_pin_polarity ( bmm150_handle_t * handle,
bmm150_interrupt_pin_polarity_t polarity )

set interrupt pin polarity

Parameters
[in]*handlepointer to a bmm150 handle structure
[in]polarityinterrupt pin polarity
Returns
status code
  • 0 success
  • 1 set interrupt pin polarity failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1844 of file driver_bmm150.c.

◆ bmm150_set_low_threshold()

uint8_t bmm150_set_low_threshold ( bmm150_handle_t * handle,
int8_t threshold )

set low threshold

Parameters
[in]*handlepointer to a bmm150 handle structure
[in]thresholdlow threshold
Returns
status code
  • 0 success
  • 1 set low threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1926 of file driver_bmm150.c.

◆ bmm150_set_mode()

uint8_t bmm150_set_mode ( bmm150_handle_t * handle,
bmm150_mode_t mode )

set mode

Parameters
[in]*handlepointer to a bmm150 handle structure
[in]modechip mode
Returns
status code
  • 0 success
  • 1 set mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1008 of file driver_bmm150.c.

◆ bmm150_set_power_on()

uint8_t bmm150_set_power_on ( bmm150_handle_t * handle,
bmm150_bool_t enable )

set power on

Parameters
[in]*handlepointer to a bmm150 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set power on failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 679 of file driver_bmm150.c.

◆ bmm150_set_repxy_number()

uint8_t bmm150_set_repxy_number ( bmm150_handle_t * handle,
uint8_t number )

set repxy number

Parameters
[in]*handlepointer to a bmm150 handle structure
[in]numberrepxy number
Returns
status code
  • 0 success
  • 1 set repxy number failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
preset repxy repz odr(hz) low power preset 3 3 10 regular preset 9 15 10 enhanced regular preset 15 27 10 high accuracy preset 47 83 10

Definition at line 2078 of file driver_bmm150.c.

◆ bmm150_set_repz_number()

uint8_t bmm150_set_repz_number ( bmm150_handle_t * handle,
uint8_t number )

set repz number

Parameters
[in]*handlepointer to a bmm150 handle structure
[in]numberrepz number
Returns
status code
  • 0 success
  • 1 set repz number failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
preset repxy repz odr(hz) low power preset 3 3 10 regular preset 9 15 10 enhanced regular preset 15 27 10 high accuracy preset 47 83 10

Definition at line 2154 of file driver_bmm150.c.

◆ bmm150_set_self_test()

uint8_t bmm150_set_self_test ( bmm150_handle_t * handle,
bmm150_bool_t enable )

enable or disable self test

Parameters
[in]*handlepointer to a bmm150 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set self test failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1090 of file driver_bmm150.c.

◆ bmm150_set_spi_wire()

uint8_t bmm150_set_spi_wire ( bmm150_handle_t * handle,
bmm150_spi_wire_t wire )

set spi wire

Parameters
[in]*handlepointer to a bmm150 handle structure
[in]wirespi wire
Returns
status code
  • 0 success
  • 1 set spi wire failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 762 of file driver_bmm150.c.

◆ bmm150_soft_reset()

uint8_t bmm150_soft_reset ( bmm150_handle_t * handle)

soft reset

Parameters
[in]*handlepointer to a bmm150 handle structure
Returns
status code
  • 0 success
  • 1 soft reset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 633 of file driver_bmm150.c.