65 #ifndef BSP430_CLOCK_H
66 #define BSP430_CLOCK_H
80 #define BSP430_PERIPH_CS_IS_CSA (defined(__MSP430_HAS_CS_A__) || (defined(__MSP430_HAS_CS__) && defined(DCOFSEL2)))
91 #define BSP430_PERIPH_CS_IS_CS4 (defined(__MSP430_HAS_CS__) && defined(SELA))
112 #ifndef BSP430_CLOCK_NOMINAL_MCLK_HZ
113 #define BSP430_CLOCK_NOMINAL_MCLK_HZ 7948800UL
130 #define BSP430_CLOCK_US_TO_NOMINAL_MCLK(delay_us_) BSP430_CORE_US_TO_TICKS((delay_us_), BSP430_CLOCK_NOMINAL_MCLK_HZ)
148 #if defined(BSP430_DOXYGEN)
149 #define BSP430_CLOCK_LFXT1_XCAP include <bsp430/platform.h>
161 #if defined(BSP430_DOXYGEN)
162 #define BSP430_CLOCK_IS_FAULTED_NI() peripheral specific
181 #ifndef BSP430_CLOCK_FAULT_RECHECK_DELAY_US
182 #define BSP430_CLOCK_FAULT_RECHECK_DELAY_US 50
205 #if defined(BSP430_DOXYGEN)
206 #define BSP430_CLOCK_CLEAR_FAULTS_NI() peripheral specific
215 #if defined(__MSP430_HAS_MSP430XV2_CPU__)
216 #define BSP430_CLOCK_OSC_IS_FAULTED_NI() (SFRIFG1 & OFIFG)
218 #define BSP430_CLOCK_OSC_IS_FAULTED_NI() (IFG1 & OFIFG)
227 #if defined(__MSP430_HAS_MSP430XV2_CPU__)
228 #define BSP430_CLOCK_OSC_CLEAR_FAULT_NI() do { SFRIFG1 &= ~OFIFG; } while (0)
230 #define BSP430_CLOCK_OSC_CLEAR_FAULT_NI() do { IFG1 &= ~OFIFG; } while (0)
239 #if defined(BSP430_DOXYGEN)
240 #define BSP430_CLOCK_LFXT1_IS_FAULTED_NI() peripheral specific
247 #ifndef BSP430_CLOCK_XT2_IS_FAULTED_NI
248 #define BSP430_CLOCK_XT2_IS_FAULTED_NI() (1)
272 #ifndef BSP430_CLOCK_LFXT1_STABILIZATION_DELAY_CYCLES
273 #define BSP430_CLOCK_LFXT1_STABILIZATION_DELAY_CYCLES BSP430_CORE_MS_TO_TICKS(50, BSP430_CLOCK_PUC_MCLK_HZ)
280 #ifndef BSP430_CLOCK_XT2_STABILIZATION_DELAY_CYCLES
281 #define BSP430_CLOCK_XT2_STABILIZATION_DELAY_CYCLES (20000UL)
290 #if defined(BSP430_DOXYGEN)
291 #define BSP430_CLOCK_XT2_IS_FAULTED_NI() peripheral specific
300 #ifndef BSP430_CLOCK_NOMINAL_XT1CLK_HZ
301 #define BSP430_CLOCK_NOMINAL_XT1CLK_HZ 32768U
313 #if defined(BSP430_DOXYGEN)
314 #define BSP430_CLOCK_NOMINAL_MODCLK_HZ peripheral specific
328 #if defined(BSP430_DOXYGEN)
329 #define BSP430_CLOCK_NOMINAL_XT2CLK_HZ include <bsp430/platform.h>
342 #if defined(BSP430_DOXYGEN)
343 #define BSP430_CLOCK_NOMINAL_VLOCLK_HZ platform specific around 10-12 kHz
351 #if defined(BSP430_DOXYGEN)
352 #define BSP430_CLOCK_PUC_MCLK_HZ platform specific around 1 MHz
612 unsigned int dividing_shift);
699 unsigned int dividing_shift);
761 #if defined(__MSP430_HAS_BC2__)
764 #if defined(__MSP430_HAS_FLLPLUS__) || defined(__MSP430_HAS_FLLPLUS_SMALL__)
767 #if defined(__MSP430_HAS_UCS__) || defined(__MSP430_HAS_UCS_RF__)
770 #if defined(__MSP430_HAS_CS__) || defined(__MSP430_HAS_CS_A__)
771 #if (BSP430_PERIPH_CS_IS_CS4 - 0)
eBSP430clockSource xBSP430clockMCLKSource()
eBSP430clockSource xBSP430clockACLKSource()
Hardware presentation/abstraction for Clock System (CS) on FR4xx/2xx chips.
#define BSP430_CORE_RESTORE_INTERRUPT_STATE(state_)
Definition: core.h:731
Hardware presentation/abstraction for Unified Clock System (UCS).
static BSP430_CORE_INLINE unsigned long ulBSP430clockMCLK_Hz(void)
Definition: clock.h:580
Common header included by all BSP430 leaf headers.
static BSP430_CORE_INLINE unsigned int uiBSP430clockACLK_Hz_ni(void)
Definition: clock.h:740
static BSP430_CORE_INLINE unsigned int uiBSP430clockACLK_Hz(void)
Definition: clock.h:749
unsigned long ulBSP430clockACLK_Hz_ni(void)
eBSP430clockSource
Definition: clock.h:362
static BSP430_CORE_INLINE unsigned long ulBSP430clockSMCLK_Hz(void)
Definition: clock.h:622
Hardware presentation/abstraction for FLL Plus (FLLPLUS).
static BSP430_CORE_INLINE unsigned long ulBSP430clockACLK_Hz(void)
Definition: clock.h:721
Hardware presentation/abstraction for Clock System (CS).
#define BSP430_CORE_INLINE
Definition: core.h:439
static BSP430_CORE_INLINE int iBSP430clockSourceSynchronous(eBSP430clockSource s1, eBSP430clockSource s2)
Definition: clock.h:475
#define BSP430_CORE_SAVED_INTERRUPT_STATE(var_)
Definition: core.h:719
int iBSP430clockConfigureACLK_ni(eBSP430clockSource sel, unsigned int dividing_shift)
int iBSP430clockConfigureXT2_ni(int enablep, int loop_limit)
unsigned long ulBSP430clockMCLK_Hz_ni(void)
int iBSP430clockConfigureLFXT1_ni(int enablep, int loop_limit)
#define BSP430_CORE_DISABLE_INTERRUPT()
Definition: core.h:762
int iBSP430clockConfigureSMCLK_ni(eBSP430clockSource sel, unsigned int dividing_shift)
unsigned long ulBSP430clockConfigureMCLK_ni(unsigned long mclk_Hz)
unsigned long ulBSP430clockSMCLK_Hz_ni(void)
Hardware presentation/abstraction for Basic Clock Module+ (BC2).
eBSP430clockSource xBSP430clockSMCLKSource()