80 #ifndef BSP430_PERIPH_CS_H
81 #define BSP430_PERIPH_CS_H
103 #define BSP430_CS_IS_FR58XX (BSP430_PERIPH_CS_IS_CSA - 0)
113 #define BSP430_CS_IS_FR57XX (defined(__MSP430_HAS_CS__) && (! ((BSP430_PERIPH_CS_IS_CSA - 0) || (BSP430_PERIPH_CS_IS_CS4 - 0))))
125 #define BSP430_MODULE_CS ((BSP430_CS_IS_FR57XX - 0) || (BSP430_CS_IS_FR58XX - 0))
127 #if defined(BSP430_DOXYGEN) || (BSP430_MODULE_CS - 0)
132 #if (BSP430_CS_IS_FR58XX - 0)
133 #define BSP430_CS_XT2DRIVE_ HFXTDRIVE
134 #define BSP430_CS_XT2OFF_ HFXTOFF
135 #define BSP430_CS_XT1DRIVE_ LFXTDRIVE
136 #define BSP430_CS_XTS_ 0
137 #define BSP430_CS_XT1BYPASS_ LFXTBYPASS
138 #define BSP430_CS_XT1OFF_ LFXTOFF
139 #define BSP430_CS_XT2OFFG_ HFXTOFFG
140 #define BSP430_CS_XT1OFFG_ LFXTOFFG
142 #define BSP430_CS_XT2DRIVE_ XT2DRIVE
143 #define BSP430_CS_XT2OFF_ XT2OFF
144 #define BSP430_CS_XT1DRIVE_ XT1DRIVE
145 #define BSP430_CS_XTS_ XTS
146 #define BSP430_CS_XT1BYPASS_ XT1BYPASS
147 #define BSP430_CS_XT1OFF_ XT1OFF
149 #define BSP430_CS_XT2OFFG_ XT2OFFG
151 #define BSP430_CS_XT2OFFG_ 0
153 #define BSP430_CS_XT1OFFG_ XT1OFFG
157 #if defined(BSP430_DOXYGEN) || (BSP430_CS_IS_FR58XX - 0)
168 #ifndef BSP430_CS_NOMINAL_MODCLK_HZ
169 #define BSP430_CS_NOMINAL_MODCLK_HZ 5000000UL
174 #define BSP430_NOMINAL_MODCLK_HZ BSP430_CS_NOMINAL_MODCLK_HZ
181 #define BSP430_CS_NOMINAL_LFMODCLK_HZ (BSP430_CS_NOMINAL_MODCLK_HZ / 128)
190 #define BSP430_CS_LFXT1_IS_FAULTED_NI() (CSCTL5 & BSP430_CS_XT1OFFG_)
199 #define BSP430_CS_XT2_IS_FAULTED_NI() (CSCTL5 & BSP430_CS_XT2OFFG_)
216 #if defined(BSP430_DOXYGEN) || ! defined(BSP430_CLOCK_LFXT1_IS_FAULTED_NI)
217 #define BSP430_CLOCK_LFXT1_IS_FAULTED_NI() ((CSCTL4 & BSP430_CS_XT1OFF_) || BSP430_CS_LFXT1_IS_FAULTED_NI())
235 #if defined(BSP430_DOXYGEN) || ! defined(BSP430_CLOCK_XT2_IS_FAULTED_NI)
236 #define BSP430_CLOCK_XT2_IS_FAULTED_NI() ((CSCTL4 & BSP430_CS_XT2OFF_) || BSP430_CS_XT2_IS_FAULTED_NI())
243 #define BSP430_CS_CLEAR_FAULTS_NI() do { \
244 CSCTL5 &= ~(BSP430_CS_XT2OFFG_ | BSP430_CS_XT1OFFG_); \
253 #if defined(BSP430_DOXYGEN) || ! defined(BSP430_CLOCK_CLEAR_FAULTS_NI)
254 #define BSP430_CLOCK_CLEAR_FAULTS_NI() do { \
256 BSP430_CS_CLEAR_FAULTS_NI(); \
258 BSP430_CLOCK_OSC_CLEAR_FAULT_NI(); \
293 #if defined(BSP430_DOXYGEN)
294 #define BSP430_CS_FRAM_NWAITS_FOR_FREQ(freq_) include <bsp430/platform.h>
298 #define BSP430_CLOCK_NOMINAL_VLOCLK_HZ 10000U
301 #define BSP430_CLOCK_PUC_MCLK_HZ 1048576UL
Clock-related functions implemented on all MSP430 MCUs.
Generic peripheral support for MSP430 MCUs.