TMPM4G9  V1.0.0.0
ofd.h
Go to the documentation of this file.
1 
13 /*------------------------------------------------------------------------------*/
14 /* Define to prevent recursive inclusion */
15 /*------------------------------------------------------------------------------*/
16 #ifndef __OFD_H
17 #define __OFD_H
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 /*------------------------------------------------------------------------------*/
24 /* Includes */
25 /*------------------------------------------------------------------------------*/
26 #include "txz_sample_def.h"
27 
37 /*------------------------------------------------------------------------------*/
38 /* Macro Function */
39 /*------------------------------------------------------------------------------*/
45 /* no define */
46  /* End of group REG_Exported_macro */
50 
51 
52 /*------------------------------------------------------------------------------*/
53 /* Configuration */
54 /*------------------------------------------------------------------------------*/
60 /* no define */
61  /* End of group REG_Exported_define */
65 
66 
67 /*------------------------------------------------------------------------------*/
68 /* Macro Definition */
69 /*------------------------------------------------------------------------------*/
86 #define REG_OFD_OFDCR1_OFDWEN_DISABLE ((uint32_t)0x00000006)
87 #define REG_OFD_OFDCR1_OFDWEN_ENABLE ((uint32_t)0x000000F9) /* End of group OFDCR1_OFDWEN */
91  /* End of group OFDCR1 */
106 #define REG_OFD_OFDCR2_OFDEN_DISABLE ((uint32_t)0x00000000)
107 #define REG_OFD_OFDCR2_OFDEN_ENABLE ((uint32_t)0x000000E4) /* End of group OFDCR2_OFDEN */
111  /* End of group OFDCR2 */
125 #define REG_OFD_OFDRST_OFDRSTEN_DISABLE ((uint32_t)0x00000000)
126 #define REG_OFD_OFDRST_OFDRSTEN_ENABLE ((uint32_t)0x00000001) /* End of group OFDCR2_OFD2EN */
130  /* End of group OFDRST */
133 
145 #define REG_OFD_OFDSTAT_OFDBUSY_MASK ((uint32_t)0x00000002)
146 #define REG_OFD_OFDSTAT_OFDBUSY_SUSPENDED ((uint32_t)0x00000000)
147 #define REG_OFD_OFDSTAT_OFDBUSY_RUNNING ((uint32_t)0x00000002) /* End of group OFDSTAT_OFDBUSY */
151 
156 #define REG_OFD_OFDSTAT_FRQERR_MASK ((uint32_t)0x00000001)
157 #define REG_OFD_OFDSTAT_FRQERR_NOERROR ((uint32_t)0x00000000)
158 #define REG_OFD_OFDSTAT_FRQERR_ERROR ((uint32_t)0x00000001) /* End of group OFDSTAT_OFDBUSY */
162  /* End of group OFDSTAT */
176 #define REG_OFD_OFDMON1_OFDMON1_EHOSC ((uint32_t)0x00000000)
177 #define REG_OFD_OFDMON1_OFDMON1_FC ((uint32_t)0x00000001) /* End of group OFDMON1_OFDMON1 */
181  /* End of group OFDMON1 */ /* End of group REG_Exported_define */
187 
188 
189 /*------------------------------------------------------------------------------*/
190 /* Enumerated Type Definition */
191 /*------------------------------------------------------------------------------*/
197 /* no define */
198  /* End of group REG_Exported_define */
202 
203 /*------------------------------------------------------------------------------*/
204 /* Structure Definition */
205 /*------------------------------------------------------------------------------*/
210 /*----------------------------------*/
214 /*----------------------------------*/
215 typedef struct {
216  uint32_t mn0;
218  uint32_t mn1;
220  uint32_t mx0;
222  uint32_t mx1;
224 } REG_OFD_t;
225 
226  /* End of group REG_Exported_typedef */
230 
231 
232 /*------------------------------------------------------------------------------*/
233 /* Functions */
234 /*------------------------------------------------------------------------------*/
239 /* NFCKCR */
242 void REG_OFDEN_enable(TSB_OFD_TypeDef *p_reg);
244 void REG_OFDMN0_set(TSB_OFD_TypeDef *p_reg, uint32_t param);
245 void REG_OFDMN1_set(TSB_OFD_TypeDef *p_reg, uint32_t param);
246 void REG_OFDMX0_set(TSB_OFD_TypeDef *p_reg, uint32_t param);
247 void REG_OFDMX1_set(TSB_OFD_TypeDef *p_reg, uint32_t param);
250 void REG_OFDSTAT_get(TSB_OFD_TypeDef *p_reg, uint32_t *status);
251 void REG_OFDMON1_set(TSB_OFD_TypeDef *p_reg, uint32_t param);
252  /* End of group REG_Exported_functions */
256  /* End of group REG */
260  /* End of group Example */
264 
265 #ifdef __cplusplus
266 }
267 #endif /* __cplusplus */
268 #endif /* __OFD_H */
269 
270 
void REG_OFDMX0_set(TSB_OFD_TypeDef *p_reg, uint32_t param)
Set Value Detect Maxmun Frequency for EHOSC.
Definition: ofd.c:386
void REG_OFDRST_disable(TSB_OFD_TypeDef *p_reg)
OFD RESET Disable.
Definition: ofd.c:446
uint32_t mn1
Definition: ofd.h:218
uint32_t mx1
Definition: ofd.h:222
Oscillation Frequency Detector (OFD)
Definition: TMPM4G6.h:1383
OFD Control structure definition.
Definition: ofd.h:215
void REG_OFDRST_enable(TSB_OFD_TypeDef *p_reg)
OFD RESET Enable.
Definition: ofd.c:475
uint32_t mn0
Definition: ofd.h:216
void REG_OFDMX1_set(TSB_OFD_TypeDef *p_reg, uint32_t param)
Set Value Detect Maxmun Frequency for fc.
Definition: ofd.c:416
void REG_OFDEN_enable(TSB_OFD_TypeDef *p_reg)
OFD Detection Enablel.
Definition: ofd.c:296
void REG_OFDEN_disable(TSB_OFD_TypeDef *p_reg)
OFD Detection Disable.
Definition: ofd.c:267
void REG_OFDMN0_set(TSB_OFD_TypeDef *p_reg, uint32_t param)
Set Value Detect Minimum Frequency for EHOSC.
Definition: ofd.c:326
void REG_OFDWEN_disable(TSB_OFD_TypeDef *p_reg)
Register Write Disable.
Definition: ofd.c:208
BSPExInt status
Definition: main.c:140
void REG_OFDWEN_enable(TSB_OFD_TypeDef *p_reg)
Register Write Enable.
Definition: ofd.c:237
void REG_OFDMON1_set(TSB_OFD_TypeDef *p_reg, uint32_t param)
Set Value Detect Clock.
Definition: ofd.c:539
uint32_t mx0
Definition: ofd.h:220
void REG_OFDSTAT_get(TSB_OFD_TypeDef *p_reg, uint32_t *status)
Get Value OFD Status Register.
Definition: ofd.c:507
void REG_OFDMN1_set(TSB_OFD_TypeDef *p_reg, uint32_t param)
Set Value Detect Minimum Frequency for fc.
Definition: ofd.c:356