1 /*
2  * Copyright (c) 2016 Intel Corporation
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef ZEPHYR_DRIVERS_SENSOR_AK8975_AK8975_H_
8 #define ZEPHYR_DRIVERS_SENSOR_AK8975_AK8975_H_
9 
10 #include <zephyr/device.h>
11 
12 #define AK8975_REG_CHIP_ID		0x00
13 #define AK8975_CHIP_ID			0x48
14 
15 #define AK8975_REG_DATA_START		0x03
16 
17 #define AK8975_REG_CNTL			0x0A
18 #define AK8975_MODE_MEASURE		0x01
19 #define AK8975_MODE_FUSE_ACCESS		0x0F
20 
21 #define AK8975_REG_ADJ_DATA_START	0x10
22 
23 #define AK8975_MEASURE_TIME_US		9000
24 #define AK8975_MICRO_GAUSS_PER_BIT	3000
25 
26 struct ak8975_data {
27 	int16_t x_sample;
28 	int16_t y_sample;
29 	int16_t z_sample;
30 
31 	uint8_t x_adj;
32 	uint8_t y_adj;
33 	uint8_t z_adj;
34 };
35 
36 struct ak8975_config {
37 	struct i2c_dt_spec i2c;
38 };
39 
40 #endif /* ZEPHYR_DRIVERS_SENSOR_AK8975_AK8975_H_ */
41