Go to the source code of this file.
Defines | |
#define | __MSP430_HAS_SFR__ |
#define | __MSP430_HAS_CS_A__ |
#define | CSA_ACLK 0x01 |
#define | CSA_MCLK 0x02 |
#define | CSA_SMCLK 0x04 |
#define | CSA_MODOSC MODCLKREQEN |
#define | CSA_VLOCLK_SELECT SELM__VLOCLK |
#define | CSA_DCOCLK_SELECT SELM__DCOCLK |
#define | CSA_LFXTCLK_SELECT SELM__LFXTCLK |
#define | CSA_HFXTCLK_SELECT SELM__HFXTCLK |
#define | CSA_LFMODOSC_SELECT SELM__LFMODOSC |
#define | CSA_MODOSC_SELECT SELM__MODOSC |
#define | CSA_CLOCK_DIVIDER_1 DIVM__1 |
#define | CSA_CLOCK_DIVIDER_2 DIVM__2 |
#define | CSA_CLOCK_DIVIDER_4 DIVM__4 |
#define | CSA_CLOCK_DIVIDER_8 DIVM__8 |
#define | CSA_CLOCK_DIVIDER_16 DIVM__16 |
#define | CSA_CLOCK_DIVIDER_32 DIVM__32 |
#define | CSA_LFXT_DRIVE0 LFXTDRIVE_0 |
#define | CSA_LFXT_DRIVE1 LFXTDRIVE_1 |
#define | CSA_LFXT_DRIVE2 LFXTDRIVE_2 |
#define | CSA_LFXT_DRIVE3 LFXTDRIVE_3 |
#define | CSA_DCORSEL_0 0x00 |
#define | CSA_DCORSEL_1 DCORSEL |
#define | CSA_DCOFSEL_0 DCOFSEL_0 |
#define | CSA_DCOFSEL_1 DCOFSEL_1 |
#define | CSA_DCOFSEL_2 DCOFSEL_2 |
#define | CSA_DCOFSEL_3 DCOFSEL_3 |
#define | CSA_DCOFSEL_4 DCOFSEL_4 |
#define | CSA_DCOFSEL_5 DCOFSEL_5 |
#define | CSA_DCOFSEL_6 DCOFSEL_6 |
#define | CSA_HFXTDRIVE_4MHZ_8MHZ HFXTDRIVE_0 |
#define | CSA_HFXTDRIVE_8MHZ_16MHZ HFXTDRIVE_1 |
#define | CSA_HFXTDRIVE_16MHZ_24MHZ HFXTDRIVE_2 |
#define | CSA_HFXTDRIVE_24MHZ_32MHZ HFXTDRIVE_3 |
#define | CSA_HFXTDRIVE_0 HFXTDRIVE_0 |
#define | CSA_HFXTDRIVE_1 HFXTDRIVE_1 |
#define | CSA_HFXTDRIVE_2 HFXTDRIVE_2 |
#define | CSA_HFXTDRIVE_3 HFXTDRIVE_3 |
#define | CSA_XT2OFFG XT2OFFG |
#define | CSA_XT1OFFG XT1OFFG |
#define | CSA_LFXTOFFG LFXTOFFG |
#define | CSA_HFXTOFFG HFXTOFFG |
#define | CSA_XT1DRIVE_0 XT1DRIVE_0 |
#define | CSA_XT1DRIVE_1 XT1DRIVE_1 |
#define | CSA_XT1DRIVE_2 XT1DRIVE_2 |
#define | CSA_XT1DRIVE_3 XT1DRIVE_3 |
#define | CSA_LFXTDRIVE_0 LFXTDRIVE_0 |
#define | CSA_LFXTDRIVE_1 LFXTDRIVE_1 |
#define | CSA_LFXTDRIVE_2 LFXTDRIVE_2 |
#define | CSA_LFXTDRIVE_3 LFXTDRIVE_3 |
#define | CSA_VLOCLK_FREQUENCY 10000 |
#define | CSA_MODCLK_FREQUENCY 5000000 |
#define | CSA_LFMODCLK_FREQUENCY 39062 |
#define | LFXT_FREQUENCY_THRESHOLD 50000 |
#define | CSA_DCO_FREQ_1 1000000 |
#define | CSA_DCO_FREQ_2 2670000 |
#define | CSA_DCO_FREQ_3 3330000 |
#define | CSA_DCO_FREQ_4 4000000 |
#define | CSA_DCO_FREQ_5 5330000 |
#define | CSA_DCO_FREQ_6 6670000 |
#define | CSA_DCO_FREQ_7 8000000 |
#define | CSA_DCO_FREQ_8 16000000 |
Functions | |
void | CSA_setExternalClockSource (unsigned int baseaddress, unsigned long LFXT_LFXT_CLK_frequency, unsigned long HFXT_HFXT_CLK_frequency) |
void | CSA_clockSignalInit (unsigned int baseaddress, unsigned char selectedClockSignal, unsigned int clockSource, unsigned int clockSourceDivider) |
void | CSA_XT1Start (unsigned int baseAddress, unsigned int lfxtdrive) |
void | CSA_LFXTStart (unsigned int baseAddress, unsigned int lfxtdrive) |
void | CSA_bypassXT1 (unsigned int baseAddress) |
void | CSA_bypassLFXT (unsigned int baseAddress) |
unsigned short | CSA_bypassXT1WithTimeout (unsigned int baseAddress, unsigned long timeout) |
unsigned short | CSA_bypassLFXTWithTimeout (unsigned int baseAddress, unsigned long timeout) |
unsigned short | CSA_XT1StartWithTimeout (unsigned int baseAddress, unsigned int lfxtdrive, unsigned long timeout) |
unsigned short | CSA_LFXTStartWithTimeout (unsigned int baseAddress, unsigned int lfxtdrive, unsigned long timeout) |
void | CSA_XT1Off (unsigned int baseAddress) |
void | CSA_LFXTOff (unsigned int baseAddress) |
void | CSA_XT2Start (unsigned int baseAddress, unsigned int hfxtdtive) |
void | CSA_HFXTStart (unsigned int baseAddress, unsigned int hfxtdtive) |
void | CSA_bypassXT2 (unsigned int baseAddress) |
void | CSA_bypassHFXT (unsigned int baseAddress) |
unsigned short | CSA_XT2StartWithTimeout (unsigned int baseAddress, unsigned int hfxtdtive, unsigned long timeout) |
unsigned short | CSA_HFXTStartWithTimeout (unsigned int baseAddress, unsigned int hfxtdrive, unsigned long timeout) |
unsigned short | CSA_bypassXT2WithTimeout (unsigned int baseAddress, unsigned long timeout) |
unsigned short | CSA_bypassHFXTWithTimeout (unsigned int baseAddress, unsigned long timeout) |
void | CSA_XT2Off (unsigned int baseAddress) |
void | CSA_HFXTOff (unsigned int baseAddress) |
void | CSA_enableClockRequest (unsigned int baseAddress, unsigned char selectClock) |
void | CSA_disableClockRequest (unsigned int baseAddress, unsigned char selectClock) |
unsigned char | CSA_faultFlagStatus (unsigned int baseAddress, unsigned char mask) |
void | CSA_clearFaultFlag (unsigned int baseAddress, unsigned char mask) |
unsigned long | CSA_getACLK (unsigned int baseAddress) |
unsigned long | CSA_getSMCLK (unsigned int baseAddress) |
unsigned long | CSA_getMCLK (unsigned int baseAddress) |
unsigned int | CSA_clearAllOscFlagsWithTimeout (unsigned int baseAddress, unsigned long timeout) |
void | CSA_VLOoff (unsigned int baseAddress) |
void | CSA_setDCOFreq (unsigned int baseAddress, unsigned int dcorsel, unsigned int dcofsel) |
#define __MSP430_HAS_SFR__ |
#define __MSP430_HAS_CS_A__ |
#define CSA_ACLK 0x01 |
Referenced by CSA_clockSignalInit(), CSA_disableClockRequest(), and CSA_enableClockRequest().
#define CSA_MCLK 0x02 |
Referenced by CSA_clockSignalInit(), CSA_disableClockRequest(), and CSA_enableClockRequest().
#define CSA_SMCLK 0x04 |
Referenced by CSA_clockSignalInit(), CSA_disableClockRequest(), and CSA_enableClockRequest().
#define CSA_MODOSC MODCLKREQEN |
Referenced by CSA_disableClockRequest(), and CSA_enableClockRequest().
#define CSA_VLOCLK_SELECT SELM__VLOCLK |
Referenced by CSA_clockSignalInit().
#define CSA_DCOCLK_SELECT SELM__DCOCLK |
Referenced by CSA_clockSignalInit().
#define CSA_LFXTCLK_SELECT SELM__LFXTCLK |
Referenced by CSA_clockSignalInit().
#define CSA_HFXTCLK_SELECT SELM__HFXTCLK |
Referenced by CSA_clockSignalInit().
#define CSA_LFMODOSC_SELECT SELM__LFMODOSC |
Referenced by CSA_clockSignalInit().
#define CSA_MODOSC_SELECT SELM__MODOSC |
Referenced by CSA_clockSignalInit().
#define CSA_CLOCK_DIVIDER_1 DIVM__1 |
Referenced by CSA_clockSignalInit().
#define CSA_CLOCK_DIVIDER_2 DIVM__2 |
Referenced by CSA_clockSignalInit().
#define CSA_CLOCK_DIVIDER_4 DIVM__4 |
Referenced by CSA_clockSignalInit().
#define CSA_CLOCK_DIVIDER_8 DIVM__8 |
Referenced by CSA_clockSignalInit().
#define CSA_CLOCK_DIVIDER_16 DIVM__16 |
Referenced by CSA_clockSignalInit().
#define CSA_CLOCK_DIVIDER_32 DIVM__32 |
Referenced by CSA_clockSignalInit().
#define CSA_LFXT_DRIVE0 LFXTDRIVE_0 |
Referenced by CSA_LFXTStart(), and CSA_LFXTStartWithTimeout().
#define CSA_LFXT_DRIVE1 LFXTDRIVE_1 |
Referenced by CSA_LFXTStart(), and CSA_LFXTStartWithTimeout().
#define CSA_LFXT_DRIVE2 LFXTDRIVE_2 |
Referenced by CSA_LFXTStart(), and CSA_LFXTStartWithTimeout().
#define CSA_LFXT_DRIVE3 LFXTDRIVE_3 |
Referenced by CSA_LFXTStart(), and CSA_LFXTStartWithTimeout().
#define CSA_DCORSEL_0 0x00 |
Referenced by CSA_setDCOFreq().
#define CSA_DCORSEL_1 DCORSEL |
Referenced by CSA_setDCOFreq().
#define CSA_DCOFSEL_0 DCOFSEL_0 |
Referenced by CSA_setDCOFreq().
#define CSA_DCOFSEL_1 DCOFSEL_1 |
Referenced by CSA_setDCOFreq().
#define CSA_DCOFSEL_2 DCOFSEL_2 |
Referenced by CSA_setDCOFreq().
#define CSA_DCOFSEL_3 DCOFSEL_3 |
Referenced by CSA_setDCOFreq().
#define CSA_DCOFSEL_4 DCOFSEL_4 |
Referenced by CSA_setDCOFreq().
#define CSA_DCOFSEL_5 DCOFSEL_5 |
Referenced by CSA_setDCOFreq().
#define CSA_DCOFSEL_6 DCOFSEL_6 |
Referenced by CSA_setDCOFreq().
#define CSA_HFXTDRIVE_4MHZ_8MHZ HFXTDRIVE_0 |
Referenced by CSA_HFXTStart().
#define CSA_HFXTDRIVE_8MHZ_16MHZ HFXTDRIVE_1 |
Referenced by CSA_HFXTStart().
#define CSA_HFXTDRIVE_16MHZ_24MHZ HFXTDRIVE_2 |
Referenced by CSA_HFXTStart().
#define CSA_HFXTDRIVE_24MHZ_32MHZ HFXTDRIVE_3 |
Referenced by CSA_HFXTStart(), and CSA_HFXTStartWithTimeout().
#define CSA_HFXTDRIVE_0 HFXTDRIVE_0 |
#define CSA_HFXTDRIVE_1 HFXTDRIVE_1 |
#define CSA_HFXTDRIVE_2 HFXTDRIVE_2 |
#define CSA_HFXTDRIVE_3 HFXTDRIVE_3 |
#define CSA_XT2OFFG XT2OFFG |
#define CSA_XT1OFFG XT1OFFG |
#define CSA_LFXTOFFG LFXTOFFG |
Referenced by CSA_clearFaultFlag(), and CSA_faultFlagStatus().
#define CSA_HFXTOFFG HFXTOFFG |
Referenced by CSA_clearFaultFlag(), and CSA_faultFlagStatus().
#define CSA_XT1DRIVE_0 XT1DRIVE_0 |
#define CSA_XT1DRIVE_1 XT1DRIVE_1 |
#define CSA_XT1DRIVE_2 XT1DRIVE_2 |
#define CSA_XT1DRIVE_3 XT1DRIVE_3 |
#define CSA_LFXTDRIVE_0 LFXTDRIVE_0 |
#define CSA_LFXTDRIVE_1 LFXTDRIVE_1 |
#define CSA_LFXTDRIVE_2 LFXTDRIVE_2 |
#define CSA_LFXTDRIVE_3 LFXTDRIVE_3 |
#define CSA_VLOCLK_FREQUENCY 10000 |
Referenced by privateCSAComputeCLKFrequency().
#define CSA_MODCLK_FREQUENCY 5000000 |
Referenced by privateCSAComputeCLKFrequency().
#define CSA_LFMODCLK_FREQUENCY 39062 |
Referenced by privateCSAComputeCLKFrequency().
#define LFXT_FREQUENCY_THRESHOLD 50000 |
Referenced by CSA_bypassLFXT(), and CSA_bypassLFXTWithTimeout().
#define CSA_DCO_FREQ_1 1000000 |
Referenced by privateCSASourceClockFromDCO().
#define CSA_DCO_FREQ_2 2670000 |
Referenced by privateCSASourceClockFromDCO().
#define CSA_DCO_FREQ_3 3330000 |
Referenced by privateCSASourceClockFromDCO().
#define CSA_DCO_FREQ_4 4000000 |
Referenced by privateCSASourceClockFromDCO().
#define CSA_DCO_FREQ_5 5330000 |
Referenced by privateCSASourceClockFromDCO().
#define CSA_DCO_FREQ_6 6670000 |
Referenced by privateCSASourceClockFromDCO().
#define CSA_DCO_FREQ_7 8000000 |
Referenced by privateCSASourceClockFromDCO().
#define CSA_DCO_FREQ_8 16000000 |
Referenced by privateCSASourceClockFromDCO().
void CSA_setExternalClockSource | ( | unsigned int | baseAddress, |
unsigned long | LFXTCLK_frequency, | ||
unsigned long | HFXTCLK_frequency | ||
) |
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 CSA_getMCLK, CSA_getSMCLK, CSA_getACLK and CSA_LFXTStart, CSA_LFXTByPass, CSA_LFXTStartWithTimeout, CSA_LFXTByPassWithTimeout, CSA_HFXTStart, CSA_HFXTByPass, CSA_HFXTStartWithTimeout, CSA_HFXTByPassWithTimeout.
baseAddress | is the base address of the CSA module. |
LFXTCLK_frequency | is the LFXT crystal frequencies in Hz |
HFXTCLK_frequency | is the HFXT crystal frequencies in Hz |
References CSA_HFXTClockFrequency, and CSA_LFXTClockFrequency.
void CSA_clockSignalInit | ( | unsigned int | baseAddress, |
unsigned char | selectedClockSignal, | ||
unsigned int | clockSource, | ||
unsigned int | clockSourceDivider | ||
) |
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 MSP430ware documentation for CSA module or Device Family User's Guide for details of default clock signal states.
baseAddress | is the base address of the CSA module. |
selectedClockSignal | - Valid values are CSA_ACLK, CSA_MCLK, CSA_SMCLK, |
clockSource | is Clock source for the selectedClock Signal CSA_LFXTCLK_SELECT, CSA_VLOCLK_SELECT, CSA_DCOCLK_SELECT, [Not available for ACLK] CSA_HFXTCLK_SELECT, [Not available for ACLK] CSA_LFMODOSC_SELECT, CSA_MODOSC_SELECT [Not available for ACLK] |
clockSourceDivider | - selected the clock divider to calculate clock signal from clock source. Valid values are CSA_CLOCK_DIVIDER_1, [Default for ACLK] CSA_CLOCK_DIVIDER_2, CSA_CLOCK_DIVIDER_4, CSA_CLOCK_DIVIDER_8, [Default for SMCLK and MCLK] CSA_CLOCK_DIVIDER_16, CSA_CLOCK_DIVIDER_32 |
Modified registers are CSCTL0, CSCTL2, CSCTL3
References ASSERT, CSA_ACLK, CSA_CLOCK_DIVIDER_1, CSA_CLOCK_DIVIDER_16, CSA_CLOCK_DIVIDER_2, CSA_CLOCK_DIVIDER_32, CSA_CLOCK_DIVIDER_4, CSA_CLOCK_DIVIDER_8, CSA_DCOCLK_SELECT, CSA_HFXTCLK_SELECT, CSA_LFMODOSC_SELECT, CSA_LFXTCLK_SELECT, CSA_MCLK, CSA_MODOSC_SELECT, CSA_SMCLK, CSA_VLOCLK_SELECT, and HWREG.
void CSA_XT1Start | ( | unsigned int | baseAddress, |
unsigned int | lfxtdrive | ||
) |
void CSA_LFXTStart | ( | unsigned int | baseAddress, |
unsigned int | lfxtdrive | ||
) |
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 CSA_setExternalClockSource function to set frequency of external clocks this function is call.
baseAddress | is the base address of the CS module. |
lfxtdrive | is the target drive strength for the LFXT crystal oscillator. Valid values: CSA_LFXT_DRIVE0, CSA_LFXT_DRIVE1, CSA_LFXT_DRIVE2, CSA_LFXT_DRIVE3. [Default] Modified registers are CSCTL0, CSCTL4, CSCTL5 and SFRIFG1 |
References ASSERT, CSA_LFXT_DRIVE0, CSA_LFXT_DRIVE1, CSA_LFXT_DRIVE2, CSA_LFXT_DRIVE3, CSA_LFXTClockFrequency, HWREG, HWREGB, and SFR_BASEADDRESS.
void CSA_bypassXT1 | ( | unsigned int | baseAddress | ) |
void CSA_bypassLFXT | ( | unsigned int | baseAddress | ) |
Bypasses the LFXT crystal oscillator. Loops until all oscillator fault flags are cleared, with no timeout. IMPORTANT: User must call CSA_setExternalClockSource function to set frequency of external clocks this function is call.
baseAddress | is the base address of the CS module. |
Modified registers are CSCTL0, CSCTL4, CSCTL5, SFRIFG1
References ASSERT, CSA_LFXTClockFrequency, HWREG, HWREGB, LFXT_FREQUENCY_THRESHOLD, and SFR_BASEADDRESS.
unsigned short CSA_bypassXT1WithTimeout | ( | unsigned int | baseAddress, |
unsigned long | timeout | ||
) |
unsigned short CSA_bypassLFXTWithTimeout | ( | unsigned int | baseAddress, |
unsigned long | timeout | ||
) |
Bypasses the LFXT crystal oscillator with time out. Loops until all oscillator fault flags are cleared or until a timeout counter is decremented and equals to zero. NOTE: User must call CSA_setExternalClockSource to set frequency of external clocks before calling this function
baseAddress | is the base address of the CS module. |
timeout | is the count value that gets decremented every time the loop that clears oscillator fault flags gets executed. |
Modified registers are CSCTL0, CSCTL4, CSCTL5, SFRIFG1
References ASSERT, CSA_LFXTClockFrequency, HWREG, HWREGB, LFXT_FREQUENCY_THRESHOLD, SFR_BASEADDRESS, STATUS_FAIL, and STATUS_SUCCESS.
unsigned short CSA_XT1StartWithTimeout | ( | unsigned int | baseAddress, |
unsigned int | lfxtdrive, | ||
unsigned long | timeout | ||
) |
unsigned short CSA_LFXTStartWithTimeout | ( | unsigned int | baseAddress, |
unsigned int | lfxtdrive, | ||
unsigned long | 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 CSA_setExternalClockSource to set frequency of external clocks before calling this function
baseAddress | is the base address of the CS module. |
lfxtdrive | is the target drive strength for the LFXT crystal oscillator. Valid values are CSA_LFXTDRIVE0, CSA_LFXTDRIVE1, CSA_LFXTDRIVE2, CSA_LFXTDRIVE3. [Default] |
timeout | is the count value that gets decremented every time the loop that clears oscillator fault flags gets executed. |
Modified registers are CSCTL0, CSCTL4, CSCTL5 and SFRIFG1
References ASSERT, CSA_LFXT_DRIVE0, CSA_LFXT_DRIVE1, CSA_LFXT_DRIVE2, CSA_LFXT_DRIVE3, CSA_LFXTClockFrequency, HWREG, HWREGB, SFR_BASEADDRESS, STATUS_FAIL, and STATUS_SUCCESS.
void CSA_XT1Off | ( | unsigned int | baseAddress | ) |
void CSA_LFXTOff | ( | unsigned int | baseAddress | ) |
Stops the LFXT oscillator using the LFXTOFF bit.
baseAddress | is the base address of the CS module. |
Modified registers are CSCTL4
References HWREG.
void CSA_XT2Start | ( | unsigned int | baseAddress, |
unsigned int | hfxtdtive | ||
) |
void CSA_HFXTStart | ( | unsigned int | baseAddress, |
unsigned int | hfxtdrive | ||
) |
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 CSA_setExternalClockSource to set frequency of external clocks before calling this function.
baseAddress | is the base address of the CS module. |
hfxtdrive | is the target drive strength for the HFXT crystal oscillator. Valid values are CSA_HFXTDRIVE_0, CSA_HFXTDRIVE_1, CSA_HFXTDRIVE_2, CSA_HFXTDRIVE_3 [Default] |
Modified registers are CSCTL4, CSCTL5, SFRIFG1
References ASSERT, CSA_HFXTClockFrequency, CSA_HFXTDRIVE_16MHZ_24MHZ, CSA_HFXTDRIVE_24MHZ_32MHZ, CSA_HFXTDRIVE_4MHZ_8MHZ, CSA_HFXTDRIVE_8MHZ_16MHZ, HWREG, HWREGB, and SFR_BASEADDRESS.
void CSA_bypassXT2 | ( | unsigned int | baseAddress | ) |
void CSA_bypassHFXT | ( | unsigned int | baseAddress | ) |
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 CSA_setExternalClockSource to set frequency of external clocks before calling this function.
baseAddress | is the base address of the CS module. |
Modified registers are CSCTL4, CSCTL5, SFRIFG1
References ASSERT, CSA_HFXTClockFrequency, HWREG, HWREGB, and SFR_BASEADDRESS.
unsigned short CSA_XT2StartWithTimeout | ( | unsigned int | baseAddress, |
unsigned int | hfxtdtive, | ||
unsigned long | timeout | ||
) |
unsigned short CSA_HFXTStartWithTimeout | ( | unsigned int | baseAddress, |
unsigned int | hfxtdrive, | ||
unsigned long | 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 CSA_setExternalClockSource to set frequency of external clocks before calling this function.
baseAddress | is the base address of the CS module. |
hfxtdrive | is the target drive strength for the HFXT crystal oscillator. Valid values are CSA_HFXTDRIVE_0, CSA_HFXTDRIVE_1, CSA_HFXTDRIVE_2, CSA_HFXTDRIVE_3 [Default] |
timeout | is the count value that gets decremented every time the loop that clears oscillator fault flags gets executed. |
Modified registers are CSCTL4, CSCTL5, SFRIFG1
References ASSERT, CSA_HFXTClockFrequency, CSA_HFXTDRIVE_24MHZ_32MHZ, HWREG, HWREGB, SFR_BASEADDRESS, STATUS_FAIL, and STATUS_SUCCESS.
unsigned short CSA_bypassXT2WithTimeout | ( | unsigned int | baseAddress, |
unsigned long | timeout | ||
) |
unsigned short CSA_bypassHFXTWithTimeout | ( | unsigned int | baseAddress, |
unsigned long | 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 CSA_setExternalClockSource to set frequency of external clocks before calling this function.
baseAddress | is the base address of the CS module. |
timeout | is the count value that gets decremented every time the loop that clears oscillator fault flags gets executed. |
Modified registers are CSCTL4, CSCTL5, SFRIFG1G
References ASSERT, CSA_HFXTClockFrequency, HWREG, HWREGB, SFR_BASEADDRESS, STATUS_FAIL, and STATUS_SUCCESS.
void CSA_XT2Off | ( | unsigned int | baseAddress | ) |
void CSA_HFXTOff | ( | unsigned int | baseAddress | ) |
Stops the HFXT oscillator using the HFXTOFF bit.
baseAddress | is the base address of the CS module. |
Modified registers are CSCTL4
References CSA_HFXTOff().
Referenced by CSA_HFXTOff().
void CSA_enableClockRequest | ( | unsigned int | baseAddress, |
unsigned char | selectClock | ||
) |
Enables conditional module requests
baseAddress | is the base address of the CS module. |
selectClock | selects specific request enables. Valid values are CSA_ACLK, CSA_SMCLK, CSA_MCLK, CSA_MODOSC |
Modified registers are CSCTL6
References ASSERT, CSA_ACLK, CSA_MCLK, CSA_MODOSC, CSA_SMCLK, and HWREGB.
void CSA_disableClockRequest | ( | unsigned int | baseAddress, |
unsigned char | selectClock | ||
) |
Disables conditional module requests
baseAddress | is the base address of the CS module. |
selectClock | selects specific request enables. Valid values are CSA_ACLK, CSA_SMCLK, CSA_MCLK, CSA_MODOSC |
Modified registers are CSCTL6
References ASSERT, CSA_ACLK, CSA_MCLK, CSA_MODOSC, CSA_SMCLK, and HWREGB.
unsigned char CSA_faultFlagStatus | ( | unsigned int | baseAddress, |
unsigned char | mask | ||
) |
Gets the current CS fault flag status.
baseAddress | is the base address of the CS module. |
mask | is the masked interrupt flag status to be returned. Mask parameter can be either any of the following selection.
|
References ASSERT, CSA_HFXTOFFG, CSA_LFXTOFFG, and HWREGB.
void CSA_clearFaultFlag | ( | unsigned int | baseAddress, |
unsigned char | mask | ||
) |
Clears the current CS fault flag status for the masked bit.
baseAddress | is the base address of the CS module. |
mask | is the masked interrupt flag status to be returned. mask parameter can be any one of the following
|
References ASSERT, CSA_HFXTOFFG, CSA_LFXTOFFG, and HWREGB.
unsigned long CSA_getACLK | ( | unsigned int | baseAddress | ) |
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 CSA_externalClockSourceInit API was invoked before in case LFXT or HFXT is being used. User must call CSA_init before calling this function.
baseAddress | is the base address of the CS module. |
References HWREG, and privateCSAComputeCLKFrequency().
unsigned long CSA_getSMCLK | ( | unsigned int | baseAddress | ) |
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 CSA_externalClockSourceInit API was invoked before in case LFXT or HFXT is being used. User must call CSA_init before calling this function.
baseAddress | is the base address of the CS module. |
References HWREG, HWREGB, and privateCSAComputeCLKFrequency().
unsigned long CSA_getMCLK | ( | unsigned int | baseAddress | ) |
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 CSA_externalClockSourceInit API was invoked before in case LFXT or HFXT is being used. User must call CSA_init before calling this function.
baseAddress | is the base address of the CS module. |
References HWREG, and privateCSAComputeCLKFrequency().
unsigned int CSA_clearAllOscFlagsWithTimeout | ( | unsigned int | baseAddress, |
unsigned long | timeout | ||
) |
Clears all the Oscillator Flags
baseAddress | is the base address of the CS module. |
timeout | is the count value that gets decremented every time the loop that clears oscillator fault flags gets executed. |
Modified registers are CSCTL5, SFRIFG1G
References HWREGB, and SFR_BASEADDRESS.
void CSA_VLOoff | ( | unsigned int | baseAddress | ) |
Turns off VLO
USer must call CSA_init function before invoking this function. Modified registers are CSCTL4
References HWREG.
void CSA_setDCOFreq | ( | unsigned int | baseAddress, |
unsigned int | dcorsel, | ||
unsigned int | dcofsel | ||
) |
Set DCO frequency
Before invoking the this function, the user must call CSA_init.
baseAddress | is the base address of the CS module. |
dcofsel | selects valid frequency options based on dco frequency range selection (dcorsel). Valid options are: For FR58xx/FR59xx devices: CSA_DCOFSEL_0 - Low frequency option 1 MHZ. High frequency option 1 MHz. CSA_DCOFSEL_1 - Low frequency option 2.67 MHZ. High frequency option 5.33 MHz. CSA_DCOFSEL_2 Low frequency option 3.33 MHZ. High frequency option 6.67 MHz. CSA_DCOFSEL_3 Low frequency option 4 MHZ. High frequency option 8 MHz. CSA_DCOFSEL_4 Low frequency option 5.33 MHZ. High frequency option 16 MHz. CSA_DCOFSEL_5 Low frequency option 6.67 MHZ. High frequency option 20 MHz. CSA_DCOFSEL_6 Low frequency option 8 MHZ. High frequency option 24 MHz. |
dcorsel | selects frequency range option. Valid options are: CSA_DCORSEL_0 [Default - Low Frequency Option] CSA_DCORSEL_1 [High Frequency Option] |
References ASSERT, CSA_DCOFSEL_0, CSA_DCOFSEL_1, CSA_DCOFSEL_2, CSA_DCOFSEL_3, CSA_DCOFSEL_4, CSA_DCOFSEL_5, CSA_DCOFSEL_6, CSA_DCORSEL_0, CSA_DCORSEL_1, and HWREG.