OpenHarmony硬件开发—驱动子系统开发—ADC

qq64da06e2c99e4
发布于 2023-9-6 02:12
浏览
0收藏
  • .驱动子系统开发—ADC
  • ADC API介绍
  • AdcRead(WifiIotAdcChannelIndex channel, unsigned short *data, WifiIotAdcEquModelSel equModel,WifiIotAdcCurBais curBais, unsigned short rstCnt);
  • * @brief Reads a piece of sampled data from a specified ADC channel based on the input parameters.//根据输入参数从指定的ADC通道读取一段采样数据。
  • * @param channel Indicates the ADC channel index.//通道 指示 ADC 通道索引。
  • 据讲解具体的需要查看芯片手册位置在:手册显示通道有V:\home\bearpi\code\code1\applications\BearPi\BearPi-HM_Nano\docs\board
  • OpenHarmony硬件开发—驱动子系统开发—ADC-鸿蒙开发者社区

  • * @param data Indicates the pointer to the address for storing the read data.//data 指示指向用于存储读取数据的地址的指针
  • * @param equModel Indicates the equation model.//equModel 表示方程模型。
  • 第三个参数表示平均算法的次数,这里传入WIFI_IOT_ADC_EQU_MODEL_8表示它是“Eight-equation model”,相关映射在源代码。根据他的讲解意思是取八次结果的平均值。base\iot_hardware\interfaces\kits\wifiiot_lite\wifiiot_adc.h的枚举类型WifiIotAdcCurBais里;
  • * @param curBais Indicates the analog power control mode.//curBais 表示模拟功率控制模式。
  • 就是电压值
  • OpenHarmony硬件开发—驱动子系统开发—ADC-鸿蒙开发者社区

  • * @param rstCnt Indicates the count of the time from reset to conversion start.//rstCnt 指示从重置到转换开始的时间计数。一般填0xff
  • One count is equal to 334 ns. The value must range from 0 to 0xFF0.//一个计数等于 334 ns。该值的范围必须介于 0 到 0xFF0 之间。
  • 查看ADC对应的GPIO引脚
  • ADC读取GPIO的电压值
  • 代码
  • OpenHarmony硬件开发—驱动子系统开发—ADC-鸿蒙开发者社区

    OpenHarmony硬件开发—驱动子系统开发—ADC-鸿蒙开发者社区

  • 扩展,弯曲传感器的使用
    • OpenHarmony硬件开发—驱动子系统开发—ADC-鸿蒙开发者社区

      OpenHarmony硬件开发—驱动子系统开发—ADC-鸿蒙开发者社区

      OpenHarmony硬件开发—驱动子系统开发—ADC-鸿蒙开发者社区


标签
收藏
回复
举报
回复
    相关推荐