Tiva Driver Lib
|
Macros | |
#define | DELAY_USECS 95 |
#define | LOOP_CYCLES 3 |
Functions | |
void | HibernateEnableExpClk (uint32_t ui32HibClk) |
void | HibernateDisable (void) |
void | HibernateClockConfig (uint32_t ui32Config) |
void | HibernateRTCEnable (void) |
void | HibernateRTCDisable (void) |
void | HibernateBatCheckStart (void) |
uint32_t | HibernateBatCheckDone (void) |
void | HibernateWakeSet (uint32_t ui32WakeFlags) |
uint32_t | HibernateWakeGet (void) |
void | HibernateLowBatSet (uint32_t ui32LowBatFlags) |
uint32_t | HibernateLowBatGet (void) |
void | HibernateRTCSet (uint32_t ui32RTCValue) |
uint32_t | HibernateRTCGet (void) |
void | HibernateRTCMatchSet (uint32_t ui32Match, uint32_t ui32Value) |
uint32_t | HibernateRTCMatchGet (uint32_t ui32Match) |
void | HibernateRTCSSMatchSet (uint32_t ui32Match, uint32_t ui32Value) |
uint32_t | HibernateRTCSSMatchGet (uint32_t ui32Match) |
uint32_t | HibernateRTCSSGet (void) |
void | HibernateRTCTrimSet (uint32_t ui32Trim) |
uint32_t | HibernateRTCTrimGet (void) |
void | HibernateDataSet (uint32_t *pui32Data, uint32_t ui32Count) |
void | HibernateDataGet (uint32_t *pui32Data, uint32_t ui32Count) |
void | HibernateRequest (void) |
void | HibernateIntEnable (uint32_t ui32IntFlags) |
void | HibernateIntDisable (uint32_t ui32IntFlags) |
void | HibernateIntRegister (void(*pfnHandler)(void)) |
void | HibernateIntUnregister (void) |
uint32_t | HibernateIntStatus (bool bMasked) |
void | HibernateIntClear (uint32_t ui32IntFlags) |
uint32_t | HibernateIsActive (void) |
void | HibernateGPIORetentionEnable (void) |
void | HibernateGPIORetentionDisable (void) |
bool | HibernateGPIORetentionGet (void) |
uint32_t HibernateBatCheckDone | ( | void | ) |
Returns if a forced battery check has completed.
This function returns if the forced battery check initiated by a call to the HibernateBatCheckStart() function has completed. This function returns a non-zero value until the battery level check has completed. Once this function returns a value of zero, the hibernation module has completed the battery check and the HibernateIntStatus() function can be used to check if the battery was low by checking if the value returned has the HIBERNATE_INT_LOW_BAT set.
void HibernateBatCheckStart | ( | void | ) |
Forces the Hibernation module to initiate a check of the battery voltage.
This function forces the Hibernation module to initiate a check of the battery voltage immediately rather than waiting for the next check interval to pass. After calling this function, the application should call the HibernateBatCheckDone() function and wait for the function to return a zero value before calling the HibernateIntStatus() to check if the return code has the HIBERNATE_INT_LOW_BAT set. If HIBERNATE_INT_LOW_BAT is set, the battery level is low. The application can also enable the HIBERNATE_INT_LOW_BAT interrupt and wait for an interrupt to indicate that the battery level is low.
void HibernateClockConfig | ( | uint32_t | ui32Config | ) |
Configures the clock input for the Hibernation module.
ui32Config | is one of the possible configuration options for the clock input listed below. |
This function is used to configure the clock input for the Hibernation module. The ui32Config parameter can be one of the following values:
The HIBERNATE_OSC_DISABLE option is used to disable and power down the internal oscillator if an external clock source or no clock source is used instead of a 32.768-kHz crystal. In the case where an external crystal is used, either the HIBERNATE_OSC_HIGHDRIVE or HIBERNATE_OSC_LOWDRIVE is used. These settings optimizes the oscillator drive strength to match the size of the filter capacitor that is used with the external crystal circuit.
void HibernateDataGet | ( | uint32_t * | pui32Data, |
uint32_t | ui32Count | ||
) |
Reads a set of data from the battery-backed memory of the Hibernation module.
pui32Data | points to a location where the data that is read from the Hibernation module is stored. |
ui32Count | is the count of 32-bit words to read. |
This function retrieves a set of data from the Hibernation module battery-backed memory that was previously stored with the HibernateDataSet() function. The caller must ensure that pui32Data points to a large enough memory block to hold all the data that is read from the battery-backed memory.
void HibernateDataSet | ( | uint32_t * | pui32Data, |
uint32_t | ui32Count | ||
) |
Stores data in the battery-backed memory of the Hibernation module.
pui32Data | points to the data that the caller wants to store in the memory of the Hibernation module. |
ui32Count | is the count of 32-bit words to store. |
Stores a set of data in the Hibernation module battery-backed memory. This memory is preserved when the power to the processor is turned off and can be used to store application state information that is needed when the processor wakes. Up to 16 32-bit words can be stored in the battery-backed memory. The data can be restored by calling the HibernateDataGet() function.
void HibernateDisable | ( | void | ) |
Disables the Hibernation module for operation.
This function disables the Hibernation module. After this function is called, none of the Hibernation module features are available.
void HibernateEnableExpClk | ( | uint32_t | ui32HibClk | ) |
Enables the Hibernation module for operation.
ui32HibClk | is the rate of the clock supplied to the Hibernation module. |
This function enables the Hibernation module for operation. This function should be called before any of the Hibernation module features are used.
The peripheral clock is the same as the processor clock. This value is returned by SysCtlClockGet(), or it can be explicitly hard-coded if it is constant and known (to save the code/execution overhead of a call to SysCtlClockGet()).
void HibernateGPIORetentionDisable | ( | void | ) |
Disables GPIO retention after wake from hibernation.
This function disables the retention of the GPIO pin state during hibernation and allows the GPIO pins to be controlled by the system. If the HibernateGPIORetentionEnable() function is called before entering hibernation, this function must be called after returning from hibernation to allow the GPIO pins to be controlled by GPIO module.
void HibernateGPIORetentionEnable | ( | void | ) |
Enables GPIO retention after wake from hibernation.
This function enables the GPIO pin state to be maintained during hibernation and remain active even when waking from hibernation. The GPIO module itself is reset upon entering hibernation and no longer controls the output pins. To maintain the current output level after waking from hibernation, the GPIO module must be reconfigured and then the HibernateGPIORetentionDisable() function must be called to return control of the GPIO pin to the GPIO module.
bool HibernateGPIORetentionGet | ( | void | ) |
Returns the current setting for GPIO retention.
This function returns the current setting for GPIO retention in the hibernate module.
void HibernateIntClear | ( | uint32_t | ui32IntFlags | ) |
Clears pending interrupts from the Hibernation module.
ui32IntFlags | is the bit mask of the interrupts to be cleared. |
This function clears the specified interrupt sources. This function must be called within the interrupt handler or else the handler is called again upon exit.
The ui32IntFlags parameter has the same definition as the ui32IntFlags parameter to the HibernateIntEnable() function.
void HibernateIntDisable | ( | uint32_t | ui32IntFlags | ) |
Disables interrupts for the Hibernation module.
ui32IntFlags | is the bit mask of the interrupts to be disabled. |
This function disables the specified interrupt sources from the Hibernation module.
The ui32IntFlags parameter has the same definition as the ui32IntFlags parameter to the HibernateIntEnable() function.
void HibernateIntEnable | ( | uint32_t | ui32IntFlags | ) |
Enables interrupts for the Hibernation module.
ui32IntFlags | is the bit mask of the interrupts to be enabled. |
This function enables the specified interrupt sources from the Hibernation module.
The ui32IntFlags parameter must be the logical OR of any combination of the following:
void HibernateIntRegister | ( | void(*)(void) | pfnHandler | ) |
Registers an interrupt handler for the Hibernation module interrupt.
pfnHandler | points to the function to be called when a hibernation interrupt occurs. |
This function registers the interrupt handler in the system interrupt controller. The interrupt is enabled at the global level, but individual interrupt sources must still be enabled with a call to HibernateIntEnable().
uint32_t HibernateIntStatus | ( | bool | bMasked | ) |
Gets the current interrupt status of the Hibernation module.
bMasked | is false to retrieve the raw interrupt status, and true to retrieve the masked interrupt status. |
This function returns the interrupt status of the Hibernation module. The caller can use this function to determine the cause of a hibernation interrupt. Either the masked or raw interrupt status can be returned.
void HibernateIntUnregister | ( | void | ) |
Unregisters an interrupt handler for the Hibernation module interrupt.
This function unregisters the interrupt handler in the system interrupt controller. The interrupt is disabled at the global level, and the interrupt handler is no longer called.
uint32_t HibernateIsActive | ( | void | ) |
Checks to see if the Hibernation module is already powered up.
This function queries the control register to determine if the module is already active. This function can be called at a power-on reset to help determine if the reset is due to a wake from hibernation or a cold start. If the Hibernation module is already active, then it does not need to be re-enabled, and its status can be queried immediately.
The software application should also use the HibernateIntStatus() function to read the raw interrupt status to determine the cause of the wake. The HibernateDataGet() function can be used to restore state. These combinations of functions can be used by the software to determine if the processor is waking from hibernation and the appropriate action to take as a result.
uint32_t HibernateLowBatGet | ( | void | ) |
Gets the currently configured low-battery detection behavior.
This function returns a value representing the currently configured low battery detection behavior.
The return value is a combination of the values described in the HibernateLowBatSet() function.
void HibernateLowBatSet | ( | uint32_t | ui32LowBatFlags | ) |
Configures the low-battery detection.
ui32LowBatFlags | specifies behavior of low-battery detection. |
This function enables the low-battery detection and whether hibernation is allowed if a low battery is detected. If low-battery detection is enabled, then a low-battery condition is indicated in the raw interrupt status register, which can be enabled to trigger an interrupt. Optionally, hibernation can be aborted if a low battery condition is detected.
The ui32LowBatFlags parameter is one of the following values:
The other setting in the ui32LowBatFlags allows the caller to set one of the following voltage level trigger values :
Example: Abort hibernate if the voltage level is below 2.1 V.
//! HibernateLowBatSet(HIBERNATE_LOW_BAT_ABORT | HIBERNATE_LOW_BAT_2_1V); //!
\return None.
void HibernateRequest | ( | void | ) |
Requests hibernation mode.
This function requests the Hibernation module to disable the external regulator, thus removing power from the processor and all peripherals. The Hibernation module remains powered from the battery or auxiliary power supply.
The Hibernation module re-enables the external regulator when one of the configured wake conditions occurs (such as RTC match or external WAKE pin). When the power is restored, the processor goes through a power-on reset although the Hibernation module is not reset. The processor can retrieve saved state information with the HibernateDataGet() function. Prior to calling the function to request hibernation mode, the conditions for waking must have already been set by using the HibernateWakeSet() function.
Note that this function may return because some time may elapse before the power is actually removed, or it may not be removed at all. For this reason, the processor continues to execute instructions for some time, and the caller should be prepared for this function to return. There are various reasons why the power may not be removed. For example, if the HibernateLowBatSet() function was used to configure an abort if low battery is detected, then the power is not removed if the battery voltage is too low. There may be other reasons related to the external circuit design, that a request for hibernation may not actually occur.
For all these reasons, the caller must be prepared for this function to return. The simplest way to handle it is to just enter an infinite loop and wait for the power to be removed.
void HibernateRTCDisable | ( | void | ) |
Disables the RTC feature of the Hibernation module.
This function disables the RTC in the Hibernation module. After calling this function, the RTC features of the Hibernation module are not available.
void HibernateRTCEnable | ( | void | ) |
Enables the RTC feature of the Hibernation module.
This function enables the RTC in the Hibernation module. The RTC can be used to wake the processor from hibernation at a certain time, or to generate interrupts at certain times. This function must be called before using any of the RTC features of the Hibernation module.
uint32_t HibernateRTCGet | ( | void | ) |
Gets the value of the real time clock (RTC) counter.
This function gets the value of the RTC and returns it to the caller.
uint32_t HibernateRTCMatchGet | ( | uint32_t | ui32Match | ) |
Gets the value of the requested RTC match register.
ui32Match | is the index of the match register. |
This function gets the value of the match register for the RTC. The only value that can be used with the ui32Match parameter is zero, other values are reserved for future use.
void HibernateRTCMatchSet | ( | uint32_t | ui32Match, |
uint32_t | ui32Value | ||
) |
Sets the value of the RTC match register.
ui32Match | is the index of the match register. |
ui32Value | is the value for the match register. |
This function sets a match register for the RTC. The Hibernation module can be configured to wake from hibernation, and/or generate an interrupt when the value of the RTC counter is the same as the match register.
void HibernateRTCSet | ( | uint32_t | ui32RTCValue | ) |
Sets the value of the real time clock (RTC) counter.
ui32RTCValue | is the new value for the RTC. |
This function sets the value of the RTC. The RTC counter contains the count in seconds when a 32.768kHz clock source is in use. The RTC must be enabled by calling HibernateRTCEnable() before calling this function.
uint32_t HibernateRTCSSGet | ( | void | ) |
Returns the current value of the RTC sub second count.
This function returns the current value of the sub second count for the RTC in 1/32768 of a second increments. The only value that can be used with the ui32Match parameter is zero, other values are reserved for future use.
uint32_t HibernateRTCSSMatchGet | ( | uint32_t | ui32Match | ) |
Returns the value of the requested RTC sub second match register.
ui32Match | is the index of the match register. |
This function returns the current value of the sub second match register for the RTC. The value returned is in 1/32768 second increments. The only value that can be used with the ui32Match parameter is zero, other values are reserved for future use.
void HibernateRTCSSMatchSet | ( | uint32_t | ui32Match, |
uint32_t | ui32Value | ||
) |
Sets the value of the RTC sub second match register.
ui32Match | is the index of the match register. |
ui32Value | is the value for the sub second match register. |
This function sets the sub second match register for the RTC in 1/32768 of a second increments. The Hibernation module can be configured to wake from hibernation, and/or generate an interrupt when the value of the RTC counter is the same as the match combined with the sub second match register. The only value that can be used with the ui32Match parameter is zero, other values are reserved for future use.
uint32_t HibernateRTCTrimGet | ( | void | ) |
Gets the value of the RTC pre-divider trim register.
This function gets the value of the pre-divider trim register. This function can be used to get the current value of the trim register prior to making an adjustment by using the HibernateRTCTrimSet() function.
void HibernateRTCTrimSet | ( | uint32_t | ui32Trim | ) |
Sets the value of the RTC pre-divider trim register.
ui32Trim | is the new value for the pre-divider trim register. |
This function sets the value of the pre-divider trim register. The input time source is divided by the pre-divider to achieve a one-second clock rate. Once every 64 seconds, the value of the pre-divider trim register is applied to the pre-divider to allow fine-tuning of the RTC rate, in order to make corrections to the rate. The software application can make adjustments to the pre-divider trim register to account for variations in the accuracy of the input time source. The nominal value is 0x7FFF, and it can be adjusted up or down in order to fine-tune the RTC rate.
uint32_t HibernateWakeGet | ( | void | ) |
Gets the currently configured wake conditions for the Hibernation module.
This function returns the flags representing the wake configuration for the Hibernation module. The return value is a combination of the following flags:
void HibernateWakeSet | ( | uint32_t | ui32WakeFlags | ) |
Configures the wake conditions for the Hibernation module.
ui32WakeFlags | specifies which conditions should be used for waking. |
This function enables the conditions under which the Hibernation module wakes. The ui32WakeFlags parameter is the logical OR of any combination of the following: