BSP430  20141115
Board Support Package for MSP430 microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Macros
Platform-independent Secondary Timer Functionality

bsp430/periph/timer.h identifies a CCACLK secondary timer feature in a platform-independent manner. More...

Macros

#define BSP430_TIMER_CCACLK   include <bsp430/platform.h>
 
#define BSP430_TIMER_CCACLK_PERIPH_CPPID   include "bsp430_config.h"
 
#define BSP430_TIMER_CCACLK_PERIPH_HANDLE   derived platform or application specific
 
#define BSP430_TIMER_CCACLK_ACLK_CCIDX   include <bsp430/platform.h>
 
#define BSP430_TIMER_CCACLK_ACLK_CCIS   include <bsp430/platform.h>
 
#define BSP430_TIMER_CCACLK_CLK_PORT_PERIPH_CPPID   platform or application specific
 
#define BSP430_TIMER_CCACLK_CLK_PORT_PERIPH_HANDLE   derived platform or application specific
 
#define BSP430_TIMER_CCACLK_CLK_PORT_BIT   include <bsp430/platform.h>
 
#define BSP430_TIMER_CCACLK_CC0_PORT_PERIPH_CPPID   platform or application specific
 
#define BSP430_TIMER_CCACLK_CC0_PORT_PERIPH_HANDLE   derived platform or application specific
 
#define BSP430_TIMER_CCACLK_CC0_PORT_BIT   include <bsp430/platform.h>
 
#define BSP430_TIMER_CCACLK_CC0_CCIS   CCIS_0
 
#define BSP430_TIMER_CCACLK_CC1_PORT_PERIPH_CPPID   platform or application specific
 
#define BSP430_TIMER_CCACLK_CC1_PORT_PERIPH_HANDLE   derived platform or application specific
 
#define BSP430_TIMER_CCACLK_CC1_PORT_BIT   include <bsp430/platform.h>
 
#define BSP430_TIMER_CCACLK_CC1_CCIS   CCIS_0
 

Detailed Description

bsp430/periph/timer.h identifies a CCACLK secondary timer feature in a platform-independent manner.

The primary capability of this timer and the origin of its name is the ability to use ACLK as a capture/compare input source. This capability enables measuring the frequency of one clock relative to the frequency of ACLK, and is the foundation of several DCO calibration capabilities including iBSP430ucsTrimDCOCLKDIV_ni() and iBSP430bc2TrimToMCLK_ni(). Use of CCACLK in this role can be seen in Bootstrapping a New Platform: Clock Signals for DCO measurement, and in Sensors: HH10D for measuring an externally-supplied frequency.

A secondary role of this infrastructure is to identify a timer distinct from BSP430_UPTIME_TIMER_PERIPH_HANDLE which can be used by platform-independent applications for various purposes, such as alarms drive by a clock distinct from the bsp430/utility/uptime.h infrastructure. Use of CCACLK in this role can be seen in Peripherals: Alarms.

Note
Many of these features are enabled through functional configuration settings documented in Configuration of Functional Resources.

Multiplexed Alarm Infrastructure

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

Macro Definition Documentation

#define BSP430_TIMER_CCACLK   include <bsp430/platform.h>

Defined to a true value if ACLK-triggered timer captures are supported due to somebody providing BSP430_TIMER_CCACLK_PERIPH_CPPID.

Note
It is recommended that application code use of this feature be done in a non-interruptible context that is run-to-completion, to be sure that no other user is active. The configuration of the timer as a whole should be considered volatile. Proper use requires initializing the timer before use and stopping it when finished.
Warning
If ACLK is configured to source from XT1CLK and the crystal is faulted resulting in an internal fallback to VLOCLK, the capture/compare input remains the LFXT1 signal and no events will occur. This can be demonstrated on the EXP430G2 LaunchPad.
Dependency:
configBSP430_TIMER_CCACLK
Platform-Based Value:
Undefined here; include <bsp430/platform.h> to obtain the correct value of this macro.
#define BSP430_TIMER_CCACLK_ACLK_CCIDX   include <bsp430/platform.h>

The capture/compare block index within BSP430_TIMER_CCACLK_PERIPH_HANDLE that can use ACLK as an input signal.

Warning
See cautionary notes at BSP430_TIMER_VALID_COUNTER_READ_CCIDX.
Dependency:
BSP430_TIMER_CCACLK
Defaulted:
The value here is superseded by previously encountered definitions.
Platform-Based Value:
Undefined here; include <bsp430/platform.h> to obtain the correct value of this macro.
Examples:
bootstrap/clocks/main.c.
#define BSP430_TIMER_CCACLK_ACLK_CCIS   include <bsp430/platform.h>

The capture/compare block input signal bits to be selected in the control word for CC block BSP430_TIMER_CCACLK_ACLK_CCIDX of BSP430_TIMER_CCACLK_PERIPH_HANDLE to use ACLK as an input signal.

Dependency:
BSP430_TIMER_CCACLK
Defaulted:
The value here is superseded by previously encountered definitions.
Platform-Based Value:
Undefined here; include <bsp430/platform.h> to obtain the correct value of this macro.
Examples:
bootstrap/clocks/main.c.
#define BSP430_TIMER_CCACLK_CC0_CCIS   CCIS_0

The CCIS setting required to support CC0 on pin BSP430_TIMER_CCACLK_CC0_PORT_BIT of BSP430_TIMER_CCACLK_CC0_PORT_PERIPH_HANDLE.

The default setting corresponds to CCIxA.

Defaulted:
The value here is superseded by previously encountered definitions.
#define BSP430_TIMER_CCACLK_CC0_PORT_BIT   include <bsp430/platform.h>

The pin on BSP430_TIMER_CCACLK_CC0_PORT_PERIPH_HANDLE to which the external trigger for CC0 on BSP430_TIMER_CCACLK_PERIPH_HANDLE can be connected.

Defaulted:
The value here is superseded by previously encountered definitions.
Platform-Based Value:
Undefined here; include <bsp430/platform.h> to obtain the correct value of this macro.
#define BSP430_TIMER_CCACLK_CC0_PORT_PERIPH_CPPID   platform or application specific

The preprocessor-compatible identifier for a port that provides an external trigger on CC0 for BSP430_TIMER_CCACLK_PERIPH_HANDLE.

The define must appear in the BSP430 Configuration subsystem so that functional resource requests are correctly propagated to the underlying resource instances.

Defaulted:
The value here is superseded by previously encountered definitions.
Dependency:
configBSP430_TIMER_CCACLK_CC0_PORT
#define BSP430_TIMER_CCACLK_CC0_PORT_PERIPH_HANDLE   derived platform or application specific

The BSP430 port peripheral corresponding to BSP430_TIMER_CCACLK_CC0_PORT_PERIPH_CPPID.

#define BSP430_TIMER_CCACLK_CC1_CCIS   CCIS_0

The CCIS setting required to support CC1 on pin BSP430_TIMER_CCACLK_CC1_PORT_BIT of BSP430_TIMER_CCACLK_CC1_PORT_PERIPH_HANDLE.

The default setting corresponds to CCIxA.

Defaulted:
The value here is superseded by previously encountered definitions.
#define BSP430_TIMER_CCACLK_CC1_PORT_BIT   include <bsp430/platform.h>

The pin on BSP430_TIMER_CCACLK_CC1_PORT_PERIPH_HANDLE to which the external trigger for CC1 on BSP430_TIMER_CCACLK_PERIPH_HANDLE can be connected.

Defaulted:
The value here is superseded by previously encountered definitions.
Platform-Based Value:
Undefined here; include <bsp430/platform.h> to obtain the correct value of this macro.
#define BSP430_TIMER_CCACLK_CC1_PORT_PERIPH_CPPID   platform or application specific

The preprocessor-compatible identifier for a port that provides an external trigger on CC1 for BSP430_TIMER_CCACLK_PERIPH_HANDLE.

The define must appear in the BSP430 Configuration subsystem so that functional resource requests are correctly propagated to the underlying resource instances.

Defaulted:
The value here is superseded by previously encountered definitions.
#define BSP430_TIMER_CCACLK_CC1_PORT_PERIPH_HANDLE   derived platform or application specific

The BSP430 port peripheral corresponding to BSP430_TIMER_CCACLK_CC1_PORT_PERIPH_CPPID.

Dependency:
configBSP430_TIMER_CCACLK_CC1_PORT
#define BSP430_TIMER_CCACLK_CLK_PORT_BIT   include <bsp430/platform.h>

The pin on BSP430_TIMER_CCACLK_CLK_PORT_PERIPH_HANDLE to which the external clock source for BSP430_TIMER_CCACLK_PERIPH_HANDLE can be connected.

Defaulted:
The value here is superseded by previously encountered definitions.
Platform-Based Value:
Undefined here; include <bsp430/platform.h> to obtain the correct value of this macro.
#define BSP430_TIMER_CCACLK_CLK_PORT_PERIPH_CPPID   platform or application specific

The preprocessor-compatible identifier for a port that provides the input clock function for BSP430_TIMER_CCACLK_PERIPH_HANDLE.

The define must appear in the BSP430 Configuration subsystem so that functional resource requests are correctly propagated to the underlying resource instances.

Defaulted:
The value here is superseded by previously encountered definitions.
#define BSP430_TIMER_CCACLK_CLK_PORT_PERIPH_HANDLE   derived platform or application specific

The BSP430 port peripheral corresponding to BSP430_TIMER_CCACLK_CLK_PORT_PERIPH_CPPID.

Dependency:
configBSP430_TIMER_CCACLK_CLK_PORT
#define BSP430_TIMER_CCACLK_PERIPH_CPPID   include "bsp430_config.h"

The preprocessor-compatible identifier for a timer that is capable of capturing on ACLK ticks.

The define must appear in the BSP430 Configuration subsystem so that functional resource requests are correctly propagated to the underlying resource instances.

Defaulted:
The value here is superseded by previously encountered definitions.
Platform-Based Value:
Undefined here; include <bsp430/platform.h> to obtain the correct value of this macro.
Affects:
BSP430_TIMER_CCACLK_PERIPH_HANDLE
#define BSP430_TIMER_CCACLK_PERIPH_HANDLE   derived platform or application specific

Defined to the peripheral identifier for a timer that can be used to maintain a continuous system clock sourced from ACLK. This derives directly from BSP430_TIMER_CCACLK_PERIPH_CPPID, but is a timer peripheral handle suitable for use in code.

Dependency:
BSP430_TIMER_CCACLK_PERIPH_CPPID
Examples:
bootstrap/clocks/main.c.