除了 ESP32 ADC(模擬數碼轉換器 / Analog to Digital Converter)API 函數模塊外,還提供了巨集(Marco)、和枚舉(Enumerations)。
1. Macros:
Macros
|
Description
|
ADC_ATTEN_0db
|
The input voltage of ADC will be reduced to about 1/1
|
ADC_ATTEN_2_5dbm
|
The input voltage of ADC will be reduced to about 1/1.34
|
ADC_ATTEN_6db
|
The input voltage of ADC will be reduced to about 1/2
|
ADC_ATTEN_11db
|
The input voltage of ADC will be reduced to about 1/3.6
|
ADC_WIDTH_9Bit
|
ADC capture width is 9Bit
|
ADC_WIDTH_10Bit
|
ADC capture width is 10Bit
|
ADC_WIDTH_11Bit
|
ADC capture width is 11Bit
|
ADC_WIDTH_12Bit
|
ADC capture width is 12Bit
|
2. Enumerations:
2.1. enum adc_atten_t:
Enumeration
|
Description
|
ADC_ATTEN_DB_0 = 0
|
The input voltage of ADC will be reduced to about 1/1
|
ADC_ATTEN_DB_2_5 = 1
|
The input voltage of ADC will be reduced to about 1/1.34
|
ADC_ATTEN_DB_6 = 2
|
The input voltage of ADC will be reduced to about 1/2
|
ADC_ATTEN_DB_11 = 3
|
The input voltage of ADC will be reduced to about 1/3.6
|
ADC_ATTEN_MAX
|
2.2. enum adc_bits_width_t:
Enumeration
|
Description
|
ADC_WIDTH_BIT_9 = 0
|
ADC capture width is 9Bit
|
ADC_WIDTH_BIT_10 = 1
|
ADC capture width is 10Bit
|
ADC_WIDTH_BIT_11 = 2
|
ADC capture width is 11Bit
|
ADC_WIDTH_BIT_12 = 3
|
ADC capture width is 12Bit
|
ADC_WIDTH_MAX
|
2.3. enum adc1_channel_t:
Enumeration
|
Description
|
ADC1_CHANNEL_0 = 0
|
ADC1 channel 0 is GPIO36
|
ADC1_CHANNEL_1
|
ADC1 channel 1 is GPIO37
|
ADC1_CHANNEL_2
|
ADC1 channel 2 is GPIO38
|
ADC1_CHANNEL_3
|
ADC1 channel 3 is GPIO39
|
ADC1_CHANNEL_4
|
ADC1 channel 4 is GPIO32
|
ADC1_CHANNEL_5
|
ADC1 channel 5 is GPIO33
|
ADC1_CHANNEL_6
|
ADC1 channel 6 is GPIO34
|
ADC1_CHANNEL_7
|
ADC1 channel 7 is GPIO35
|
ADC1_CHANNEL_MAX
|
2.4. enum adc2_channel_t:
Enumeration
|
Description
|
ADC2_CHANNEL_0 = 0
|
ADC2 channel 0 is GPIO4
|
ADC2_CHANNEL_1
|
ADC2 channel 1 is GPIO0
|
ADC2_CHANNEL_2
|
ADC2 channel 2 is GPIO2
|
ADC2_CHANNEL_3
|
ADC2 channel 3 is GPIO15
|
ADC2_CHANNEL_4
|
ADC2 channel 4 is GPIO13
|
ADC2_CHANNEL_5
|
ADC2 channel 5 is GPIO12
|
ADC2_CHANNEL_6
|
ADC2 channel 6 is GPIO14
|
ADC2_CHANNEL_7
|
ADC2 channel 7 is GPIO27
|
ADC2_CHANNEL_8
|
ADC2 channel 8 is GPIO25
|
ADC2_CHANNEL_9
|
ADC2 channel 9 is GPIO26
|
ADC2_CHANNEL_MAX
|
2.5. enum adc_channel_t:
Enumeration
|
Description
|
ADC_CHANNEL_0 = 0
|
ADC channel 0
|
ADC_CHANNEL_1
|
ADC channel 1
|
ADC_CHANNEL_2
|
ADC channel 2
|
ADC_CHANNEL_3
|
ADC channel 3
|
ADC_CHANNEL_4
|
ADC channel 4
|
ADC_CHANNEL_5
|
ADC channel 5
|
ADC_CHANNEL_6
|
ADC channel 6
|
ADC_CHANNEL_7
|
ADC channel 7
|
ADC_CHANNEL_8
|
ADC channel 8
|
ADC_CHANNEL_9
|
ADC channel 9
|
ADC_CHANNEL_MAX
|
2.6. enum adc_unit_t:
Enumeration
|
Description
|
ADC_UNIT_1 = 1
|
SAR ADC 1
|
ADC_UNIT_2 = 2
|
SAR ADC 2, not supported yet
|
ADC_UNIT_BOTH = 3
|
SAR ADC 1 and 2, not supported yet
|
ADC_UNIT_ALTER = 7
|
SAR ADC 1 and 2 alternative mode, not supported yet
|
ADC_UNIT_MAX
|
2.7. enum adc_i2s_encode_t:
Enumeration
|
Description
|
ADC_ENCODE_12BIT
|
ADC to I2S data format, [15:12]-channel [11:0]-12 bits ADC
data
|
ADC_ENCODE_11BIT
|
ADC to I2S data format, [15]-1 [14:11]-channel [10:0]-11
bits ADC data
|
ADC_ENCODE_MAX
|
2.8. enum adc_i2s_source_t:
Enumeration
|
Description
|
ADC_I2S_DATA_SRC_IO_SIG = 0
|
I2S data from GPIO matrix signal
|
ADC_I2S_DATA_SRC_ADC = 1
|
I2S data from ADC
|
ADC_I2S_DATA_SRC_MAX
|
相關網址:
※ DIY - ESP32:ESP32 ADC 模擬數碼轉換器介紹 (四十三)
※ DIY - ESP32:ESP32 ADC / DAC 模擬數碼轉換器電路 (四十四)
※ DIY - ESP32:ESP32 ADC / DAC 模擬數碼轉換器程式 (四十五)
※ DIY - ESP32:ESP32 ADC 模擬數碼轉換器 API 函數(四十六)
※ DIY - ESP32:ESP32 DAC 數位類比轉換器 API 函數(四十八)
※ DIY - ESP32:ESP32 DAC 數位類比轉換器 API 函數巨集及其它(四十九)
※ DIY - ESP32:ESP32 ADC 類比數位轉換器測試(五十)
※ DIY - ESP32:ESP32 ADC DVM 數字電壓錶電路(五十一)
※ DIY - ESP32:ESP32 ADC DVM 數字電壓錶程式 (五十二)
2018年 12月 7日 天氣報告
氣溫:18.6度 @ 21:40
相對濕度:百分之 82%
天氣:微雨
沒有留言:
張貼留言