EFM32 Wonder Gecko Software Documentation  efm32wg-doc-5.1.2
tempdrv.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef __SILICON_LABS_TEMPDRV_H__
34 #define __SILICON_LABS_TEMPDRV_H__
35 
36 #include "em_device.h"
37 #include "em_emu.h"
38 #include "ecode.h"
39 #include "tempdrv_config.h"
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 /***************************************************************************/
50 /***************************************************************************/
55 #define ECODE_EMDRV_TEMPDRV_OK (ECODE_OK)
56 #define ECODE_EMDRV_TEMPDRV_NO_INIT (ECODE_EMDRV_TEMPDRV_BASE | 0x00000001)
57 #define ECODE_EMDRV_TEMPDRV_PARAM_ERROR (ECODE_EMDRV_TEMPDRV_BASE | 0x00000002)
58 #define ECODE_EMDRV_TEMPDRV_BAD_LIMIT (ECODE_EMDRV_TEMPDRV_BASE | 0x00000003)
59 #define ECODE_EMDRV_TEMPDRV_NO_CALLBACK (ECODE_EMDRV_TEMPDRV_BASE | 0x00000004)
60 #define ECODE_EMDRV_TEMPDRV_NO_SPACE (ECODE_EMDRV_TEMPDRV_BASE | 0x00000005)
61 #define ECODE_EMDRV_TEMPDRV_TEMP_UNDER (ECODE_EMDRV_TEMPDRV_BASE | 0x00000006)
62 #define ECODE_EMDRV_TEMPDRV_TEMP_OVER (ECODE_EMDRV_TEMPDRV_BASE | 0x00000007)
63 #define ECODE_EMDRV_TEMPDRV_DUP_TEMP (ECODE_EMDRV_TEMPDRV_BASE | 0x00000008)
64 
65 
69 typedef enum TEMPDRV_LimitType{
73 
74 /***************************************************************************/
91 typedef void (*TEMPDRV_Callback_t)(int8_t temp, TEMPDRV_LimitType_t limit);
92 
93 /***************************************************************************/
102 void TEMPDRV_IRQHandler(void);
103 
104 Ecode_t TEMPDRV_Init(void);
105 
106 Ecode_t TEMPDRV_DeInit(void);
107 
108 Ecode_t TEMPDRV_Enable(bool enable);
109 
111 
112 int8_t TEMPDRV_GetTemp(void);
113 
114 Ecode_t TEMPDRV_RegisterCallback(int8_t temp,
115  TEMPDRV_LimitType_t limit,
116  TEMPDRV_Callback_t callback);
117 
119 
123 #ifdef __cplusplus
124 }
125 #endif
126 #endif // __SILICON_LABS_TEMPDRV_H__
Energy Aware drivers error code definitions.
void(* TEMPDRV_Callback_t)(int8_t temp, TEMPDRV_LimitType_t limit)
TEMPDRV temperature limit callback function.
Definition: tempdrv.h:91
int8_t TEMPDRV_GetTemp(void)
Get the current temperature.
Definition: tempdrv.c:683
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.
Ecode_t TEMPDRV_DeInit(void)
De-initialize the TEMP driver.
Definition: tempdrv.c:597
void TEMPDRV_IRQHandler(void)
TEMPDRV IRQ Handler.
Definition: tempdrv.c:108
uint32_t Ecode_t
Typedef for API function error code return values.
Definition: ecode.h:51
TEMPDRV_LimitType
Definition: tempdrv.h:69
uint8_t TEMPDRV_GetActiveCallbacks(TEMPDRV_LimitType_t limit)
Get the number of active callbacks for a limit.
Definition: tempdrv.c:645
Ecode_t TEMPDRV_UnregisterCallback(TEMPDRV_Callback_t callback)
Unregister a callback in the TEMP driver.
Definition: tempdrv.c:813
Ecode_t TEMPDRV_Enable(bool enable)
Enable or disable the TEMP driver.
Definition: tempdrv.c:618
Energy management unit (EMU) peripheral API.
enum TEMPDRV_LimitType TEMPDRV_LimitType_t
Ecode_t TEMPDRV_RegisterCallback(int8_t temp, TEMPDRV_LimitType_t limit, TEMPDRV_Callback_t callback)
Register a callback in the TEMP driver.
Definition: tempdrv.c:750
Ecode_t TEMPDRV_Init(void)
Initialize the TEMP driver.
Definition: tempdrv.c:547