7 #ifndef __MSP430WARE_UCS_H__ 8 #define __MSP430WARE_UCS_H__ 10 #include "inc/hw_memmap.h" 12 #if defined(__MSP430_HAS_UCS__) || defined(__MSP430_HAS_UCS_RF__) 31 #define UCS_VLOCLK_FREQUENCY 10000 38 #define UCS_REFOCLK_FREQUENCY 32768 46 #define UCS_CLOCK_DIVIDER_1 DIVM__1 47 #define UCS_CLOCK_DIVIDER_2 DIVM__2 48 #define UCS_CLOCK_DIVIDER_4 DIVM__4 49 #define UCS_CLOCK_DIVIDER_8 DIVM__8 50 #define UCS_CLOCK_DIVIDER_12 DIVM__32 51 #define UCS_CLOCK_DIVIDER_16 DIVM__16 52 #define UCS_CLOCK_DIVIDER_32 DIVM__32 62 #define UCS_SMCLK 0x04 63 #define UCS_FLLREF 0x08 71 #define UCS_XT1CLK_SELECT SELM__XT1CLK 72 #define UCS_VLOCLK_SELECT SELM__VLOCLK 73 #define UCS_REFOCLK_SELECT SELM__REFOCLK 74 #define UCS_DCOCLK_SELECT SELM__DCOCLK 75 #define UCS_DCOCLKDIV_SELECT SELM__DCOCLKDIV 76 #define UCS_XT2CLK_SELECT SELM__XT2CLK 84 #define UCS_XCAP_0 XCAP_0 85 #define UCS_XCAP_1 XCAP_1 86 #define UCS_XCAP_2 XCAP_2 87 #define UCS_XCAP_3 XCAP_3 96 #define UCS_XT1_DRIVE_0 XT1DRIVE_0 97 #define UCS_XT1_DRIVE_1 XT1DRIVE_1 98 #define UCS_XT1_DRIVE_2 XT1DRIVE_2 99 #define UCS_XT1_DRIVE_3 XT1DRIVE_3 107 #define UCS_XT1_HIGH_FREQUENCY XTS 108 #define UCS_XT1_LOW_FREQUENCY 0x00 116 #define UCS_XT2_DRIVE_4MHZ_8MHZ XT2DRIVE_0 117 #define UCS_XT2_DRIVE_8MHZ_16MHZ XT2DRIVE_1 118 #define UCS_XT2_DRIVE_16MHZ_24MHZ XT2DRIVE_2 119 #define UCS_XT2_DRIVE_24MHZ_32MHZ XT2DRIVE_3 127 #define UCS_ACLK 0x01 128 #define UCS_SMCLK 0x04 129 #define UCS_MCLK 0x02 130 #define UCS_MODOSC MODOSCREQEN 139 #define UCS_XT2OFFG XT2OFFG 140 #define UCS_XT1HFOFFG XT1HFOFFG 141 #define UCS_XT1LFOFFG XT1LFOFFG 142 #define UCS_DCOFFG DCOFFG 167 uint32_t XT2CLK_frequency);
211 uint16_t clockSource,
212 uint16_t clockSourceDivider);
724 #endif // __MSP430WARE_UCS_H__ void UCS_initFLLSettle(uint16_t fsystem, uint16_t ratio)
Initializes the DCO to operate a frequency that is a multiple of the reference frequency into the FLL...
Definition: ucs.c:710
void UCS_bypassXT1(uint8_t highOrLowFrequency)
Bypass the XT1 crystal oscillator.
Definition: ucs.c:383
void UCS_clearFaultFlag(uint8_t mask)
Clears the current UCS fault flag status for the masked bit.
Definition: ucs.c:830
void UCS_turnOnSMCLK(void)
Turns ON SMCLK using the SMCLKOFF bit.
Definition: ucs.c:842
void UCS_turnOnXT2(uint16_t xt2drive)
Initializes the XT2 crystal oscillator.
Definition: ucs.c:567
void UCS_turnOnLFXT1(uint16_t xt1drive, uint8_t xcap)
Initializes the XT1 crystal oscillator in low frequency mode.
Definition: ucs.c:312
uint8_t UCS_getFaultFlagStatus(uint8_t mask)
Gets the current UCS fault flag status.
Definition: ucs.c:823
void UCS_initClockSignal(uint8_t selectedClockSignal, uint16_t clockSource, uint16_t clockSourceDivider)
Initializes a clock signal.
Definition: ucs.c:238
void UCS_bypassXT2(void)
Bypasses the XT2 crystal oscillator.
Definition: ucs.c:603
uint16_t UCS_clearAllOscFlagsWithTimeout(uint16_t timeout)
Clears all the Oscillator Flags.
Definition: ucs.c:892
void UCS_turnOnHFXT1(uint16_t xt1drive)
Initializes the XT1 crystal oscillator in high frequency mode.
Definition: ucs.c:353
bool UCS_turnOnHFXT1WithTimeout(uint16_t xt1drive, uint16_t timeout)
Initializes the XT1 crystal oscillator in high frequency mode with timeout.
Definition: ucs.c:469
void UCS_initFLL(uint16_t fsystem, uint16_t ratio)
Initializes the DCO to operate a frequency that is a multiple of the reference frequency into the FLL...
Definition: ucs.c:724
void UCS_disableClockRequest(uint8_t selectClock)
Disables conditional module requests.
Definition: ucs.c:817
bool UCS_bypassXT2WithTimeout(uint16_t timeout)
Bypasses the XT2 crystal oscillator with timeout.
Definition: ucs.c:671
uint32_t UCS_getACLK(void)
Get the current ACLK frequency.
Definition: ucs.c:847
void UCS_turnOffSMCLK(void)
Turns off SMCLK using the SMCLKOFF bit.
Definition: ucs.c:837
void UCS_turnOffXT2(void)
Stops the XT2 oscillator using the XT2OFF bit.
Definition: ucs.c:704
bool UCS_turnOnXT2WithTimeout(uint16_t xt2drive, uint16_t timeout)
Initializes the XT2 crystal oscillator with timeout.
Definition: ucs.c:627
uint32_t UCS_getMCLK(void)
Get the current MCLK frequency.
Definition: ucs.c:879
uint32_t UCS_getSMCLK(void)
Get the current SMCLK frequency.
Definition: ucs.c:863
void UCS_setExternalClockSource(uint32_t XT1CLK_frequency, uint32_t XT2CLK_frequency)
Sets the external clock source.
Definition: ucs.c:230
bool UCS_bypassXT1WithTimeout(uint8_t highOrLowFrequency, uint16_t timeout)
Bypasses the XT1 crystal oscillator with time out.
Definition: ucs.c:514
bool UCS_turnOnLFXT1WithTimeout(uint16_t xt1drive, uint8_t xcap, uint16_t timeout)
Initializes the XT1 crystal oscillator in low frequency mode with timeout.
Definition: ucs.c:421
void UCS_turnOffXT1(void)
Stops the XT1 oscillator using the XT1OFF bit.
Definition: ucs.c:561
void UCS_enableClockRequest(uint8_t selectClock)
Enables conditional module requests.
Definition: ucs.c:811