The friendly Operating System for the Internet of Things
cc430_regs.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Freie Universit├Ąt Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
23 #ifndef CC430_REGS_H
24 #define CC430_REGS_H
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
33 #define REG8 volatile uint8_t
34 
38 #define REG16 volatile uint16_t
39 
43 typedef struct {
45  REG16 CCTL[7];
46  REG16 R;
47  REG16 CCR[7];
48  REG16 reserved[7];
51 } msp_timer_t;
52 
57 #define CTL_IFG (0x0001)
58 #define CTL_IE (0x0002)
59 #define CTL_CLR (0x0004)
60 #define CTL_MC_MASK (0x0030)
61 #define CTL_MC_STOP (0x0000)
62 #define CTL_MC_UP (0x0010)
63 #define CTL_MC_CONT (0x0020)
64 #define CTL_MC_UPDOWN (0x0030)
65 #define CTL_ID_MASK (0x00c0)
66 #define CTL_ID_DIV1 (0x0000)
67 #define CTL_ID_DIV2 (0x0040)
68 #define CTL_ID_DIV4 (0x0080)
69 #define CTL_ID_DIV8 (0x00c0)
70 #define CTL_TASSEL_MASK (0x0300)
71 #define CTL_TASSEL_TCLK (0x0000)
72 #define CTL_TASSEL_ACLK (0x0100)
73 #define CTL_TASSEL_SMCLK (0x0200)
74 #define CTL_TASSEL_INV_TCLK (0x0300)
75 
81 #define CCTL_CCIFG (0x0001)
82 #define CCTL_COV (0x0002)
83 #define CCTL_OUT (0x0004)
84 #define CCTL_CCI (0x0008)
85 #define CCTL_CCIE (0x0010)
86 #define CCTL_OUTMOD_MASK (0x00e0)
87 #define CCTL_OUTMOD_OUTVAL (0x0000)
88 #define CCTL_OUTMOD_SET (0x0020)
89 #define CCTL_OUTMOD_TOG_RESET (0x0040)
90 #define CCTL_OUTMOD_SET_RESET (0x0060)
91 #define CCTL_OUTMOD_TOGGLE (0x0080)
92 #define CCTL_OUTMOD_RESET (0x00a0)
93 #define CCTL_OUTMOD_TOG_SET (0x00c0)
94 #define CCTL_OUTMOD_RESET_SET (0x00e0)
95 #define CCTL_CAP (0x0100)
96 #define CCTL_CLLD_MASK (0x0600)
97 #define CCTL_SCS (0x0800)
98 #define CCTL_CCIS_MASK (0x3000)
99 #define CCTL_CM_MASK (0xc000)
100 
106 #define TIMER_A0_BASE ((uint16_t)0x0340)
107 #define TIMER_A1_BASE ((uint16_t)0x0380)
108 
114 #define TIMER_A0 ((msp_timer_t *)TIMER_A0_BASE)
115 #define TIMER_A1 ((msp_timer_t *)TIMER_A1_BASE)
116 
118 #ifdef __cplusplus
119 }
120 #endif
121 
122 #endif /* CC430_REGS_H */
123 
#define REG16
Shortcut to specify 16-bit wide registers.
Definition: cc430_regs.h:38
REG16 IV
interrupt vector
Definition: cc430_regs.h:49
REG16 CTL
timer control
Definition: cc430_regs.h:44
Timer module registers.
Definition: cc430_regs.h:43
REG16 R
current counter value
Definition: cc430_regs.h:46
REG16 EX0
expansion 0
Definition: cc430_regs.h:50