88 #ifndef BSP430_PERIPH_UCS_H
89 #define BSP430_PERIPH_UCS_H
100 #define BSP430_MODULE_UCS (defined(__MSP430_HAS_UCS__) \
101 || defined(__MSP430_HAS_UCS_RF__))
103 #if defined(BSP430_DOXYGEN) || (BSP430_MODULE_UCS - 0)
125 #ifndef configBSP430_UCS_TRIM_DCOCLKDIV
126 #define configBSP430_UCS_TRIM_DCOCLKDIV 1
129 #if (configBSP430_UCS_TRIM_DCOCLKDIV - 0) && ! (configBSP430_TIMER_CCACLK - 0)
130 #warning configBSP430_UCS_TRIM_DCOCLKDIV requested without configBSP430_TIMER_CCACLK
142 #if defined(BSP430_DOXYGEN)
143 #define BSP430_UCS_TRIM_DCOCLKDIV include <bsp430/platform.h>
146 #if defined(BSP430_DOXYGEN) || (configBSP430_UCS_TRIM_DCOCLKDIV - 0)
190 #ifndef BSP430_UCS_FLL_SELREF
191 #define BSP430_UCS_FLL_SELREF SELREF__XT1CLK
198 #define BSP430_UCS_XT2OFF_ XT2OFF
199 #define BSP430_UCS_XT2OFFG_ XT2OFFG
201 #define BSP430_UCS_XT2OFF_ 0
202 #define BSP430_UCS_XT2OFFG_ 0
204 #if defined(XT1HFOFFG)
205 #define BSP430_UCS_XT1HFOFFG_ XT1HFOFFG
207 #define BSP430_UCS_XT1HFOFFG_ 0
212 #define BSP430_UCS_DCO_IS_FAULTED_NI() (UCSCTL7 & DCOFFG)
220 #define BSP430_UCS_LFXT1_IS_FAULTED_NI() (UCSCTL7 & XT1LFOFFG)
229 #define BSP430_UCS_XT2_IS_FAULTED_NI() (UCSCTL7 & BSP430_UCS_XT2OFFG_)
246 #if defined(BSP430_DOXYGEN) || ! defined(BSP430_CLOCK_LFXT1_IS_FAULTED_NI)
247 #define BSP430_CLOCK_LFXT1_IS_FAULTED_NI() ((UCSCTL6 & XT1OFF) || BSP430_UCS_LFXT1_IS_FAULTED_NI())
265 #if defined(BSP430_DOXYGEN) || ! defined(BSP430_CLOCK_XT2_IS_FAULTED_NI)
266 #define BSP430_CLOCK_XT2_IS_FAULTED_NI() ((UCSCTL6 & BSP430_UCS_XT2OFF_) || BSP430_UCS_XT2_IS_FAULTED_NI())
270 #define BSP430_UCS_CLEAR_FAULTS_NI() do { \
271 UCSCTL7 &= ~(BSP430_UCS_XT2OFFG_ | BSP430_UCS_XT1HFOFFG_ | XT1LFOFFG | DCOFFG); \
280 #if defined(BSP430_DOXYGEN) || ! defined(BSP430_CLOCK_CLEAR_FAULTS_NI)
281 #define BSP430_CLOCK_CLEAR_FAULTS_NI() do { \
282 BSP430_UCS_CLEAR_FAULTS_NI(); \
283 BSP430_CLOCK_OSC_CLEAR_FAULT_NI(); \
287 #ifndef BSP430_CLOCK_LFXT1_XCAP
289 #define BSP430_CLOCK_LFXT1_XCAP XCAP_1
292 #if defined(BSP430_DOXYGEN) || defined(BSP430_PERIPH_XT2)
294 #undef BSP430_CLOCK_XT2_IS_FAULTED_NI
303 #define BSP430_CLOCK_XT2_IS_FAULTED_NI() (UCSCTL7 & XT2OFFG)
308 #define BSP430_CLOCK_NOMINAL_VLOCLK_HZ 10000U
311 #define BSP430_CLOCK_PUC_MCLK_HZ 1048576UL
316 #define BSP430_UCS_NOMINAL_REFOCLK_HZ 32768U
324 #ifndef BSP430_UCS_NOMINAL_MODCLK_HZ
325 #define BSP430_UCS_NOMINAL_MODCLK_HZ 5000000UL
330 #define BSP430_NOMINAL_MODCLK_HZ BSP430_UCS_NOMINAL_MODCLK_HZ
Clock-related functions implemented on all MSP430 MCUs.
int iBSP430ucsTrimDCOCLKDIV_ni()
Generic peripheral support for MSP430 MCUs.