mirror of
https://gitee.com/openharmony/drivers_adapter_khdf_linux
synced 2024-12-03 18:40:54 +00:00
modify sensor config
Signed-off-by: kevin <liufeihu@huawei.com> Change-Id: I447a4d0742871cb71f88483380b8a0b8d284783a
This commit is contained in:
parent
f03b64b58a
commit
28a408d21b
@ -1,32 +0,0 @@
|
||||
// accel sensor common config template
|
||||
root {
|
||||
sensorAccelConfig {
|
||||
accelChipConfig {
|
||||
template sensorInfo {
|
||||
sensorName = "accelerometer"; // max string length is 16 bytes
|
||||
vendorName = "borsh_bmi160"; // max string length is 16 bytes
|
||||
firmwareVersion = "1.0";
|
||||
hardwareVersion = "1.0";
|
||||
sensorTypeId = 1; // enum SensorTypeTag
|
||||
sensorId = 1; // user define sensor id, defaultenum SensorTypeTag
|
||||
maxRange = 8; // g
|
||||
accuracy = 0;
|
||||
power = 230;
|
||||
}
|
||||
|
||||
template sensorBusConfig {
|
||||
busType = 0; // 0:i2c 1:spi
|
||||
busNum = 6;
|
||||
busAddr = 0;
|
||||
regWidth = 1;
|
||||
regBigEndian = 0;
|
||||
}
|
||||
|
||||
template sensorAttr {
|
||||
chipName = "";
|
||||
chipIdRegister = 0xf;
|
||||
chipIdValue = 0xd1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,50 +1,50 @@
|
||||
#include "accel_config.hcs"
|
||||
#include "../sensor_common.hcs"
|
||||
root {
|
||||
sensorAccelConfig {
|
||||
accel_bmi160_chip_config : accelChipConfig {
|
||||
match_attr = "hdf_sensor_accel_driver";
|
||||
accelInfo :: sensorInfo {
|
||||
vendorName = "borsh_bmi160"; // max string length is 16 bytes
|
||||
sensorTypeId = 1; // enum SensorTypeTag
|
||||
sensorId = 1; // user define sensor id
|
||||
}
|
||||
accelBusConfig :: sensorBusConfig {
|
||||
busType = 0; // 0:i2c 1:spi
|
||||
busNum = 6;
|
||||
busAddr = 0x68;
|
||||
regWidth = 1; // 1btye
|
||||
}
|
||||
accelAttr :: sensorAttr {
|
||||
chipName = "bmi160";
|
||||
chipIdRegister = 0x00;
|
||||
chipIdValue = 0xd1;
|
||||
}
|
||||
accelRegConfig {
|
||||
/* regAddr: register address
|
||||
value: config register value
|
||||
len: size of value
|
||||
mask: mask of value
|
||||
delay: config register delay time (ms)
|
||||
opsType: enum SensorOpsType 0-none 1-read 2-write 3-read_check 4-update_bit
|
||||
calType: enum SensorBitCalType 0-none 1-set 2-revert 3-xor 4-left shift 5-right shift
|
||||
shiftNum: shift bits
|
||||
debug: 0-no debug 1-debug
|
||||
save: 0-no save 1-save
|
||||
*/
|
||||
/* regAddr, value, mask, len, delay, opsType, calType, shiftNum, debug, save */
|
||||
initSeqConfig = [
|
||||
0x7e, 0xb6, 0xff, 1, 5, 2, 0, 0, 0, 0,
|
||||
0x7e, 0x10, 0xff, 1, 5, 2, 0, 0, 0, 0
|
||||
];
|
||||
enableSeqConfig = [
|
||||
0x7e, 0x11, 0xff, 1, 5, 2, 0, 0, 0, 0,
|
||||
0x41, 0x03, 0xff, 1, 0, 2, 0, 0, 0, 0,
|
||||
0x40, 0x08, 0xff, 1, 0, 2, 0, 0, 0, 0
|
||||
];
|
||||
disableSeqConfig = [
|
||||
0x7e, 0x10, 0xff, 1, 5, 2, 0, 0, 0, 0
|
||||
];
|
||||
}
|
||||
accel_bmi160_chip_config : sensorConfig {
|
||||
match_attr = "hdf_sensor_accel_driver";
|
||||
sensorInfo :: sensorDeviceInfo {
|
||||
sensorName = "accelerometer";
|
||||
vendorName = "borsh_bmi160"; // max string length is 16 bytes
|
||||
sensorTypeId = 1; // enum SensorTypeTag
|
||||
sensorId = 1; // user define sensor id
|
||||
power = 230;
|
||||
}
|
||||
sensorBusConfig :: sensorBusInfo {
|
||||
busType = 0; // 0:i2c 1:spi
|
||||
busNum = 6;
|
||||
busAddr = 0x68;
|
||||
regWidth = 1; // 1btye
|
||||
}
|
||||
sensorIdAttr :: sensorIdInfo {
|
||||
chipName = "bmi160";
|
||||
chipIdRegister = 0x00;
|
||||
chipIdValue = 0xd1;
|
||||
}
|
||||
sensorRegConfig {
|
||||
/* regAddr: register address
|
||||
value: config register value
|
||||
len: size of value
|
||||
mask: mask of value
|
||||
delay: config register delay time (ms)
|
||||
opsType: enum SensorOpsType 0-none 1-read 2-write 3-read_check 4-update_bit
|
||||
calType: enum SensorBitCalType 0-none 1-set 2-revert 3-xor 4-left shift 5-right shift
|
||||
shiftNum: shift bits
|
||||
debug: 0-no debug 1-debug
|
||||
save: 0-no save 1-save
|
||||
*/
|
||||
/* regAddr, value, mask, len, delay, opsType, calType, shiftNum, debug, save */
|
||||
initSeqConfig = [
|
||||
0x7e, 0xb6, 0xff, 1, 5, 2, 0, 0, 0, 0,
|
||||
0x7e, 0x10, 0xff, 1, 5, 2, 0, 0, 0, 0
|
||||
];
|
||||
enableSeqConfig = [
|
||||
0x7e, 0x11, 0xff, 1, 5, 2, 0, 0, 0, 0,
|
||||
0x41, 0x03, 0xff, 1, 0, 2, 0, 0, 0, 0,
|
||||
0x40, 0x08, 0xff, 1, 0, 2, 0, 0, 0, 0
|
||||
];
|
||||
disableSeqConfig = [
|
||||
0x7e, 0x10, 0xff, 1, 5, 2, 0, 0, 0, 0
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
30
hcs/sensor/sensor_common.hcs
Normal file
30
hcs/sensor/sensor_common.hcs
Normal file
@ -0,0 +1,30 @@
|
||||
// sensor common config template
|
||||
root {
|
||||
sensorConfig {
|
||||
template sensorDeviceInfo {
|
||||
sensorName = "sensor"; // max string length is 16 bytes
|
||||
vendorName = "vondorXXX_XXX"; // max string length is 16 bytes
|
||||
firmwareVersion = "1.0";
|
||||
hardwareVersion = "1.0";
|
||||
sensorTypeId = 0; // enum SensorTypeTag
|
||||
sensorId = 0; // user define sensor id, defaultenum SensorTypeTag
|
||||
maxRange = 8;
|
||||
accuracy = 0;
|
||||
power = 0;
|
||||
}
|
||||
|
||||
template sensorBusInfo {
|
||||
busType = 0; // 0:i2c 1:spi
|
||||
busNum = 6;
|
||||
busAddr = 0;
|
||||
regWidth = 1;
|
||||
regBigEndian = 0;
|
||||
}
|
||||
|
||||
template sensorIdInfo {
|
||||
chipName = "";
|
||||
chipIdRegister = 0xf;
|
||||
chipIdValue = 0xd1;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user