1336 reg2 = rand() % 100;
1359 reg2 = -(rand() % 100);
1382 reg = rand() % 0xFFU;
1405 reg = rand() % 0xFFU;
1426 bmm150_interface_debug_print(
"bmm150: bmm150_interrupt_threshold_convert_to_register/bmm150_interrupt_threshold_convert_to_data test.\n");
1428 ut = (float)(rand() % 1000) / 10.0f;
driver bmm150 register test header file
uint8_t bmm150_get_channel_x(bmm150_handle_t *handle, bmm150_bool_t *enable)
get channel x status
uint8_t bmm150_get_interrupt_pin_polarity(bmm150_handle_t *handle, bmm150_interrupt_pin_polarity_t *polarity)
get interrupt pin polarity
uint8_t bmm150_soft_reset(bmm150_handle_t *handle)
soft reset
uint8_t bmm150_get_channel_z(bmm150_handle_t *handle, bmm150_bool_t *enable)
get channel z status
uint8_t bmm150_get_mode(bmm150_handle_t *handle, bmm150_mode_t *mode)
get mode
uint8_t bmm150_deinit(bmm150_handle_t *handle)
close the chip
uint8_t bmm150_get_repxy_number(bmm150_handle_t *handle, uint8_t *number)
get repxy number
uint8_t bmm150_init(bmm150_handle_t *handle)
initialize the chip
bmm150_data_rate_t
bmm150 data rate enumeration definition
uint8_t bmm150_get_spi_wire(bmm150_handle_t *handle, bmm150_spi_wire_t *wire)
get spi wire
uint8_t bmm150_get_self_test(bmm150_handle_t *handle, bmm150_bool_t *enable)
get self test 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_interface(bmm150_handle_t *handle, bmm150_interface_t *interface)
get the chip interface
uint8_t bmm150_get_data_ready_pin(bmm150_handle_t *handle, bmm150_bool_t *enable)
get data ready pin status
uint8_t bmm150_set_repz_number(bmm150_handle_t *handle, uint8_t number)
set repz number
uint8_t bmm150_get_low_threshold(bmm150_handle_t *handle, int8_t *threshold)
get low threshold
uint8_t bmm150_set_interrupt_pin(bmm150_handle_t *handle, bmm150_bool_t enable)
enable or disable interrupt pin
uint8_t bmm150_set_addr_pin(bmm150_handle_t *handle, bmm150_address_t addr_pin)
set the iic address pin
uint8_t bmm150_set_advanced_self_test(bmm150_handle_t *handle, bmm150_advanced_self_test_t test)
set advanced self test
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_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_set_interface(bmm150_handle_t *handle, bmm150_interface_t interface)
set the chip interface
bmm150_spi_wire_t
bmm150 spi wire enumeration definition
uint8_t bmm150_set_spi_wire(bmm150_handle_t *handle, bmm150_spi_wire_t wire)
set spi wire
uint8_t bmm150_get_channel_y(bmm150_handle_t *handle, bmm150_bool_t *enable)
get channel y status
uint8_t bmm150_get_self_test_y(bmm150_handle_t *handle, bmm150_bool_t *enable)
get self test y result
bmm150_interface_t
bmm150 interface enumeration definition
uint8_t bmm150_get_data_ready_status(bmm150_handle_t *handle, bmm150_bool_t *enable)
get data ready status
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
uint8_t bmm150_set_high_threshold(bmm150_handle_t *handle, int8_t threshold)
set high threshold
uint8_t bmm150_get_self_test_x(bmm150_handle_t *handle, bmm150_bool_t *enable)
get self test x result
uint8_t bmm150_set_channel_y(bmm150_handle_t *handle, bmm150_bool_t enable)
enable or disable channel y
bmm150_bool_t
bmm150 bool enumeration definition
uint8_t bmm150_info(bmm150_info_t *info)
get chip's information
uint8_t bmm150_set_mode(bmm150_handle_t *handle, bmm150_mode_t mode)
set mode
uint8_t bmm150_get_high_threshold(bmm150_handle_t *handle, int8_t *threshold)
get high threshold
uint8_t bmm150_set_power_on(bmm150_handle_t *handle, bmm150_bool_t enable)
set power on
bmm150_advanced_self_test_t
bmm150 advanced self test enumeration definition
uint8_t bmm150_set_low_threshold(bmm150_handle_t *handle, int8_t threshold)
set low threshold
bmm150_interrupt_pin_polarity_t
bmm150 interrupt pin polarity enumeration definition
uint8_t bmm150_get_data_rate(bmm150_handle_t *handle, bmm150_data_rate_t *rate)
get data rate
uint8_t bmm150_get_interrupt_status(bmm150_handle_t *handle, bmm150_interrupt_status_t status, bmm150_bool_t *enable)
get interrupt status
struct bmm150_handle_s bmm150_handle_t
bmm150 handle structure definition
bmm150_mode_t
bmm150 mode enumeration definition
uint8_t bmm150_get_self_test_z(bmm150_handle_t *handle, bmm150_bool_t *enable)
get self test z result
uint8_t bmm150_set_self_test(bmm150_handle_t *handle, bmm150_bool_t enable)
enable or disable self test
uint8_t bmm150_set_interrupt_latch(bmm150_handle_t *handle, bmm150_bool_t enable)
enable or disable interrupt latch
bmm150_data_ready_pin_polarity_t
bmm150 data ready pin polarity enumeration definition
uint8_t bmm150_set_channel_z(bmm150_handle_t *handle, bmm150_bool_t enable)
enable or disable channel z
uint8_t bmm150_get_interrupt_pin(bmm150_handle_t *handle, bmm150_bool_t *enable)
get interrupt pin status
uint8_t bmm150_get_repz_number(bmm150_handle_t *handle, uint8_t *number)
get repz number
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_repxy_number(bmm150_handle_t *handle, uint8_t number)
set repxy number
uint8_t bmm150_get_power_on(bmm150_handle_t *handle, bmm150_bool_t *enable)
get power on
uint8_t bmm150_get_data_ready_pin_polarity(bmm150_handle_t *handle, bmm150_data_ready_pin_polarity_t *polarity)
get data ready pin polarity
struct bmm150_info_s bmm150_info_t
bmm150 information structure definition
bmm150_address_t
bmm150 address enumeration definition
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_advanced_self_test(bmm150_handle_t *handle, bmm150_advanced_self_test_t *test)
get advanced self test
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_set_data_rate(bmm150_handle_t *handle, bmm150_data_rate_t rate)
set data rate
uint8_t bmm150_get_addr_pin(bmm150_handle_t *handle, bmm150_address_t *addr_pin)
get the iic address pin
uint8_t bmm150_set_channel_x(bmm150_handle_t *handle, bmm150_bool_t enable)
enable or disable channel x
@ BMM150_INTERRUPT_STATUS_HIGH_THRESHOLD_Z
@ BMM150_INTERRUPT_STATUS_LOW_THRESHOLD_Y
@ BMM150_INTERRUPT_STATUS_OVERFLOW
@ BMM150_INTERRUPT_STATUS_HIGH_THRESHOLD_Y
@ BMM150_INTERRUPT_STATUS_DATA_OVERRUN
@ BMM150_INTERRUPT_STATUS_LOW_THRESHOLD_X
@ BMM150_INTERRUPT_STATUS_HIGH_THRESHOLD_X
@ BMM150_INTERRUPT_STATUS_LOW_THRESHOLD_Z
@ BMM150_ADVANCED_SELF_TEST_NORMAL
@ BMM150_ADVANCED_SELF_TEST_NEGATIVE
@ BMM150_ADVANCED_SELF_TEST_POSITIVE
@ BMM150_INTERRUPT_PIN_POLARITY_LOW
@ BMM150_INTERRUPT_PIN_POLARITY_HIGH
@ BMM150_DATA_READY_PIN_POLARITY_HIGH
@ BMM150_DATA_READY_PIN_POLARITY_LOW
@ BMM150_ADDRESS_CSB_SDO_01
@ BMM150_ADDRESS_CSB_SDO_11
@ BMM150_ADDRESS_CSB_SDO_00
@ BMM150_ADDRESS_CSB_SDO_10
uint8_t bmm150_interface_spi_init(void)
interface spi bus init
uint8_t bmm150_interface_spi_read(uint8_t reg, uint8_t *buf, uint16_t len)
interface spi bus read
uint8_t bmm150_interface_spi_write(uint8_t reg, uint8_t *buf, uint16_t len)
interface spi bus write
uint8_t bmm150_interface_iic_read(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus read
void bmm150_interface_receive_callback(uint8_t type)
interface receive callback
uint8_t bmm150_interface_iic_init(void)
interface iic bus init
uint8_t bmm150_interface_spi_deinit(void)
interface spi bus deinit
uint8_t bmm150_interface_iic_write(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus write
uint8_t bmm150_interface_iic_deinit(void)
interface iic bus deinit
void bmm150_interface_debug_print(const char *const fmt,...)
interface print format data
void bmm150_interface_delay_ms(uint32_t ms)
interface delay ms
#define DRIVER_BMM150_LINK_DEBUG_PRINT(HANDLE, FUC)
link debug_print function
#define DRIVER_BMM150_LINK_DELAY_MS(HANDLE, FUC)
link delay_ms function
#define DRIVER_BMM150_LINK_IIC_WRITE(HANDLE, FUC)
link iic_write function
#define DRIVER_BMM150_LINK_IIC_INIT(HANDLE, FUC)
link iic_init function
#define DRIVER_BMM150_LINK_IIC_DEINIT(HANDLE, FUC)
link iic_deinit function
#define DRIVER_BMM150_LINK_RECEIVE_CALLBACK(HANDLE, FUC)
link receive_callback function
#define DRIVER_BMM150_LINK_SPI_WRITE(HANDLE, FUC)
link spi_write function
#define DRIVER_BMM150_LINK_INIT(HANDLE, STRUCTURE)
initialize bmm150_handle_t structure
#define DRIVER_BMM150_LINK_IIC_READ(HANDLE, FUC)
link iic_read function
#define DRIVER_BMM150_LINK_SPI_DEINIT(HANDLE, FUC)
link spi_deinit function
#define DRIVER_BMM150_LINK_SPI_READ(HANDLE, FUC)
link spi_read function
#define DRIVER_BMM150_LINK_SPI_INIT(HANDLE, FUC)
link spi_init function
uint8_t bmm150_register_test(bmm150_interface_t interface, bmm150_address_t addr_pin)
register test
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v