7 #ifndef __MSP430WARE_CS_H__
8 #define __MSP430WARE_CS_H__
10 #include "inc/hw_memmap.h"
12 #if defined(__MSP430_HAS_CS__) || defined(__MSP430_HAS_SFR__)
31 #define CS_CLOCK_DIVIDER_1 DIVM__1
32 #define CS_CLOCK_DIVIDER_2 DIVM__2
33 #define CS_CLOCK_DIVIDER_4 DIVM__4
34 #define CS_CLOCK_DIVIDER_8 DIVM__8
35 #define CS_CLOCK_DIVIDER_16 DIVM__16
36 #define CS_CLOCK_DIVIDER_32 DIVM__32
48 #define CS_MODOSC MODCLKREQEN
56 #define CS_VLOCLK_SELECT SELM__VLOCLK
57 #define CS_DCOCLK_SELECT SELM__DCOCLK
58 #define CS_LFXTCLK_SELECT SELM__LFXTCLK
59 #define CS_HFXTCLK_SELECT SELM__HFXTCLK
60 #define CS_LFMODOSC_SELECT SELM__LFMODOSC
61 #define CS_MODOSC_SELECT SELM__MODOSC
69 #define CS_LFXT_DRIVE_0 LFXTDRIVE_0
70 #define CS_LFXT_DRIVE_1 LFXTDRIVE_1
71 #define CS_LFXT_DRIVE_2 LFXTDRIVE_2
72 #define CS_LFXT_DRIVE_3 LFXTDRIVE_3
80 #define CS_HFXT_DRIVE_4MHZ_8MHZ HFXTDRIVE_0
81 #define CS_HFXT_DRIVE_8MHZ_16MHZ HFXTDRIVE_1
82 #define CS_HFXT_DRIVE_16MHZ_24MHZ HFXTDRIVE_2
83 #define CS_HFXT_DRIVE_24MHZ_32MHZ HFXTDRIVE_3
92 #define CS_LFXTOFFG LFXTOFFG
93 #define CS_HFXTOFFG HFXTOFFG
101 #define CS_DCORSEL_0 0x00
102 #define CS_DCORSEL_1 DCORSEL
110 #define CS_DCOFSEL_0 DCOFSEL_0
111 #define CS_DCOFSEL_1 DCOFSEL_1
112 #define CS_DCOFSEL_2 DCOFSEL_2
113 #define CS_DCOFSEL_3 DCOFSEL_3
114 #define CS_DCOFSEL_4 DCOFSEL_4
115 #define CS_DCOFSEL_5 DCOFSEL_5
116 #define CS_DCOFSEL_6 DCOFSEL_6
142 uint32_t HFXTCLK_frequency);
185 uint16_t clockSource,
186 uint16_t clockSourceDivider);
613 #endif // __MSP430WARE_CS_H__
uint16_t CS_clearAllOscFlagsWithTimeout(uint32_t timeout)
Clears all the Oscillator Flags.
Definition: cs.c:852
void CS_turnOnHFXT(uint16_t hfxtdrive)
Starts the HFXFT crystal.
Definition: cs.c:504
bool CS_turnOnHFXTWithTimeout(uint16_t hfxtdrive, uint32_t timeout)
Initializes the HFXT crystal oscillator with timeout.
Definition: cs.c:600
void CS_disableClockRequest(uint8_t selectClock)
Disables conditional module requests.
Definition: cs.c:749
uint32_t CS_getACLK(void)
Get the current ACLK frequency.
Definition: cs.c:794
void CS_turnOffLFXT(void)
Stops the LFXT oscillator using the LFXTOFF bit.
Definition: cs.c:492
uint8_t CS_getFaultFlagStatus(uint8_t mask)
Gets the current CS fault flag status.
Definition: cs.c:767
void CS_turnOffVLO(void)
Turns off VLO.
Definition: cs.c:841
bool CS_bypassLFXTWithTimeout(uint32_t timeout)
Bypass the LFXT crystal oscillator with timeout.
Definition: cs.c:455
bool CS_turnOnLFXTWithTimeout(uint16_t lfxtdrive, uint32_t timeout)
Initializes the LFXT crystal oscillator in low frequency mode with timeout.
Definition: cs.c:402
void CS_turnOffHFXT(void)
Stops the HFXT oscillator using the HFXTOFF bit.
Definition: cs.c:719
bool CS_bypassHFXTWithTimeout(uint32_t timeout)
Bypasses the HFXT crystal oscillator with timeout.
Definition: cs.c:666
void CS_initClockSignal(uint8_t selectedClockSignal, uint16_t clockSource, uint16_t clockSourceDivider)
Initializes clock signal.
Definition: cs.c:237
void CS_bypassLFXT(void)
Bypasses the LFXT crystal oscillator.
Definition: cs.c:373
void CS_bypassHFXT(void)
Bypasses the HFXT crystal oscillator.
Definition: cs.c:558
void CS_enableClockRequest(uint8_t selectClock)
Enables conditional module requests.
Definition: cs.c:731
uint32_t CS_getMCLK(void)
Get the current MCLK frequency.
Definition: cs.c:828
void CS_turnOnLFXT(uint16_t lfxtdrive)
Initializes the LFXT crystal in low frequency mode.
Definition: cs.c:311
void CS_setDCOFreq(uint16_t dcorsel, uint16_t dcofsel)
Set DCO frequency.
Definition: cs.c:875
void CS_turnOffSMCLK(void)
Turns off SMCLK using the SMCLKOFF bit.
Definition: cs.c:353
void CS_turnOnSMCLK(void)
Turns on SMCLK using the SMCLKOFF bit.
Definition: cs.c:363
void CS_clearFaultFlag(uint8_t mask)
Clears the current CS fault flag status for the masked bit.
Definition: cs.c:777
void CS_setExternalClockSource(uint32_t LFXTCLK_frequency, uint32_t HFXTCLK_frequency)
Sets the external clock source.
Definition: cs.c:229
uint32_t CS_getSMCLK(void)
Get the current SMCLK frequency.
Definition: cs.c:811