EFM32 Happy Gecko Software Documentation  efm32hg-doc-5.1.2
util.h
Go to the documentation of this file.
1 /***************************************************************************/
16 #ifndef __UTIL_H_
17 #define __UTIL_H_
18 
19 #include <stdint.h>
20 #include <stdbool.h>
21 
22 /***************************************************************************/
27 /***************************************************************************/
33 #define UTIL_SUPPLY_TYPE_UNKNOWN 0
34 #define UTIL_SUPPLY_TYPE_USB 1
35 #define UTIL_SUPPLY_TYPE_AA 2
36 #define UTIL_SUPPLY_TYPE_AAA 3
37 #define UTIL_SUPPLY_TYPE_CR2032 4
41 /***************************************************************************/
46 uint32_t UTIL_init ( void );
47 void UTIL_delay ( uint32_t ms );
48 void UTIL_shutdown ( void );
49 
50 uint32_t UTIL_sleepInit ( void );
51 void UTIL_sleep ( uint32_t ms );
52 uint32_t UTIL_waitForEvent( uint32_t timeout );
53 
54 void UTIL_supplyProbe ( void );
55 void UTIL_supplyGetCharacteristics ( uint8_t *type, float *voltage, float *ir );
56 uint8_t UTIL_supplyGetType ( void );
57 bool UTIL_isLowPower ( void );
58 
63 #endif /* __UTIL_H_ */
uint32_t UTIL_sleepInit(void)
Sets up the RTC timer used for sleep functions.
Definition: util_sleep.c:53
uint8_t UTIL_supplyGetType(void)
Returns the type of the power supply.
Definition: util_supply.c:291
bool UTIL_isLowPower(void)
Checks if the current power supply has low power capability.
Definition: util_supply.c:305
void UTIL_delay(uint32_t ms)
Delays number of msTick Systicks (1 ms)
Definition: util.c:97
uint32_t UTIL_waitForEvent(uint32_t timeout)
Delays number of milliseconds in sleep mode (EM2) using the RTC but but returns if an event wakes up ...
Definition: util_sleep.c:100
void UTIL_supplyGetCharacteristics(uint8_t *type, float *voltage, float *ir)
Retrieves the supply characteristic variables.
Definition: util_supply.c:273
void UTIL_supplyProbe(void)
Probes the connected supply and determines its type. The results are stored in global variables...
Definition: util_supply.c:224
void UTIL_sleep(uint32_t ms)
Delays number of milliseconds in sleep mode (EM2) using the RTC.
Definition: util_sleep.c:78
void UTIL_shutdown(void)
Enter lowest power shutdown mode, EM4S.
Definition: util.c:118