1094332d3Sopenharmony_ci/* 2094332d3Sopenharmony_ci * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 3094332d3Sopenharmony_ci * 4094332d3Sopenharmony_ci * HDF is dual licensed: you can use it either under the terms of 5094332d3Sopenharmony_ci * the GPL, or the BSD license, at your option. 6094332d3Sopenharmony_ci * See the LICENSE file in the root of this repository for complete details. 7094332d3Sopenharmony_ci */ 8094332d3Sopenharmony_ci 9094332d3Sopenharmony_ci#ifndef ACCEL_MXC6655XA_H 10094332d3Sopenharmony_ci#define ACCEL_MXC6655XA_H 11094332d3Sopenharmony_ci 12094332d3Sopenharmony_ci#include "sensor_accel_driver.h" 13094332d3Sopenharmony_ci#include "sensor_config_parser.h" 14094332d3Sopenharmony_ci 15094332d3Sopenharmony_ci/* ACCEL DATA REGISTERS ADDR */ 16094332d3Sopenharmony_ci#define MXC6655XA_ACCEL_X_MSB_ADDR 0X03 17094332d3Sopenharmony_ci#define MXC6655XA_ACCEL_X_LSB_ADDR 0X04 18094332d3Sopenharmony_ci#define MXC6655XA_ACCEL_Y_MSB_ADDR 0X05 19094332d3Sopenharmony_ci#define MXC6655XA_ACCEL_Y_LSB_ADDR 0X06 20094332d3Sopenharmony_ci#define MXC6655XA_ACCEL_Z_MSB_ADDR 0X07 21094332d3Sopenharmony_ci#define MXC6655XA_ACCEL_Z_LSB_ADDR 0X08 22094332d3Sopenharmony_ci#define MXC6655XA_STATUS_ADDR 0X02 23094332d3Sopenharmony_ci 24094332d3Sopenharmony_ci/* default HZ */ 25094332d3Sopenharmony_ci#define MXC6655XA_ACCEL_DEFAULT_ODR_100HZ 100 26094332d3Sopenharmony_ci#define MXC6655XA_ACCEL_DEFAULT_ODR_25HZ 25 27094332d3Sopenharmony_ci 28094332d3Sopenharmony_ci/* ACCEL RANGE */ 29094332d3Sopenharmony_ci#define MXC6655XA_ACCEL_RANGE_2G 0X03 30094332d3Sopenharmony_ci#define MXC6655XA_ACCEL_RANGE_4G 0X05 31094332d3Sopenharmony_ci#define MXC6655XA_ACCEL_RANGE_8G 0X08 32094332d3Sopenharmony_ci#define MXC6655XA_ACCEL_RANGE_16G 0X0C 33094332d3Sopenharmony_ci 34094332d3Sopenharmony_ci/* ACC sensitivity */ 35094332d3Sopenharmony_ci#define MXC6655XA_ACC_SENSITIVITY_2G 61 36094332d3Sopenharmony_ci#define MXC6655XA_ACC_SENSITIVITY_4G 122 37094332d3Sopenharmony_ci#define MXC6655XA_ACC_SENSITIVITY_8G 244 38094332d3Sopenharmony_ci#define MXC6655XA_ACC_SENSITIVITY_16G 488 39094332d3Sopenharmony_ci 40094332d3Sopenharmony_ci/* ACCEL DATA READY */ 41094332d3Sopenharmony_ci#define MXC6655XA_ACCEL_DATA_READY_MASK 0x80 42094332d3Sopenharmony_ci 43094332d3Sopenharmony_cistruct Mxc6655xaDrvData { 44094332d3Sopenharmony_ci struct IDeviceIoService ioService; 45094332d3Sopenharmony_ci struct HdfDeviceObject *device; 46094332d3Sopenharmony_ci struct SensorCfgData *sensorCfg; 47094332d3Sopenharmony_ci}; 48094332d3Sopenharmony_ci 49094332d3Sopenharmony_ci#endif /* ACCEL_MXC6655XA_H */ 50