Functions | |
void | CS_setExternalClockSource (uint32_t LFXTCLK_frequency, uint32_t HFXTCLK_frequency) |
Sets the external clock source. More... | |
void | CS_initClockSignal (uint8_t selectedClockSignal, uint16_t clockSource, uint16_t clockSourceDivider) |
Initializes clock signal. More... | |
void | CS_turnOnLFXT (uint16_t lfxtdrive) |
Initializes the LFXT crystal in low frequency mode. More... | |
void | CS_turnOffSMCLK (void) |
Turns off SMCLK using the SMCLKOFF bit. More... | |
void | CS_turnOnSMCLK (void) |
Turns on SMCLK using the SMCLKOFF bit. More... | |
void | CS_bypassLFXT (void) |
Bypasses the LFXT crystal oscillator. More... | |
bool | CS_turnOnLFXTWithTimeout (uint16_t lfxtdrive, uint32_t timeout) |
Initializes the LFXT crystal oscillator in low frequency mode with timeout. More... | |
bool | CS_bypassLFXTWithTimeout (uint32_t timeout) |
Bypass the LFXT crystal oscillator with timeout. More... | |
void | CS_turnOffLFXT (void) |
Stops the LFXT oscillator using the LFXTOFF bit. More... | |
void | CS_turnOnHFXT (uint16_t hfxtdrive) |
Starts the HFXFT crystal. More... | |
void | CS_bypassHFXT (void) |
Bypasses the HFXT crystal oscillator. More... | |
bool | CS_turnOnHFXTWithTimeout (uint16_t hfxtdrive, uint32_t timeout) |
Initializes the HFXT crystal oscillator with timeout. More... | |
bool | CS_bypassHFXTWithTimeout (uint32_t timeout) |
Bypasses the HFXT crystal oscillator with timeout. More... | |
void | CS_turnOffHFXT (void) |
Stops the HFXT oscillator using the HFXTOFF bit. More... | |
void | CS_enableClockRequest (uint8_t selectClock) |
Enables conditional module requests. More... | |
void | CS_disableClockRequest (uint8_t selectClock) |
Disables conditional module requests. More... | |
uint8_t | CS_getFaultFlagStatus (uint8_t mask) |
Gets the current CS fault flag status. More... | |
void | CS_clearFaultFlag (uint8_t mask) |
Clears the current CS fault flag status for the masked bit. More... | |
uint32_t | CS_getACLK (void) |
Get the current ACLK frequency. More... | |
uint32_t | CS_getSMCLK (void) |
Get the current SMCLK frequency. More... | |
uint32_t | CS_getMCLK (void) |
Get the current MCLK frequency. More... | |
void | CS_turnOffVLO (void) |
Turns off VLO. More... | |
uint16_t | CS_clearAllOscFlagsWithTimeout (uint32_t timeout) |
Clears all the Oscillator Flags. More... | |
void | CS_setDCOFreq (uint16_t dcorsel, uint16_t dcofsel) |
Set DCO frequency. More... | |
void CS_bypassHFXT | ( | void | ) |
Bypasses the HFXT crystal oscillator.
Bypasses the HFXT crystal oscillator, which supports crystal frequencies between 0 MHz and 24 MHz. Loops until all oscillator fault flags are cleared, with no timeout.NOTE: User must call CS_setExternalClockSource to set frequency of external clocks before calling this function.
Modified bits of CSCTL5 register, bits of CSCTL4 register and bits of SFRIFG register.
bool CS_bypassHFXTWithTimeout | ( | uint32_t | timeout | ) |
Bypasses the HFXT crystal oscillator with timeout.
Bypasses the HFXT crystal oscillator, which supports crystal frequencies between 0 MHz and 24 MHz. Loops until all oscillator fault flags are cleared or until a timeout counter is decremented and equals to zero. NOTE: User must call CS_setExternalClockSource to set frequency of external clocks before calling this function.
timeout | is the count value that gets decremented every time the loop that clears oscillator fault flags gets executed. |
Modified bits of CSCTL5 register, bits of CSCTL4 register and bits of SFRIFG1 register.
void CS_bypassLFXT | ( | void | ) |
Bypasses the LFXT crystal oscillator.
Bypasses the LFXT crystal oscillator. Loops until all oscillator fault flags are cleared, with no timeout. IMPORTANT: User must call CS_setExternalClockSource function to set frequency of external clocks before calling this function.
Modified bits of CSCTL0 register, bits of CSCTL5 register, bits of CSCTL4 register and bits of SFRIFG register.
bool CS_bypassLFXTWithTimeout | ( | uint32_t | timeout | ) |
Bypass the LFXT crystal oscillator with timeout.
Bypasses the LFXT crystal oscillator with timeout. Loops until all oscillator fault flags are cleared or until a timeout counter is decremented and equals to zero. NOTE: User must call CS_setExternalClockSource to set frequency of external clocks before calling this function.
timeout | is the count value that gets decremented every time the loop that clears oscillator fault flags gets executed. |
Modified bits of CSCTL0 register, bits of CSCTL5 register, bits of CSCTL4 register and bits of SFRIFG register.
uint16_t CS_clearAllOscFlagsWithTimeout | ( | uint32_t | timeout | ) |
Clears all the Oscillator Flags.
timeout | is the count value that gets decremented every time the loop that clears oscillator fault flags gets executed. |
Modified bits of CSCTL5 register and bits of SFRIFG1 register.
void CS_clearFaultFlag | ( | uint8_t | mask | ) |
Clears the current CS fault flag status for the masked bit.
mask | is the masked interrupt flag status to be returned. mask parameter can be any one of the following Mask value is the logical OR of any of the following:
|
Modified bits of CSCTL5 register.
void CS_disableClockRequest | ( | uint8_t | selectClock | ) |
Disables conditional module requests.
selectClock | selects specific request enables. Valid values are:
|
Modified bits of CSCTL6 register.
void CS_enableClockRequest | ( | uint8_t | selectClock | ) |
Enables conditional module requests.
selectClock | selects specific request enables. Valid values are:
|
Modified bits of CSCTL6 register.
uint32_t CS_getACLK | ( | void | ) |
Get the current ACLK frequency.
If a oscillator fault is set, the frequency returned will be based on the fail safe mechanism of CS module. The user of this API must ensure that CS_externalClockSourceInit API was invoked before in case LFXT or HFXT is being used.
uint8_t CS_getFaultFlagStatus | ( | uint8_t | mask | ) |
Gets the current CS fault flag status.
mask | is the masked interrupt flag status to be returned. Mask parameter can be either any of the following selection. Mask value is the logical OR of any of the following:
|
uint32_t CS_getMCLK | ( | void | ) |
Get the current MCLK frequency.
If a oscillator fault is set, the frequency returned will be based on the fail safe mechanism of CS module. The user of this API must ensure that CS_externalClockSourceInit API was invoked before in case LFXT or HFXT is being used.
uint32_t CS_getSMCLK | ( | void | ) |
Get the current SMCLK frequency.
If a oscillator fault is set, the frequency returned will be based on the fail safe mechanism of CS module. The user of this API must ensure that CS_externalClockSourceInit API was invoked before in case LFXT or HFXT is being used.
void CS_initClockSignal | ( | uint8_t | selectedClockSignal, |
uint16_t | clockSource, | ||
uint16_t | clockSourceDivider | ||
) |
Initializes clock signal.
This function initializes each of the clock signals. The user must ensure that this function is called for each clock signal. If not, the default state is assumed for the particular clock signal. Refer to MSP430ware documentation for CS module or Device Family User's Guide for details of default clock signal states.
selectedClockSignal | Selected clock signal Valid values are:
|
clockSource | is the selected clock signal Valid values are:
|
clockSourceDivider | is the selected clock divider to calculate clock signal from clock source. Valid values are:
|
Modified bits of CSCTL0 register, bits of CSCTL3 register and bits of CSCTL2 register.
void CS_setDCOFreq | ( | uint16_t | dcorsel, |
uint16_t | dcofsel | ||
) |
Set DCO frequency.
dcorsel | selects frequency range option. Valid values are:
|
dcofsel | selects valid frequency options based on dco frequency range selection (dcorsel) Valid values are:
|
void CS_setExternalClockSource | ( | uint32_t | LFXTCLK_frequency, |
uint32_t | HFXTCLK_frequency | ||
) |
Sets the external clock source.
This function sets the external clock sources LFXT and HFXT crystal oscillator frequency values. This function must be called if an external crystal LFXT or HFXT is used and the user intends to call CS_getMCLK, CS_getSMCLK, CS_getACLK and CS_turnOnLFXT, CS_LFXTByPass, CS_turnOnLFXTWithTimeout, CS_LFXTByPassWithTimeout, CS_turnOnHFXT, CS_HFXTByPass, CS_turnOnHFXTWithTimeout, CS_HFXTByPassWithTimeout.
LFXTCLK_frequency | is the LFXT crystal frequencies in Hz |
HFXTCLK_frequency | is the HFXT crystal frequencies in Hz |
void CS_turnOffHFXT | ( | void | ) |
Stops the HFXT oscillator using the HFXTOFF bit.
Modified bits of CSCTL4 register.
void CS_turnOffLFXT | ( | void | ) |
Stops the LFXT oscillator using the LFXTOFF bit.
Modified bits of CSCTL4 register.
void CS_turnOffSMCLK | ( | void | ) |
Turns off SMCLK using the SMCLKOFF bit.
Modified bits of CSCTL4 register.
void CS_turnOffVLO | ( | void | ) |
Turns off VLO.
Modified bits of CSCTL4 register.
void CS_turnOnHFXT | ( | uint16_t | hfxtdrive | ) |
Starts the HFXFT crystal.
Initializes the HFXT crystal oscillator, which supports crystal frequencies between 0 MHz and 24 MHz, depending on the selected drive strength. Loops until all oscillator fault flags are cleared, with no timeout. See the device-specific data sheet for appropriate drive settings. NOTE: User must call CS_setExternalClockSource to set frequency of external clocks before calling this function.
hfxtdrive | is the target drive strength for the HFXT crystal oscillator. Valid values are:
|
Modified bits of CSCTL5 register, bits of CSCTL4 register and bits of SFRIFG1 register.
bool CS_turnOnHFXTWithTimeout | ( | uint16_t | hfxtdrive, |
uint32_t | timeout | ||
) |
Initializes the HFXT crystal oscillator with timeout.
Initializes the HFXT crystal oscillator, which supports crystal frequencies between 0 MHz and 24 MHz, depending on the selected drive strength. Loops until all oscillator fault flags are cleared or until a timeout counter is decremented and equals to zero. See the device-specific data sheet for appropriate drive settings. NOTE: User must call CS_setExternalClockSource to set frequency of external clocks before calling this function.
hfxtdrive | is the target drive strength for the HFXT crystal oscillator. Valid values are:
|
timeout | is the count value that gets decremented every time the loop that clears oscillator fault flags gets executed. |
Modified bits of CSCTL5 register, bits of CSCTL4 register and bits of SFRIFG1 register.
void CS_turnOnLFXT | ( | uint16_t | lfxtdrive | ) |
Initializes the LFXT crystal in low frequency mode.
Initializes the LFXT crystal oscillator in low frequency mode. Loops until all oscillator fault flags are cleared, with no timeout. See the device- specific data sheet for appropriate drive settings. IMPORTANT: User must call CS_setExternalClockSource function to set frequency of external clocks before calling this function.
lfxtdrive | is the target drive strength for the LFXT crystal oscillator. Valid values are:
|
Modified bits of CSCTL0 register, bits of CSCTL5 register, bits of CSCTL4 register and bits of SFRIFG1 register.
bool CS_turnOnLFXTWithTimeout | ( | uint16_t | lfxtdrive, |
uint32_t | timeout | ||
) |
Initializes the LFXT crystal oscillator in low frequency mode with timeout.
Initializes the LFXT crystal oscillator in low frequency mode with timeout. Loops until all oscillator fault flags are cleared or until a timeout counter is decremented and equals to zero. See the device-specific datasheet for appropriate drive settings. IMPORTANT: User must call CS_setExternalClockSource to set frequency of external clocks before calling this function.
lfxtdrive | is the target drive strength for the LFXT crystal oscillator. Valid values are:
|
timeout | is the count value that gets decremented every time the loop that clears oscillator fault flags gets executed. |
Modified bits of CSCTL0 register, bits of CSCTL5 register, bits of CSCTL4 register and bits of SFRIFG1 register.
void CS_turnOnSMCLK | ( | void | ) |
Turns on SMCLK using the SMCLKOFF bit.
Modified bits of CSCTL4 register.