1/* Copyright 2022 Unionman Technology Co., Ltd. 2 * 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 * 15 */ 16 17/** 18 * unionman a311d 19 * @since 8 20 * @devices phone, tablet 21 * @import import i2cnapidemo from '@ohos.i2cnapidemo'; 22 * @permission N/A 23 */ 24 25declare namespace i2cnapidemo { 26 27 // 传感器软重启 28 function SoftReset(): number; 29 30 /** 31 * 设置传感器测量模式 32 * @param mps 取值为[0,3] 对应mps=0.5、1、2、4、10Hz 33 * @param repeatability 取值为[0,2] 对应低刷新率、中刷新率、高刷新率 34 */ 35 function ModeSet(mps: number, repeatability: number): number; 36 37 // 读取温湿度数据 38 function ReadData(): number; 39 // 使用下列三个接口时必须先调用ReadData 40 function ReadTemperatureC(): number; 41 function ReadHumidity(): number; 42 function ReadTemperatureF(): number; 43} 44 45export default i2cnapidemo;