![]() |
Core2 for AWS IoT EduKit BSP 1.5.1
|
#include "axp192.h"#include "axp192_i2c.h"#include "stdio.h"#include "freertos/FreeRTOS.h"#include "freertos/task.h"Macros | |
| #define | VALUE_LIMIT(x, min, max) (((x) < min) ? min : (((x) > max) ? max : (x))) |
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_SetGPIO3Mode () |
| 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... | |
| 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_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... | |
| #define VALUE_LIMIT | ( | x, | |
| min, | |||
| max | |||
| ) | (((x) < min) ? min : (((x) > max) ? max : (x))) |
| 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_SetGPIO3Mode | ( | ) |
| 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. |
| 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_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. |