![]() |
LibDriver BMM150
|
driver bmm150 header file More...
#include <stdint.h>#include <stdio.h>#include <string.h>Go to the source code of this file.
Data Structures | |
| struct | bmm150_handle_s |
| bmm150 handle structure definition More... | |
| struct | bmm150_info_s |
| bmm150 information structure definition More... | |
Macros | |
| #define | DRIVER_BMM150_LINK_INIT(HANDLE, STRUCTURE) |
| initialize bmm150_handle_t structure | |
| #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_IIC_READ(HANDLE, FUC) |
| link iic_read function | |
| #define | DRIVER_BMM150_LINK_IIC_WRITE(HANDLE, FUC) |
| link iic_write function | |
| #define | DRIVER_BMM150_LINK_SPI_INIT(HANDLE, FUC) |
| link spi_init 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_WRITE(HANDLE, FUC) |
| link spi_write function | |
| #define | DRIVER_BMM150_LINK_DELAY_MS(HANDLE, FUC) |
| link delay_ms function | |
| #define | DRIVER_BMM150_LINK_DEBUG_PRINT(HANDLE, FUC) |
| link debug_print function | |
| #define | DRIVER_BMM150_LINK_RECEIVE_CALLBACK(HANDLE, FUC) |
| link receive_callback function | |
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 | |
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 | |
| uint8_t | bmm150_set_reg (bmm150_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len) |
| set the chip register | |
| uint8_t | bmm150_get_reg (bmm150_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len) |
| get the chip register | |
driver bmm150 header file
Copyright (c) 2015 - present LibDriver All rights reserved
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| Date | Version | Author | Description |
|---|---|---|---|
| 2025/12/23 | 1.0 | Shifeng Li | first upload |
Definition in file driver_bmm150.h.