maix.ext_dev.axp2101
maix.ext_dev.axp2101 module
You can use
maix.ext_dev.axp2101
to access this module with MaixPy
This module is generated from MaixPy and MaixCDK
1. Module#
No module
2. Enum#
2.1. ChargerStatus#
charger status
item | describe |
---|---|
values | CHG_TRI_STATE: tri_charge CHG_PRE_STATE: pre_charge CHG_CC_STATE: constant charge CHG_CV_STATE: constant voltage CHG_DONE_STATE: charge done CHG_STOP_STATE: not charge |
C++ defination code:
2.2. ChargerCurrent#
charger current
item | describe |
---|---|
values | CHG_CUR_0MA: CHG_CUR_100MA: CHG_CUR_125MA: CHG_CUR_150MA: CHG_CUR_175MA: CHG_CUR_200MA: CHG_CUR_300MA: CHG_CUR_400MA: CHG_CUR_500MA: CHG_CUR_600MA: CHG_CUR_700MA: CHG_CUR_800MA: CHG_CUR_900MA: CHG_CUR_1000MA: |
C++ defination code:
2.3. PowerChannel#
power channel
item | describe |
---|---|
values | DCDC1: DCDC2: DCDC3: DCDC4: DCDC5: ALDO1: ALDO2: ALDO3: ALDO4: BLDO1: BLDO2: DLDO1: DLDO2: VBACKUP: CPULDO: |
C++ defination code:
2.4. PowerOffTime#
power off time
item | describe |
---|---|
values | POWEROFF_4S: POWEROFF_6S: POWEROFF_8S: POWEROFF_10S: POWEROFF_DISABLE: |
C++ defination code:
2.5. PowerOnTime#
power on time
item | describe |
---|---|
values | POWERON_128MS: POWERON_512MS: POWERON_1S: POWERON_2S: |
C++ defination code:
3. Variable#
4. Function#
5. Class#
5.1. AXP2101#
Peripheral AXP2101 class
C++ defination code:
5.1.1. __init__#
AXP2101 constructor.
item | description |
---|---|
type | func |
param | i2c_bus: i2c bus number. addr: pmu device addr. |
static | False |
C++ defination code:
5.1.2. init#
Initialise the AXP2101.
item | description |
---|---|
type | func |
return | err::Err type, if init success, return err::ERR_NONE. |
static | False |
C++ defination code:
5.1.3. poweroff#
Poweroff immediately.
item | description |
---|---|
type | func |
return | err::Err type, if init success, return err::ERR_NONE. |
static | False |
C++ defination code:
5.1.4. is_bat_connect#
Is the battery connected.
item | description |
---|---|
type | func |
return | bool type, if battery is connected, return true. |
static | False |
C++ defination code:
5.1.5. is_vbus_in#
Is the power adapter connected.
item | description |
---|---|
type | func |
return | bool type, if power adapter is connected, return true. |
static | False |
C++ defination code:
5.1.6. is_charging#
Is bat charging.
item | description |
---|---|
type | func |
return | bool type, if bat is charging, return true. |
static | False |
C++ defination code:
5.1.7. get_bat_percent#
Get the battery percentage.
item | description |
---|---|
type | func |
return | int type, return battery percentage. |
static | False |
C++ defination code:
5.1.8. get_charger_status#
Get the battery charging status.
item | description |
---|---|
type | func |
return | int type, return battery charging status. |
static | False |
C++ defination code:
5.1.9. get_bat_vol#
Get the battery voltage.
item | description |
---|---|
type | func |
return | uint16_t type, return battery voltage. |
static | False |
C++ defination code:
5.1.10. clean_irq#
Clear interrupt flag.
item | description |
---|---|
type | func |
return | err::Err type, if clean success, return err::ERR_NONE. |
static | False |
C++ defination code:
5.1.11. set_bat_charging_cur#
Set the battery charging current.
item | description |
---|---|
type | func |
param | current: The current to be set. The available values are 0mA, 100mA, 125mA, 150mA, 175mA, 200mA, 300mA, 400mA, 500mA, 600mA, 700mA, 800mA, 900mA, and 1000mA. |
return | err::Err type, if set success, return err::ERR_NONE. |
static | False |
C++ defination code:
5.1.12. get_bat_charging_cur#
Get the battery charging current.
item | description |
---|---|
type | func |
return | ChargerCurrent, return the currently set charging current. |
static | False |
C++ defination code:
5.1.13. dcdc1#
Set and get the PMU DCDC1 voltage.
item | description |
---|---|
type | func |
param | voltage: The voltage to be set, voltage range is 1500mV~3400mV(step 20mV). |
return | int, return the PMU DCDC1 voltage. |
static | False |
C++ defination code:
5.1.14. dcdc2#
Set and get the PMU DCDC2 voltage.
item | description |
---|---|
type | func |
param | voltage: The voltage to be set, voltage range is 500mV~1200mV(step 10mV) and 1220mV~1540mV(step 20mV). |
return | int, return the PMU DCDC2 voltage. |
static | False |
C++ defination code:
5.1.15. dcdc3#
Set and get the PMU DCDC3 voltage.
item | description |
---|---|
type | func |
param | voltage: The voltage to be set, voltage range is 500mV~1200mV(step 10mV) and 1220mV~1540mV(step 20mV). |
return | int, return the PMU DCDC3 voltage. |
static | False |
C++ defination code:
5.1.16. dcdc4#
Set and get the PMU DCDC4 voltage.
item | description |
---|---|
type | func |
param | voltage: The voltage to be set, voltage range is 500mV~1200mV(step 10mV) and 1220mV~1840mV(step 20mV). |
return | int, return the PMU DCDC4 voltage. |
static | False |
C++ defination code:
5.1.17. dcdc5#
Set and get the PMU DCDC5 voltage.
item | description |
---|---|
type | func |
param | voltage: The voltage to be set, voltage range is 1400mV~3700mV(step 100mV). |
return | int, return the PMU DCDC5 voltage. |
static | False |
C++ defination code:
5.1.18. aldo1#
Set and get the PMU ALDO1 voltage.
item | description |
---|---|
type | func |
param | voltage: The voltage to be set, voltage range is 500mV~3500mV(step 100mV). |
return | int, return the PMU ALDO1 voltage. |
static | False |
C++ defination code:
5.1.19. aldo2#
Set and get the PMU ALDO2 voltage.
item | description |
---|---|
type | func |
param | voltage: The voltage to be set, voltage range is 500mV~3500mV(step 100mV). |
return | int, return the PMU ALDO2 voltage. |
static | False |
C++ defination code:
5.1.20. aldo3#
Set and get the PMU ALDO3 voltage.
item | description |
---|---|
type | func |
param | voltage: The voltage to be set, voltage range is 500mV~3500mV(step 100mV). |
return | int, return the PMU ALDO3 voltage. |
static | False |
C++ defination code:
5.1.21. aldo4#
Set and get the PMU ALDO4 voltage.
item | description |
---|---|
type | func |
param | voltage: The voltage to be set, voltage range is 500mV~3500mV(step 100mV). |
return | int, return the PMU ALDO4 voltage. |
static | False |
C++ defination code:
5.1.22. bldo1#
Set and get the PMU BLDO1 voltage.
item | description |
---|---|
type | func |
param | voltage: The voltage to be set, voltage range is 500mV~3500mV(step 100mV). |
return | int, return the PMU BLDO1 voltage. |
static | False |
C++ defination code:
5.1.23. bldo2#
Set and get the PMU BLDO2 voltage.
item | description |
---|---|
type | func |
param | voltage: The voltage to be set, voltage range is 500mV~3500mV(step 100mV). |
return | int, return the PMU BLDO2 voltage. |
static | False |
C++ defination code:
5.1.24. set_poweroff_time#
Set power-off time, The device will shut down\nif the power button is held down longer than this time.
item | description |
---|---|
type | func |
param | tm: The time to be set, you can set it to 4s, 6s, 8s, or 10s. |
return | err::Err type, if set success, return err::ERR_NONE. |
static | False |
C++ defination code:
5.1.25. get_poweroff_time#
Get power-off time.
item | description |
---|---|
type | func |
return | PowerOffTime, return power-off time. |
static | False |
C++ defination code:
5.1.26. set_poweron_time#
Set power-on time, The device will power on\nif the power button is held down longer than this time.
item | description |
---|---|
type | func |
param | tm: The time to be set, you can set it to 128ms, 512ms, 1s, or 2s. |
return | err::Err type, if set success, return err::ERR_NONE. |
static | False |
C++ defination code:
5.1.27. get_poweron_time#
Get power-on time.
item | description |
---|---|
type | func |
return | PowerOnTime, return power-on time. |
static | False |
C++ defination code: