1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
#![allow(non_snake_case, non_upper_case_globals)]
#![allow(non_camel_case_types)]
//! Temperature Monitor
//!
//! Used by: imxrt1061, imxrt1062, imxrt1064
use crate::RWRegister;
#[cfg(not(feature = "nosync"))]
use core::marker::PhantomData;
/// Tempsensor Control Register 0
pub mod TEMPSENSE0 {
/// This bit powers down the temperature sensor.
pub mod POWER_DOWN {
/// Offset (0 bits)
pub const offset: u32 = 0;
/// Mask (1 bit: 1 << 0)
pub const mask: u32 = 1 << offset;
/// Read-only values (empty)
pub mod R {}
/// Write-only values (empty)
pub mod W {}
/// Read-write values
pub mod RW {
/// 0b0: Enable power to the temperature sensor.
pub const POWER_UP: u32 = 0b0;
/// 0b1: Power down the temperature sensor.
pub const POWER_DOWN: u32 = 0b1;
}
}
/// Starts the measurement process
pub mod MEASURE_TEMP {
/// Offset (1 bits)
pub const offset: u32 = 1;
/// Mask (1 bit: 1 << 1)
pub const mask: u32 = 1 << offset;
/// Read-only values (empty)
pub mod R {}
/// Write-only values (empty)
pub mod W {}
/// Read-write values
pub mod RW {
/// 0b0: Do not start the measurement process.
pub const STOP: u32 = 0b0;
/// 0b1: Start the measurement process.
pub const START: u32 = 0b1;
}
}
/// Indicates that the latest temp is valid
pub mod FINISHED {
/// Offset (2 bits)
pub const offset: u32 = 2;
/// Mask (1 bit: 1 << 2)
pub const mask: u32 = 1 << offset;
/// Read-only values (empty)
pub mod R {}
/// Write-only values (empty)
pub mod W {}
/// Read-write values
pub mod RW {
/// 0b0: Last measurement is not ready yet.
pub const INVALID: u32 = 0b0;
/// 0b1: Last measurement is valid.
pub const VALID: u32 = 0b1;
}
}
/// This bit field contains the last measured temperature count.
pub mod TEMP_CNT {
/// Offset (8 bits)
pub const offset: u32 = 8;
/// Mask (12 bits: 0xfff << 8)
pub const mask: u32 = 0xfff << offset;
/// Read-only values (empty)
pub mod R {}
/// Write-only values (empty)
pub mod W {}
/// Read-write values (empty)
pub mod RW {}
}
/// This bit field contains the temperature count (raw sensor output) that will generate a high alarm when TEMP_CNT is smaller than this field
pub mod ALARM_VALUE {
/// Offset (20 bits)
pub const offset: u32 = 20;
/// Mask (12 bits: 0xfff << 20)
pub const mask: u32 = 0xfff << offset;
/// Read-only values (empty)
pub mod R {}
/// Write-only values (empty)
pub mod W {}
/// Read-write values (empty)
pub mod RW {}
}
}
/// Tempsensor Control Register 0
pub mod TEMPSENSE0_SET {
pub use super::TEMPSENSE0::ALARM_VALUE;
pub use super::TEMPSENSE0::FINISHED;
pub use super::TEMPSENSE0::MEASURE_TEMP;
pub use super::TEMPSENSE0::POWER_DOWN;
pub use super::TEMPSENSE0::TEMP_CNT;
}
/// Tempsensor Control Register 0
pub mod TEMPSENSE0_CLR {
pub use super::TEMPSENSE0::ALARM_VALUE;
pub use super::TEMPSENSE0::FINISHED;
pub use super::TEMPSENSE0::MEASURE_TEMP;
pub use super::TEMPSENSE0::POWER_DOWN;
pub use super::TEMPSENSE0::TEMP_CNT;
}
/// Tempsensor Control Register 0
pub mod TEMPSENSE0_TOG {
pub use super::TEMPSENSE0::ALARM_VALUE;
pub use super::TEMPSENSE0::FINISHED;
pub use super::TEMPSENSE0::MEASURE_TEMP;
pub use super::TEMPSENSE0::POWER_DOWN;
pub use super::TEMPSENSE0::TEMP_CNT;
}
/// Tempsensor Control Register 1
pub mod TEMPSENSE1 {
/// This bits determines how many RTC clocks to wait before automatically repeating a temperature measurement
pub mod MEASURE_FREQ {
/// Offset (0 bits)
pub const offset: u32 = 0;
/// Mask (16 bits: 0xffff << 0)
pub const mask: u32 = 0xffff << offset;
/// Read-only values (empty)
pub mod R {}
/// Write-only values (empty)
pub mod W {}
/// Read-write values (empty)
pub mod RW {}
}
}
/// Tempsensor Control Register 1
pub mod TEMPSENSE1_SET {
pub use super::TEMPSENSE1::MEASURE_FREQ;
}
/// Tempsensor Control Register 1
pub mod TEMPSENSE1_CLR {
pub use super::TEMPSENSE1::MEASURE_FREQ;
}
/// Tempsensor Control Register 1
pub mod TEMPSENSE1_TOG {
pub use super::TEMPSENSE1::MEASURE_FREQ;
}
/// Tempsensor Control Register 2
pub mod TEMPSENSE2 {
/// This bit field contains the temperature count that will generate a low alarm interrupt when the field is exceeded by TEMP_CNT
pub mod LOW_ALARM_VALUE {
/// Offset (0 bits)
pub const offset: u32 = 0;
/// Mask (12 bits: 0xfff << 0)
pub const mask: u32 = 0xfff << offset;
/// Read-only values (empty)
pub mod R {}
/// Write-only values (empty)
pub mod W {}
/// Read-write values (empty)
pub mod RW {}
}
/// This bit field contains the temperature count that will generate a panic interrupt when TEMP_CNT is smaller than this field
pub mod PANIC_ALARM_VALUE {
/// Offset (16 bits)
pub const offset: u32 = 16;
/// Mask (12 bits: 0xfff << 16)
pub const mask: u32 = 0xfff << offset;
/// Read-only values (empty)
pub mod R {}
/// Write-only values (empty)
pub mod W {}
/// Read-write values (empty)
pub mod RW {}
}
}
/// Tempsensor Control Register 2
pub mod TEMPSENSE2_SET {
pub use super::TEMPSENSE2::LOW_ALARM_VALUE;
pub use super::TEMPSENSE2::PANIC_ALARM_VALUE;
}
/// Tempsensor Control Register 2
pub mod TEMPSENSE2_CLR {
pub use super::TEMPSENSE2::LOW_ALARM_VALUE;
pub use super::TEMPSENSE2::PANIC_ALARM_VALUE;
}
/// Tempsensor Control Register 2
pub mod TEMPSENSE2_TOG {
pub use super::TEMPSENSE2::LOW_ALARM_VALUE;
pub use super::TEMPSENSE2::PANIC_ALARM_VALUE;
}
#[repr(C)]
pub struct RegisterBlock {
_reserved1: [u32; 96],
/// Tempsensor Control Register 0
pub TEMPSENSE0: RWRegister<u32>,
/// Tempsensor Control Register 0
pub TEMPSENSE0_SET: RWRegister<u32>,
/// Tempsensor Control Register 0
pub TEMPSENSE0_CLR: RWRegister<u32>,
/// Tempsensor Control Register 0
pub TEMPSENSE0_TOG: RWRegister<u32>,
/// Tempsensor Control Register 1
pub TEMPSENSE1: RWRegister<u32>,
/// Tempsensor Control Register 1
pub TEMPSENSE1_SET: RWRegister<u32>,
/// Tempsensor Control Register 1
pub TEMPSENSE1_CLR: RWRegister<u32>,
/// Tempsensor Control Register 1
pub TEMPSENSE1_TOG: RWRegister<u32>,
_reserved2: [u32; 60],
/// Tempsensor Control Register 2
pub TEMPSENSE2: RWRegister<u32>,
/// Tempsensor Control Register 2
pub TEMPSENSE2_SET: RWRegister<u32>,
/// Tempsensor Control Register 2
pub TEMPSENSE2_CLR: RWRegister<u32>,
/// Tempsensor Control Register 2
pub TEMPSENSE2_TOG: RWRegister<u32>,
}
pub struct ResetValues {
pub TEMPSENSE0: u32,
pub TEMPSENSE0_SET: u32,
pub TEMPSENSE0_CLR: u32,
pub TEMPSENSE0_TOG: u32,
pub TEMPSENSE1: u32,
pub TEMPSENSE1_SET: u32,
pub TEMPSENSE1_CLR: u32,
pub TEMPSENSE1_TOG: u32,
pub TEMPSENSE2: u32,
pub TEMPSENSE2_SET: u32,
pub TEMPSENSE2_CLR: u32,
pub TEMPSENSE2_TOG: u32,
}
#[cfg(not(feature = "nosync"))]
pub struct Instance {
pub(crate) addr: u32,
pub(crate) _marker: PhantomData<*const RegisterBlock>,
}
#[cfg(not(feature = "nosync"))]
impl ::core::ops::Deref for Instance {
type Target = RegisterBlock;
#[inline(always)]
fn deref(&self) -> &RegisterBlock {
unsafe { &*(self.addr as *const _) }
}
}
#[cfg(feature = "rtfm")]
unsafe impl Send for Instance {}