#include "driverlib/5xx_6xx/bat.h"
#include "inc/hw_types.h"
#include "deprecated/CCS/msp430xgeneric.h"
#include "driverlib/5xx_6xx/debug.h"
Functions | |
unsigned short | BAT_unlockBackupSubSystem (unsigned int baseAddress) |
void | BAT_enableBackupSupplyToADC (unsigned int baseAddress) |
void | BAT_disableBackupSupplyToADC (unsigned int baseAddress) |
void | BAT_manuallySwitchToBackupSupply (unsigned int baseAddress) |
void | BAT_disable (unsigned int baseAddress) |
void | BAT_chargerInitAndEnable (unsigned int baseAddress, unsigned char chargerEndVoltage, unsigned char chargeCurrent) |
void | BAT_disableCharger (unsigned int baseAddress) |
void | BAT_setBackupRAMData (unsigned int baseAddress, unsigned char backupRAMSelect, unsigned int data) |
unsigned int | BAT_getBackupRAMData (unsigned int baseAddress, unsigned char backupRAMSelect) |
unsigned short BAT_unlockBackupSubSystem | ( | unsigned int | baseAddress | ) |
Unlocks any pending backup input pins and RTC_B interrupts to be serviced.
baseAddress | is the base address of the BAT module. |
This function unlocks the ability to view and service any pending backup input pin interrupts, as well as pending RTC_B interrupts. The backup sub-system can only be unlocked when the backup domain has settled, so this function returns the status of the unlock bit after it has been to be verified by user code. Please note, the backup sub-system should only be unlocked after modifying the RTC_B registers.
References BAT_UNLOCKFAILURE, BAT_UNLOCKSUCCESS, and HWREGB.
void BAT_enableBackupSupplyToADC | ( | unsigned int | baseAddress | ) |
Enables the backup supply to be measured by the ADC battery monitor input.
baseAddress | is the base address of the BAT module. |
This function enables the backup supply signal to be monitored by the ADC battery supply monitor input, to allow a measurement of the voltage from the backup battery.
References HWREGB.
void BAT_disableBackupSupplyToADC | ( | unsigned int | baseAddress | ) |
Disables the backup supply input to the ADC module.
baseAddress | is the base address of the BAT module. |
This function disables the ability to monitor the backup supply voltage from the ADC battery monitor input.
References HWREGB.
void BAT_manuallySwitchToBackupSupply | ( | unsigned int | baseAddress | ) |
Manually switches to backup supply.
baseAddress | is the base address of the BAT module. |
This function uses software to manually switch to the backup battery supply. Once this bit is set, it will be automatically reset by a POR and the system returns to an automatic switch to backup supply.
References HWREGB.
void BAT_disable | ( | unsigned int | baseAddress | ) |
Disables backup battery system.
baseAddress | is the base address of the BAT module. |
This function disables the battery backup system from being used. The battery backup system is reenabled after a power cycle.
References HWREGB.
void BAT_chargerInitAndEnable | ( | unsigned int | baseAddress, |
unsigned char | chargerEndVoltage, | ||
unsigned char | chargeCurrent | ||
) |
Initializes and enables the backup battery charger.
baseAddress | is the base address of the BAT module. |
chargerEndVoltage | is the maximum voltage to charge the backup battery to. Valid values are BAT_CHARGERENDVOLTAGE_VCC - charges backup battery up to Vcc BAT_CHARGERENDVOLTAGE2_7V - charges backup battery up to 2.7V OR up to Vcc if Vcc is less than 2.7V. Modified bits are BAKCHVx of BAKCHCTL register. |
chargeCurrent | is the maximum current to charge the backup battery at. Valid values are BAT_CHARGECURRENT_5KOHM BAT_CHARGECURRENT_10KOHM BAT_CHARGECURRENT_20KOHM Modified bits are BAKCHCx of BAKCHCTL register. |
This function initializes the backup battery charger with the selected settings.
References HWREG.
void BAT_disableCharger | ( | unsigned int | baseAddress | ) |
Disables and resets backup battery charger settings.
baseAddress | is the base address of the BAT module. |
This function clears all backup battery charger settings and disabes it. To renable the charger, a call to BAT_chargerInitAndEnable() is required.
References HWREG.
void BAT_setBackupRAMData | ( | unsigned int | baseAddress, |
unsigned char | backupRAMSelect, | ||
unsigned int | data | ||
) |
Sets data into the selected backup RAM space.
baseAddress | is the base address of the BAT module. |
backupRAMSelect | is the backup RAM space to set data into. Valid values are BAT_RAMSELECT_0 BAT_RAMSELECT_1 BAT_RAMSELECT_2 BAT_RAMSELECT_3 |
data | is the data to set into the selected backup RAM space. |
This function sets the given 16-bit data into the selected backup RAM space.
References HWREG.
unsigned int BAT_getBackupRAMData | ( | unsigned int | baseAddress, |
unsigned char | backupRAMSelect | ||
) |
Returns the data from the selected backup RAM space.
baseAddress | is the base address of the BAT module. |
backupRAMSelect | is the backup RAM space to read out from. Valid values are BAT_RAMSELECT_0 BAT_RAMSELECT_1 BAT_RAMSELECT_2 BAT_RAMSELECT_3 |
This function returns the 16-bit data currently residing in the selected backup RAM space.
References HWREG.