1#include "../sensor_common.hcs" 2root { 3 als_bh1745_chip_config : sensorConfig { 4 match_attr = "hdf_sensor_als_bh1745_driver"; 5 sensorInfo :: sensorDeviceInfo { 6 sensorName = "als"; 7 vendorName = "rohm_bh1745"; // max string length is 16 bytes 8 sensorTypeId = 5; // enum SensorTypeTag 9 sensorId = 5; // user define sensor id 10 power = 230; 11 } 12 sensorBusConfig :: sensorBusInfo { 13 busType = 0; // 0:i2c 1:spi 14 busNum = 3; 15 busAddr = 0x38; 16 regWidth = 1; // 1byte 17 } 18 sensorIdAttr :: sensorIdInfo { 19 chipName = "bh1745"; 20 chipIdRegister = 0x92; 21 chipIdValue = 0xE0; 22 } 23 sensorRegConfig { 24 /* regAddr: register address 25 value: config register value 26 len: size of value 27 mask: mask of value 28 delay: config register delay time (ms) 29 opsType: enum SensorOpsType 0-none 1-read 2-write 3-read_check 4-update_bit 30 calType: enum SensorBitCalType 0-none 1-set 2-revert 3-xor 4-left shift 5-right shift 31 shiftNum: shift bits 32 debug: 0-no debug 1-debug 33 save: 0-no save 1-save 34 */ 35 /* regAddr, value, mask, len, delay, opsType, calType, shiftNum, debug, save */ 36 initSeqConfig = [ 37 0x40, 0xc0, 0xff, 1, 5, 2, 0, 0, 0, 0, 38 0x42, 0x90, 0xff, 1, 5, 2, 0, 0, 0, 0, 39 0x44, 0x02, 0xff, 1, 5, 2, 0, 0, 0, 0, 40 0x41, 0x01, 0xff, 1, 5, 2, 0, 0, 0, 0 41 ]; 42 enableSeqConfig = [ 43 0x42, 0x10, 0x10, 1, 5, 4, 0, 0, 0, 0, 44 0x44, 0x02, 0xff, 1, 5, 2, 0, 0, 0, 0, 45 0x42, 0x02, 0x03, 1, 5, 4, 1, 0, 0, 0 //16X 46 ]; 47 disableSeqConfig = [ 48 0x42, 0x00, 0x10, 1, 5, 4, 0, 0, 0, 0 49 ]; 50 } 51 52 extendAlsRegConfig { 53 /* regAddr, value, mask, len, delay, opsType, calType, shiftNum, debug, save */ 54 time = [ 55 0x41, 0x00, 0x07, 1, 5, 0, 1, 0, 0, 0, //160msec 56 0x41, 0x01, 0x07, 1, 5, 0, 1, 0, 0, 0, //320msec 57 0x41, 0x02, 0x07, 1, 5, 0, 1, 0, 0, 0, //640msec 58 0x41, 0x03, 0x07, 1, 5, 0, 1, 0, 0, 0, //1280msec 59 0x41, 0x04, 0x07, 1, 5, 0, 1, 0, 0, 0, //2560msec 60 0x41, 0x05, 0x07, 1, 5, 0, 1, 0, 0, 0, //5120msec 61 ]; 62 gain = [ 63 0x42, 0x00, 0x03, 1, 5, 0, 1, 0, 0, 0, //1X 64 0x42, 0x01, 0x03, 1, 5, 0, 1, 0, 0, 0, //2X 65 0x42, 0x02, 0x03, 1, 5, 0, 1, 0, 0, 0 //16X 66 ]; 67 } 68 } 69} 70