maix.peripheral.adc
maix.peripheral.adc module
You can use
maix.peripheral.adc
to access this module with MaixPy
This module is generated from MaixPy and MaixCDK
1. Module#
No module
2. Enum#
3. Variable#
3.1. RES_BIT_8#
8-bit resolution, supported by the actual hardware
item | description |
---|---|
value | 8 |
readonly | True |
C++ defination code:
3.2. RES_BIT_10#
10-bit resolution, supported by the actual hardware
item | description |
---|---|
value | 10 |
readonly | True |
C++ defination code:
3.3. RES_BIT_12#
12-bit resolution, supported by the actual hardware
item | description |
---|---|
value | 12 |
readonly | True |
C++ defination code:
3.4. RES_BIT_16#
16-bit resolution, supported by the actual hardware
item | description |
---|---|
value | 16 |
readonly | True |
C++ defination code:
4. Function#
5. Class#
5.1. ADC#
Peripheral adc class
C++ defination code:
5.1.1. __init__#
ADC constructor
item | description |
---|---|
type | func |
param | id: direction [in], adc id, int type, before use this ADC, you should use pinmap to ensure the coresponding pin is ADC function. resolution: direction [in], adc resolution. default is -1, means use default resolution option: resolution = adc.RES_BIT_8, means 8-bit resolution resolution = adc.RES_BIT_10, means 10-bit resolution resolution = adc.RES_BIT_12, means 12-bit resolution resolution = adc.RES_BIT_16, means 16-bit resolution the default resolution is determined by actual hardware. vref: direction [in], adc refer voltage. default is -1, means use default refer voltage. the default vref is determined by actual hardware. range: [0.0, 10.0] |
static | False |
C++ defination code:
5.1.2. read#
read adc value
item | description |
---|---|
type | func |
return | adc data, int type if resolution is 8-bit, return value range is [0, 255] if resolution is 10-bit, return value range is [0, 1023] if resolution is 12-bit, return value range is [0, 4095] if resolution is 16-bit, return value range is [0, 65535] |
static | False |
C++ defination code:
5.1.3. read_vol#
read adc voltage
item | description |
---|---|
type | func |
return | adc voltage, float type。the range is [0.0, vref] |
static | False |
C++ defination code: