BSP430
20141115
Board Support Package for MSP430 microcontrollers
|
Hardware presentation/abstraction for Clock System (CS). More...
Go to the source code of this file.
Macros | |
#define | BSP430_CS_IS_FR58XX (BSP430_PERIPH_CS_IS_CSA - 0) |
#define | BSP430_CS_IS_FR57XX (defined(__MSP430_HAS_CS__) && (! ((BSP430_PERIPH_CS_IS_CSA - 0) || (BSP430_PERIPH_CS_IS_CS4 - 0)))) |
#define | BSP430_MODULE_CS ((BSP430_CS_IS_FR57XX - 0) || (BSP430_CS_IS_FR58XX - 0)) |
#define | BSP430_CS_NOMINAL_MODCLK_HZ 5000000UL |
#define | BSP430_CS_NOMINAL_LFMODCLK_HZ (BSP430_CS_NOMINAL_MODCLK_HZ / 128) |
#define | BSP430_CS_LFXT1_IS_FAULTED_NI() (CSCTL5 & BSP430_CS_XT1OFFG_) |
#define | BSP430_CS_XT2_IS_FAULTED_NI() (CSCTL5 & BSP430_CS_XT2OFFG_) |
#define | BSP430_CLOCK_LFXT1_IS_FAULTED_NI() ((CSCTL4 & BSP430_CS_XT1OFF_) || BSP430_CS_LFXT1_IS_FAULTED_NI()) |
#define | BSP430_CLOCK_XT2_IS_FAULTED_NI() ((CSCTL4 & BSP430_CS_XT2OFF_) || BSP430_CS_XT2_IS_FAULTED_NI()) |
#define | BSP430_CS_CLEAR_FAULTS_NI() |
#define | BSP430_CLOCK_CLEAR_FAULTS_NI() |
#define | BSP430_CS_FRAM_NWAITS_FOR_FREQ(freq_) include <bsp430/platform.h> |
#define | BSP430_CLOCK_NOMINAL_VLOCLK_HZ 10000U |
#define | BSP430_CLOCK_PUC_MCLK_HZ 1048576UL |
Hardware presentation/abstraction for Clock System (CS).
The Clock System (CS) peripheral is present in FR5xx-family devices. Variant CS is used in FR57xx devices; variant CS_A is used in FR58xx/FR59xx devices. They differ in the names for constants related to low and high frequency crystals, in the set of supported DCOCLK frequencies, and in whether DCOCLK can source ACLK.
None supported.
As there can be only one instance of CS on any MCU, there is no structure supporting a CS HPL. Manipulate the peripheral through its registers directly.
As there can be only one instance of CS on any MCU, there is no structure supporting a CS HAL.
The standard set of capabilities in the bsp430/clocks.h header are supported, with the following details:
#define BSP430_CLOCK_CLEAR_FAULTS_NI | ( | ) |
#define BSP430_CLOCK_LFXT1_IS_FAULTED_NI | ( | ) | ((CSCTL4 & BSP430_CS_XT1OFF_) || BSP430_CS_LFXT1_IS_FAULTED_NI()) |
Check whether the CS-controlled LFXT1 crystal has a fault condition.
#define BSP430_CLOCK_NOMINAL_VLOCLK_HZ 10000U |
Unconditional define for peripheral-specific constant
#define BSP430_CLOCK_PUC_MCLK_HZ 1048576UL |
Unconditional define for peripheral-specific constant
#define BSP430_CLOCK_XT2_IS_FAULTED_NI | ( | ) | ((CSCTL4 & BSP430_CS_XT2OFF_) || BSP430_CS_XT2_IS_FAULTED_NI()) |
Check whether the CS-controlled XT2 crystal has a fault condition.
#define BSP430_CS_CLEAR_FAULTS_NI | ( | ) |
Clear all CS-specific faults.
#define BSP430_CS_FRAM_NWAITS_FOR_FREQ | ( | freq_ | ) | include <bsp430/platform.h> |
Determine FRAM wait states required for clock speed.
This is a platform-specific macro to select the appropriate number of wait states required for reliable FRAM access when using a given system clock speed. It should be defined in the platform.h header, based on values specified in the data sheet under Recommended Operating Conditions for f_SYSTEM. A value of zero is used if a negative value is requested.
freq_ | Desired f_SYSTEM (maximum RAM access frequency) |
#define BSP430_CS_IS_FR57XX (defined(__MSP430_HAS_CS__) && (! ((BSP430_PERIPH_CS_IS_CSA - 0) || (BSP430_PERIPH_CS_IS_CS4 - 0)))) |
Determine whether target has a CS or CS_A peripheral.
This macro is defined to a true value if the target peripheral has the FR57xx variant of the CS module.
#define BSP430_CS_IS_FR58XX (BSP430_PERIPH_CS_IS_CSA - 0) |
Determine whether target has a CS or CS_A peripheral.
The base CS peripheral as defined in the FR57xx family has a different set of available clocks and differences in register layout and configurable clock rates from the variant in the FR58xx/FR59xx, which was distinguished as CS_A in the header files originally released for the Wolverine chips. Subsequently TI decided to eliminate the difference in name, while retaining the difference in interface and functionality. This occurs in public release version 1.073 of the MSP430 headers.
This macro is defined to a true value if the target peripheral has the FR58xx variant of the CS module. It uses MSP430_HAS_CS_A
if available, otherwise depends on the presence of DCOFSEL2
, a bit not available on the original CS peripheral.
#define BSP430_CS_LFXT1_IS_FAULTED_NI | ( | ) | (CSCTL5 & BSP430_CS_XT1OFFG_) |
CS-specific check for LFXT1 crystal fault condition.
This checks exactly for the fault condition.
#define BSP430_CS_NOMINAL_LFMODCLK_HZ (BSP430_CS_NOMINAL_MODCLK_HZ / 128) |
Nominal rate of the CS_A peripheral LFMODCLK.
This source exists only in the CS_A version of the CS peripheral. It is driven by an internal low-power oscillator.
#define BSP430_CS_NOMINAL_MODCLK_HZ 5000000UL |
The CS_A module supports an internal low-precision high-frequency module clock source running at a nominal 5 MHz rate, for use where SMCLK is unsuitable. Its rate varies with temperature, voltage, and individual device.
This source exists only in the CS_A version of the CS peripheral.
#define BSP430_CS_XT2_IS_FAULTED_NI | ( | ) | (CSCTL5 & BSP430_CS_XT2OFFG_) |
CS-specific check for XT2 crystal fault condition.
If the platform does not support an XT2 crystal no fault is diagnosed.
#define BSP430_MODULE_CS ((BSP430_CS_IS_FR57XX - 0) || (BSP430_CS_IS_FR58XX - 0)) |
Defined on inclusion of <bsp430/periph/cs.h>. The value evaluates to true if the target MCU supports the Clock System peripheral, and false if it does not.