![]() |
Core2 for AWS IoT EduKit BSP 1.5.1
|
Functions for the AXP192 Power Management Unit (PMU) More...
#include "stdint.h"Go to the source code of this file.
Functions | |
| void | Axp192_Init () |
| Initializes the AXP192 over I2C. More... | |
| void | Axp192_EnableLDODCExt (uint8_t value) |
| Extends the DC voltage range of the Low-Dropout regulator (LDO) on the AXP192. More... | |
| void | Axp192_EnableExten (uint8_t state) |
| Enables or disables extending the Low-Dropout (LDO) voltage on the AXP192. More... | |
| void | Axp192_EnableLDO2 (uint8_t state) |
| Enables or disables Low-Dropout (LDO) 2 on the AXP192. More... | |
| void | Axp192_EnableLDO3 (uint8_t state) |
| Enables or disables Low-Dropout (LDO) 3 on the AXP192. More... | |
| void | Axp192_EnableDCDC1 (uint8_t state) |
| Enables or disables DC/DC 1 Buck Boost converter on the AXP192. More... | |
| void | Axp192_EnableDCDC2 (uint8_t state) |
| Enables or disables DC/DC 2 Buck Boost converter on the AXP192. More... | |
| void | Axp192_EnableDCDC3 (uint8_t state) |
| Enables or disables DC/DC 3 Buck Boost converter. More... | |
| void | Axp192_SetLDO23Volt (uint16_t ldo2_voltage, uint16_t ldo3_voltage) |
| Set both LDO 2 and LDO 3 voltage on the AXP192. More... | |
| void | Axp192_SetLDO2Volt (uint16_t voltage) |
| Set the LDO 2 voltage on the AXP192. More... | |
| void | Axp192_SetLDO3Volt (uint16_t voltage) |
| Set the Low-Dropout (LDO) 3 voltage on the AXP192. More... | |
| void | Axp192_SetDCDC1Volt (uint16_t voltage) |
| Set the DC/DC 1 Buck Boost converter voltage on the AXP192. More... | |
| void | Axp192_SetDCDC2Volt (uint16_t voltage) |
| Set the DC/DC 2 Buck Boost converter voltage on the AXP192. More... | |
| void | Axp192_SetDCDC3Volt (uint16_t voltage) |
| Set the DC/DC 3 Buck Boost converter voltage on the AXP192. More... | |
| void | Axp192_SetVoffVolt (uint16_t voltage) |
| Set the battery low-voltage to cut-off on the AXP192. More... | |
| void | Axp192_EnablePWRONShortWake () |
| Enable sleep and short wake mode on AXP192. More... | |
| float | Axp192_GetVbusVolt () |
| Gets VBUS voltage on the AXP192. More... | |
| float | Axp192_GetAcinVolt () |
| Gets ACIN voltage on the AXP192. More... | |
| float | Axp192_GetBatVolt () |
| Gets battery voltage on the AXP192. More... | |
| float | Axp192_GetVbusCurrent () |
| Gets VBUS current flowing through the AXP192. More... | |
| float | Axp192_GetAcinCurrent () |
| Gets ACIN current flowing through the AXP192. More... | |
| float | Axp192_GetBatCurrent () |
| Gets battery current flowing through the AXP192. More... | |
| void | Axp192_EnableCharge (uint16_t state) |
| Enables or disables the battery charging circuit on the AXP192. More... | |
| void | Axp192_SetChargeVoltage (Axp192_ChargeVolt_t volt) |
| Set the battery charge voltage on the AXP192. More... | |
| void | Axp192_SetChargeCurrent (Axp192_ChargeCurrent_t cur) |
| Set the battery charge current on the AXP192. More... | |
| void | Axp192_SetSpareBatCharge (uint8_t enable, Axp192_SpareChargeVolt_t volt, Axp192_SpareChargeCurrent_t current) |
| void | Axp192_GetApsVoltage () |
| void | Axp192_GetInternalTemp () |
| void | Axp192_SetAdc1Enable (uint8_t value) |
| Enables or disables the ADC on the AXP192. More... | |
| void | Axp192_SetAdc2Enable () |
| void | Axp192_IsBatIn () |
| void | Axp192_IsCharging () |
| void | Axp192_PowerOff () |
| Powers down the device. More... | |
| void | Axp192_SetPressPoweroffTime (Axp192_PoweroffTime_t time) |
| Sets how long the power button needs to be held to power off all components connected to the AXP192. More... | |
| void | Axp192_SetPressStartupTime (Axp192_StartupTime_t time) |
| Sets how long the power button needs to be held to power on all components connected to the AXP192. More... | |
| void | Axp192_WriteDataStash () |
| void | Axp192_ReadDataStash () |
| void | Axp192_SetGPIO4Mode (uint8_t mode) |
| Sets the mode of GPIO 4 on the AXP192 for charging control. More... | |
| void | Axp192_SetGPIO4Level (uint8_t level) |
| Sets the signal status level of GPIO 4. More... | |
| void | Axp192_SetGPIO2Mode (uint8_t mode) |
| Sets the mode of GPIO 2 on the AXP192. More... | |
| void | Axp192_SetGPIO2Level (uint8_t level) |
| Sets the average voltage level of GPIO 2 on the AXP192 if the mode is set to PWM. More... | |
| void | Axp192_SetGPIO0Mode (uint8_t mode) |
| Sets the mode of GPIO 0 on the AXP192. More... | |
| void | Axp192_SetGPIO0Volt (uint16_t volt) |
| Sets the voltage of GPIO 0 on the AXP192. More... | |
| void | Axp192_SetGPIO1Mode (uint8_t mode) |
| Sets the mode of GPIO 1 on the AXP192. More... | |
| void | Axp192_SetGPIO1Level (uint8_t level) |
| Sets the average voltage level of GPIO 1 on the AXP192 if the mode is set to PWM. More... | |
Functions for the AXP192 Power Management Unit (PMU)
| #define AXP192_DC_VOLT_STEP 25 |
| #define AXP192_DC_VOLT_MIN 700 |
| #define AXP192_DC_VOLT_MAX 3500 |
| #define AXP192_LDO_VOLT_STEP 100 |
| #define AXP192_LDO_VOLT_MIN 1800 |
| #define AXP192_LDO_VOLT_MAX 3300 |
| #define AXP192_VOFF_VOLT_STEP 100 |
| #define AXP192_VOFF_VOLT_MIN 2600 |
| #define AXP192_VOFF_VOLT_MAX 3300 |
| #define AXP192_LDO23_DC123_EXT_CTL_REG 0x12 |
| #define AXP192_DC1_EN_BIT (0) |
| #define AXP192_DC3_EN_BIT (1) |
| #define AXP192_LDO2_EN_BIT (2) |
| #define AXP192_LDO3_EN_BIT (3) |
| #define AXP192_DC2_EN_BIT (4) |
| #define AXP192_EXT_EN_BIT (6) |
| #define AXP192_DC1_VOLT_REG 0x26 |
| #define AXP192_DC2_VOLT_REG 0x23 |
| #define AXP192_DC3_VOLT_REG 0x27 |
| #define AXP192_LDO23_VOLT_REG 0x28 |
| #define AXP192_VBUS_IPSOUT_CTL_REG 0x30 |
| #define AXP192_VOFF_VOLT_REG 0x31 |
| #define AXP192_POWEROFF_REG 0x32 |
| #define AXP192_CHG_CTL1_REG 0x33 |
| #define AXP192_CHG_CTL2_REG 0x34 |
| #define AXP192_SPARE_CHG_CTL_REG 0x35 |
| #define AXP192_PEK_CTL_REG 0x36 |
| #define AXP192_CHG_BOOL_REG 0x01 |
| #define AXP192_ADC1_ENABLE_REG 0x82 |
| #define BAT_VOLT_BIT (7) |
| #define BAT_CURRENT_BIT (6) |
| #define ACIN_VOLT_BIT (5) |
| #define ACIN_CURRENT_BIT (4) |
| #define VBUS_VOLT_BIT (3) |
| #define VBUS_CURRENT_BIT (2) |
| #define APS_VOLT_BIT (1) |
| #define TS_BIT (0) |
| #define AXP192_ACIN_ADC_VOLTAGE_REG 0x56 |
| #define AXP192_ACIN_ADC_CURRENT_REG 0x58 |
| #define AXP192_VBUS_ADC_VOLTAGE_REG 0x5A |
| #define AXP192_VBUS_ADC_CURRENT_REG 0x5C |
| #define AXP192_BAT_ADC_VOLTAGE_REG 0x78 |
| #define AXP192_BAT_ADC_CURRENT_IN_REG 0x7A |
| #define AXP192_BAT_ADC_CURRENT_OUT_REG 0x7C |
| #define AXP192_GPIO0_CTL_REG 0x90 |
| #define AXP192_GPIO0_VOLT_REG 0x91 |
| #define AXP192_GPIO1_CTL_REG 0x92 |
| #define AXP192_GPIO2_CTL_REG 0x93 |
| #define AXP192_GPIO34_CTL_REG 0x95 |
| #define AXP192_GPIO34_STATE_REG 0x96 |
| #define AXP192_GPIO012_STATE_REG 0x94 |
| enum Axp192_ChargeVolt_t |
List of available charging current rates.
| enum Axp192_StartupTime_t |
List of possible durations the power button must be held to power on the Core2 for AWS IoT EduKit.
List of possible durations the power button must be held to power off the Core2 for AWS IoT EduKit.
| void Axp192_Init | ( | ) |
Initializes the AXP192 over I2C.
It is a wrapper to Axp192_I2CInit().
| void Axp192_EnableLDODCExt | ( | uint8_t | value | ) |
Extends the DC voltage range of the Low-Dropout regulator (LDO) on the AXP192.
| [in] | value | Desired voltage of the LDO. |
| void Axp192_EnableExten | ( | uint8_t | state | ) |
Enables or disables extending the Low-Dropout (LDO) voltage on the AXP192.
| [in] | state | Desired state of LDO extention. 1 to enable, 0 to disable. |
| void Axp192_EnableLDO2 | ( | uint8_t | state | ) |
Enables or disables Low-Dropout (LDO) 2 on the AXP192.
| [in] | state | Desired state of LDO 2. 1 to enable, 0 to disable. |
| void Axp192_EnableLDO3 | ( | uint8_t | state | ) |
Enables or disables Low-Dropout (LDO) 3 on the AXP192.
| [in] | state | Desired state of LDO 3. 1 to enable, 0 to disable. |
| void Axp192_EnableDCDC1 | ( | uint8_t | state | ) |
Enables or disables DC/DC 1 Buck Boost converter on the AXP192.
| [in] | state | Desired state of DC/DC 1. 1 to enable, 0 to disable. |
| void Axp192_EnableDCDC2 | ( | uint8_t | state | ) |
Enables or disables DC/DC 2 Buck Boost converter on the AXP192.
| [in] | state | Desired state of DC/DC 2. 1 to enable, 0 to disable. |
| void Axp192_EnableDCDC3 | ( | uint8_t | state | ) |
Enables or disables DC/DC 3 Buck Boost converter.
| [in] | state | Desired state of DC/DC 3. 1 to enable, 0 to disable. |
| void Axp192_SetLDO23Volt | ( | uint16_t | ldo2_voltage, |
| uint16_t | ldo3_voltage | ||
| ) |
Set both LDO 2 and LDO 3 voltage on the AXP192.
| [in] | ldo2_voltage | Desired voltage of LDO 2. |
| [in] | ldo3_voltage | Desired voltage of LDO 3. |
| void Axp192_SetLDO2Volt | ( | uint16_t | voltage | ) |
Set the LDO 2 voltage on the AXP192.
| [in] | voltage | Desired voltage of LDO 2. |
| void Axp192_SetLDO3Volt | ( | uint16_t | voltage | ) |
Set the Low-Dropout (LDO) 3 voltage on the AXP192.
| [in] | voltage | Desired voltage of LDO 3. |
| void Axp192_SetDCDC1Volt | ( | uint16_t | voltage | ) |
Set the DC/DC 1 Buck Boost converter voltage on the AXP192.
| [in] | voltage | Desired voltage of DC/DC 1. |
| void Axp192_SetDCDC2Volt | ( | uint16_t | voltage | ) |
Set the DC/DC 2 Buck Boost converter voltage on the AXP192.
| [in] | voltage | Desired voltage of DC/DC 2. |
| void Axp192_SetDCDC3Volt | ( | uint16_t | voltage | ) |
Set the DC/DC 3 Buck Boost converter voltage on the AXP192.
| [in] | voltage | Desired voltage of DC/DC 3. |
| void Axp192_SetVoffVolt | ( | uint16_t | voltage | ) |
Set the battery low-voltage to cut-off on the AXP192.
| [in] | voltage | Low battery cut-off voltage. |
| void Axp192_EnablePWRONShortWake | ( | ) |
Enable sleep and short wake mode on AXP192.
| float Axp192_GetVbusVolt | ( | ) |
Gets VBUS voltage on the AXP192.
| float Axp192_GetAcinVolt | ( | ) |
Gets ACIN voltage on the AXP192.
| float Axp192_GetBatVolt | ( | ) |
Gets battery voltage on the AXP192.
| float Axp192_GetVbusCurrent | ( | ) |
Gets VBUS current flowing through the AXP192.
| float Axp192_GetAcinCurrent | ( | ) |
Gets ACIN current flowing through the AXP192.
| float Axp192_GetBatCurrent | ( | ) |
Gets battery current flowing through the AXP192.
| void Axp192_EnableCharge | ( | uint16_t | state | ) |
Enables or disables the battery charging circuit on the AXP192.
| [in] | state | Desired state of the battery charging circuit. 1 to enable, 0 to disable. |
| void Axp192_SetChargeVoltage | ( | Axp192_ChargeVolt_t | volt | ) |
Set the battery charge voltage on the AXP192.
| [in] | volt | Desired voltage to charge the battery. |
| void Axp192_SetChargeCurrent | ( | Axp192_ChargeCurrent_t | cur | ) |
Set the battery charge current on the AXP192.
| [in] | cur | Desired current to charge the battery. |
| void Axp192_SetSpareBatCharge | ( | uint8_t | enable, |
| Axp192_SpareChargeVolt_t | volt, | ||
| Axp192_SpareChargeCurrent_t | current | ||
| ) |
| void Axp192_GetApsVoltage | ( | ) |
| void Axp192_GetInternalTemp | ( | ) |
| void Axp192_SetAdc1Enable | ( | uint8_t | value | ) |
Enables or disables the ADC on the AXP192.
| [in] | value | Desired value of the ADC. |
| void Axp192_SetAdc2Enable | ( | ) |
| void Axp192_IsBatIn | ( | ) |
| void Axp192_IsCharging | ( | ) |
| void Axp192_PowerOff | ( | ) |
Powers down the device.
| void Axp192_SetPressPoweroffTime | ( | Axp192_PoweroffTime_t | time | ) |
Sets how long the power button needs to be held to power off all components connected to the AXP192.
| [in] | time | Desired time to hold the power button to turn off power. |
| void Axp192_SetPressStartupTime | ( | Axp192_StartupTime_t | time | ) |
Sets how long the power button needs to be held to power on all components connected to the AXP192.
Default is STARTUP_128mS (128 milliseconds).
| [in] | time | Desired time to hold the power button to turn on power. |
| void Axp192_WriteDataStash | ( | ) |
| void Axp192_ReadDataStash | ( | ) |
| void Axp192_SetGPIO4Mode | ( | uint8_t | mode | ) |
Sets the mode of GPIO 4 on the AXP192 for charging control.
| [in] | mode | Desired mode of GPIO 4. 0 for NMOS open-drain ouput, 1 for universal input. Default value for the Core2 for AWS is 1, and not meant to be changed. |
| void Axp192_SetGPIO4Level | ( | uint8_t | level | ) |
Sets the signal status level of GPIO 4.
| [in] | level | Desired signal status level of GPIO 4. |
| void Axp192_SetGPIO2Mode | ( | uint8_t | mode | ) |
Sets the mode of GPIO 2 on the AXP192.
| [in] | mode | Desired mode of GPIO 2. 0 for PWM, 1 for ADC input. Default value for the Core2 for AWS is 1, and not meant to be changed. |
| void Axp192_SetGPIO2Level | ( | uint8_t | level | ) |
Sets the average voltage level of GPIO 2 on the AXP192 if the mode is set to PWM.
| [in] | level | Desired average voltage level of GPIO 2. |
| void Axp192_SetGPIO0Mode | ( | uint8_t | mode | ) |
Sets the mode of GPIO 0 on the AXP192.
| [in] | mode | Desired mode of GPIO 0. 0 for Low-Dropout, 1 for ADC input. Default value for the Core2 for AWS is 0, and not meant to be changed. |
| void Axp192_SetGPIO0Volt | ( | uint16_t | volt | ) |
Sets the voltage of GPIO 0 on the AXP192.
| [in] | volt | Desired voltage of GPIO 0. Default value for the Core2 for AWS is 3300mV. |
| void Axp192_SetGPIO1Mode | ( | uint8_t | mode | ) |
Sets the mode of GPIO 1 on the AXP192.
| [in] | mode | Desired mode of GPIO 1. 0 for PWM, 1 for ADC input. Default value for the Core2 for AWS is 1, and not meant to be changed. |
| void Axp192_SetGPIO1Level | ( | uint8_t | level | ) |
Sets the average voltage level of GPIO 1 on the AXP192 if the mode is set to PWM.
| [in] | level | Desired average voltage level of GPIO 1. |