TuyaOS
函数
tkl_adc.h 文件参考

Common process - adapter the adc api 更多...

#include "tuya_cloud_types.h"
tkl_adc.h 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

函数

OPERATE_RET tkl_adc_deinit (TUYA_ADC_NUM_E port_num)
 adc deinit 更多...
 
OPERATE_RET tkl_adc_init (TUYA_ADC_NUM_E port_num, TUYA_ADC_BASE_CFG_T *cfg)
 tuya kernel adc init 更多...
 
OPERATE_RET tkl_adc_read_data (TUYA_ADC_NUM_E port_num, INT32_T *buff, UINT16_T len)
 adc read 更多...
 
OPERATE_RET tkl_adc_read_single_channel (TUYA_ADC_NUM_E port_num, UINT8_T ch_id, INT32_T *data)
 read single channel 更多...
 
OPERATE_RET tkl_adc_read_voltage (TUYA_ADC_NUM_E port_num, INT32_T *buff, UINT16_T len)
 read voltage 更多...
 
UINT32_T tkl_adc_ref_voltage_get (TUYA_ADC_NUM_E port_num)
 get adc reference voltage 更多...
 
INT32_T tkl_adc_temperature_get (VOID_T)
 adc get temperature 更多...
 
UINT8_T tkl_adc_width_get (TUYA_ADC_NUM_E port_num)
 get adc width 更多...
 

详细描述

Common process - adapter the adc api

版本
0.1
日期
2021-08-06
版本
0.1
日期
2022-03-24

函数说明

◆ tkl_adc_deinit()

OPERATE_RET tkl_adc_deinit ( TUYA_ADC_NUM_E  port_num)

adc deinit

参数
[in]port_numadc port number
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tkl_adc_init()

OPERATE_RET tkl_adc_init ( TUYA_ADC_NUM_E  port_num,
TUYA_ADC_BASE_CFG_T cfg 
)

tuya kernel adc init

参数
[in]port_numadc port number
[in]cfgadc config
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tkl_adc_read_data()

OPERATE_RET tkl_adc_read_data ( TUYA_ADC_NUM_E  port_num,
INT32_T *  buff,
UINT16_T  len 
)

adc read

参数
[in]port_numadc port number
[out]buffpoints to the list of data read from the ADC register
[in]lenbuff len
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tkl_adc_read_single_channel()

OPERATE_RET tkl_adc_read_single_channel ( TUYA_ADC_NUM_E  port_num,
UINT8_T  ch_id,
INT32_T *  data 
)

read single channel

参数
[in]port_numadc port number
[in]ch_idchannel id in one adc unit
[out]buffconvert result buffer
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tkl_adc_read_voltage()

OPERATE_RET tkl_adc_read_voltage ( TUYA_ADC_NUM_E  port_num,
INT32_T *  buff,
UINT16_T  len 
)

read voltage

参数
[in]port_numadc port number
[out]buffpoints to the list of calculate voltage,bat : mv
[in]lenbuff len
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tkl_adc_ref_voltage_get()

UINT32_T tkl_adc_ref_voltage_get ( TUYA_ADC_NUM_E  port_num)

get adc reference voltage

参数
[in]port_num
返回
adc reference voltage(bat: mv)

◆ tkl_adc_temperature_get()

INT32_T tkl_adc_temperature_get ( VOID_T  )

adc get temperature

返回
temperature(bat: 'C)

◆ tkl_adc_width_get()

UINT8_T tkl_adc_width_get ( TUYA_ADC_NUM_E  port_num)

get adc width

参数
[in]port_numadc port number
返回
adc width