BSP430  20141115
Board Support Package for MSP430 microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Macros
fllplus.h File Reference

Hardware presentation/abstraction for FLL Plus (FLLPLUS). More...

#include <bsp430/clock.h>
#include <bsp430/periph.h>

Go to the source code of this file.

Macros

#define BSP430_MODULE_FLLPLUS
 
#define BSP430_FLLPLUS_LFXT1_IS_FAULTED_NI()   (FLL_CTL0 & LFOF)
 
#define BSP430_FLLPLUS_XT2_IS_FAULTED_NI()   (FLL_CTL0 & BSP430_FLLPLUS_XT2OF_)
 
#define BSP430_FLLPLUS_DCO_IS_FAULTED_NI()   (FLL_CTL0 & DCOF)
 
#define BSP430_CLOCK_LFXT1_IS_FAULTED_NI()   BSP430_FLLPLUS_LFXT1_IS_FAULTED_NI()
 
#define BSP430_CLOCK_XT2_IS_FAULTED_NI()   ((BCSCTL1 & XT2OFF) || BSP430_FLLPLUS_XT2_IS_FAULTED_NI())
 
#define BSP430_CLOCK_CLEAR_FAULTS_NI()
 
#define BSP430_FLLPLUS_XCAPxPF   XCAP0PF
 
#define BSP430_CLOCK_LFXT1_XCAP   XCAP0PF
 
#define BSP430_CLOCK_NOMINAL_VLOCLK_HZ   12000U
 
#define BSP430_CLOCK_PUC_MCLK_HZ   1048576UL
 

Detailed Description

Hardware presentation/abstraction for FLL Plus (FLLPLUS).

The FLLPLUS and FLLPLUS_SMALL peripherals are present in 4xx-family devices.

FLLPLUS_SMALL differs from FLLPLUS in lack of support for XT2 and for SELM/SELS. The difference is not reflected in this implementation.

Module Configuration Options

None supported.

Hardware Presentation Layer

As there can be only one instance of FLLPLUS on any MCU, there is no structure supporting a FLLPLUS HPL. Manipulate the peripheral through its registers directly.

Hardware Adaptation Layer

As there can be only one instance of FLLPLUS on any MCU, there is no structure supporting a FLLPLUS HAL.

The standard set of capabilities in the bsp430/clocks.h header are supported, with the following details:

Homepage
http://github.com/pabigot/bsp430

Macro Definition Documentation

#define BSP430_CLOCK_CLEAR_FAULTS_NI ( )
Value:
do { \
} while (0)
#define BSP430_CLOCK_OSC_CLEAR_FAULT_NI()
Definition: clock.h:230

Clear all clock faults.

The FLL+ oscillator fault flags are read-only, so this only clears the system oscillator flag.

Defaulted:
The value here is superseded by previously encountered definitions.
#define BSP430_CLOCK_LFXT1_IS_FAULTED_NI ( )    BSP430_FLLPLUS_LFXT1_IS_FAULTED_NI()

Check whether the FLL+-controlled LFXT1 crystal has a fault condition.

Note
BSP430 currently does not support MSP430F41x2 devices which allow LXFT1 to be something other than a crystal, so the standard check for disabled LFXT1 does not apply on this peripheral.
Defaulted:
The value here is superseded by previously encountered definitions.
See also
BSP430_FLLPLUS_LFXT1_IS_FAULTED_NI()
#define BSP430_CLOCK_LFXT1_XCAP   XCAP0PF

Peripheral default setting for platform-specific constant.

Note: TI examples tend to use XCAP14PF but on the EXP430FG4618 that results in a clock rate of 32765, or 100 ppm error. XCAP0F is the power-up default, and measures 32769 or only 30ppm error.

#define BSP430_CLOCK_NOMINAL_VLOCLK_HZ   12000U

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 ( )    ((BCSCTL1 & XT2OFF) || BSP430_FLLPLUS_XT2_IS_FAULTED_NI())

Check whether the FLL+-controlled XT2 crystal has a fault condition.

Note
Oscillator fault flags are not set unless a fault has been detected. If the crystal has never been enabled, no fault will have been detected. On power-up, the XT2IN function is not enabled and BCSCTL1.XT2OFF is set, and BSP430 treats BCSCTL1.XT2OFF as an indication that the pins are not configured for crystal use, either because XT2 has not been configured or has been configured and found to be faulted. Although it is perfectly acceptable to have BCSCTL1.XT2OFF set and the crystal working fine, the complexity of detecting that case is not supported by this implementation.
Defaulted:
The value here is superseded by previously encountered definitions.
See also
BSP430_FLLPLUS_XT2_IS_FAULTED_NI()
#define BSP430_FLLPLUS_DCO_IS_FAULTED_NI ( )    (FLL_CTL0 & DCOF)

FLL+-specific check for DCO fault condition.

This checks exactly for the fault condition.

#define BSP430_FLLPLUS_LFXT1_IS_FAULTED_NI ( )    (FLL_CTL0 & LFOF)

FLL+-specific check for LFXT1 crystal fault condition.

This checks exactly for the fault condition.

#define BSP430_FLLPLUS_XCAPxPF   XCAP0PF
Deprecated:
Use BSP430_CLOCK_LFXT1_XCAP
Defaulted:
The value here is superseded by previously encountered definitions.
#define BSP430_FLLPLUS_XT2_IS_FAULTED_NI ( )    (FLL_CTL0 & BSP430_FLLPLUS_XT2OF_)

FLL+-specific check for XT2 crystal fault condition.

If the platform does not support an XT2 crystal no fault is diagnosed.

Note
A crystal that has never been enabled will not register as faulted.
#define BSP430_MODULE_FLLPLUS
Value:
(defined(__MSP430_HAS_FLLPLUS__) \
|| defined(__MSP430_HAS_FLLPLUS_SMALL__))

Defined on inclusion of <bsp430/periph/fllplus.h>. The value evaluates to true if the target MCU supports the FLL Plus module, and false if it does not.

C Preprocessor Only:
This macro may have a value that restricts its use to C preprocessor conditional directives.