RTEMS 6.1-rc1
fsl_tempsensor.h
Go to the documentation of this file.
1/*
2 * Copyright 2020-2022 NXP
3 * All rights reserved.
4 *
5 *
6 * SPDX-License-Identifier: BSD-3-Clause
7 */
8#ifndef _FSL_TEMPMON_H_
9#define _FSL_TEMPMON_H_
10
11#include "fsl_common.h"
12
20/*******************************************************************************
21 * Definitions
22 ******************************************************************************/
23
26#define FSL_TMPSNS_DRIVER_VERSION (MAKE_VERSION(2, 1, 0))
30enum
31{
33 TMPSNS_CTRL1_HIGH_TEMP_IE_MASK,
35 TMPSNS_CTRL1_LOW_TEMP_IE_MASK,
37 TMPSNS_CTRL1_PANIC_TEMP_IE_MASK,
38 kTEMPSENSOR_FinishInterruptStatusEnable = TMPSNS_CTRL1_FINISH_IE_MASK,
39};
40
42enum
43{
44 kTEMPSENSOR_HighTempInterruptStatus = TMPSNS_STATUS0_HIGH_TEMP_MASK,
45 kTEMPSENSOR_LowTempInterruptStatus = TMPSNS_STATUS0_LOW_TEMP_MASK,
46 kTEMPSENSOR_PanicTempInterruptStatus = TMPSNS_STATUS0_PANIC_TEMP_MASK,
47};
48
50typedef enum
51{
55
57typedef struct _tmpsns_config
58{
60 uint16_t frequency;
61 int32_t highAlarmTemp;
63 int32_t lowAlarmTemp;
65
68{
73
74/*******************************************************************************
75 * API
76 ******************************************************************************/
77
78#if defined(__cplusplus)
79extern "C" {
80#endif
81
89
95void TMPSNS_Deinit(TMPSNS_Type *base);
96
110
117
124
132
140void TMPSNS_SetTempAlarm(TMPSNS_Type *base, int32_t tempVal, tmpsns_alarm_mode_t alarmMode);
141
148void TMPSNS_EnableInterrupt(TMPSNS_Type *base, uint32_t mask);
149
156void TMPSNS_DisableInterrupt(TMPSNS_Type *base, uint32_t mask);
157
164static inline uint32_t TMPSNS_GetInterruptFlags(TMPSNS_Type *base)
165{
166 return base->STATUS0;
167}
168
175static inline void TMPSNS_ClearInterruptFlags(TMPSNS_Type *base, uint32_t mask)
176{
177 base->STATUS0 = mask;
178}
179
180#if defined(__cplusplus)
181}
182#endif
183
186#endif /* _FSL_TEMPMON_H_ */
float TMPSNS_GetCurrentTemperature(TMPSNS_Type *base)
Get current temperature with the fused temperature calibration data.
Definition: fsl_tempsensor.c:227
void TMPSNS_StopMeasure(TMPSNS_Type *base)
stop the measurement process.
Definition: fsl_tempsensor.c:208
enum _tmpsns_alarm_mode tmpsns_alarm_mode_t
TMPSNS alarm mode.
_tmpsns_alarm_mode
TMPSNS alarm mode.
Definition: fsl_tempsensor.h:68
void TMPSNS_GetDefaultConfig(tmpsns_config_t *config)
Gets the default configuration structure.
Definition: fsl_tempsensor.c:166
tmpsns_measure_mode_t measureMode
Definition: fsl_tempsensor.h:59
int32_t panicAlarmTemp
Definition: fsl_tempsensor.h:62
tmpsns_measure_mode_t
TMPSNS measure mode, tempsensor_measure_mode.
Definition: fsl_tempsensor.h:51
void TMPSNS_DisableInterrupt(TMPSNS_Type *base, uint32_t mask)
Disable interrupt status.
Definition: fsl_tempsensor.c:359
void TMPSNS_StartMeasure(TMPSNS_Type *base)
start the temperature measurement process.
Definition: fsl_tempsensor.c:190
void TMPSNS_SetTempAlarm(TMPSNS_Type *base, int32_t tempVal, tmpsns_alarm_mode_t alarmMode)
Set the temperature count (raw sensor output) that will generate an alarm interrupt.
Definition: fsl_tempsensor.c:274
struct _tmpsns_config tmpsns_config_t
TMPSNS temperature structure.
void TMPSNS_Deinit(TMPSNS_Type *base)
Deinitializes the TMPSNS module.
Definition: fsl_tempsensor.c:103
void TMPSNS_EnableInterrupt(TMPSNS_Type *base, uint32_t mask)
Enable interrupt status.
Definition: fsl_tempsensor.c:342
uint16_t frequency
Definition: fsl_tempsensor.h:60
void TMPSNS_Init(TMPSNS_Type *base, const tmpsns_config_t *config)
Initializes the TMPSNS module.
Definition: fsl_tempsensor.c:48
int32_t highAlarmTemp
Definition: fsl_tempsensor.h:61
int32_t lowAlarmTemp
Definition: fsl_tempsensor.h:63
@ kTEMPMON_LowAlarmMode
Definition: fsl_tempsensor.h:71
@ kTEMPMON_PanicAlarmMode
Definition: fsl_tempsensor.h:70
@ kTEMPMON_HighAlarmMode
Definition: fsl_tempsensor.h:69
@ kTEMPSENSOR_SingleMode
Definition: fsl_tempsensor.h:52
@ kTEMPSENSOR_ContinuousMode
Definition: fsl_tempsensor.h:53
@ kTEMPSENSOR_PanicTempInterruptStatusEnable
Definition: fsl_tempsensor.h:36
@ kTEMPSENSOR_FinishInterruptStatusEnable
Definition: fsl_tempsensor.h:38
@ kTEMPSENSOR_LowTempInterruptStatusEnable
Definition: fsl_tempsensor.h:34
@ kTEMPSENSOR_HighTempInterruptStatusEnable
Definition: fsl_tempsensor.h:32
@ kTEMPSENSOR_PanicTempInterruptStatus
Definition: fsl_tempsensor.h:46
@ kTEMPSENSOR_HighTempInterruptStatus
Definition: fsl_tempsensor.h:44
@ kTEMPSENSOR_LowTempInterruptStatus
Definition: fsl_tempsensor.h:45
Definition: MIMXRT1166_cm4.h:81676
TMPSNS temperature structure.
Definition: fsl_tempsensor.h:58
Definition: deflate.c:114