aboutsummaryrefslogtreecommitdiffstats
path: root/demos/MSP430-MSP430x1611-GCC/board.h
blob: 8b335f64f84674bd942ae8318ff60f93fb52d4e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
    ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio.

    This file is part of ChibiOS/RT.

    ChibiOS/RT is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.

    ChibiOS/RT is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef _BOARD_H_
#define _BOARD_H_

#include <msp430x16x.h>

/*
 * Clock settings.
 */
#define MSP_USE_XT2CLK

#define LFXT1CLK        32768
#define XT2CLK          8000000
#define DCOCLK          1000000

#define ACLK            LFXT1CLK
#ifdef MSP_USE_XT2CLK
#define MCLK            XT2CLK
#define SMCLK           (XT2CLK / 8)
#else
#define MCLK            DCOCLK
#define SMCLK           DCOCLK
#endif

#define VAL_DCOCTL      (DCO0 | DCO1)
#ifdef MSP_USE_XT2CLK
#define VAL_BCSCTL1     (RSEL2)
#define VAL_BCSCTL2     (SELM_2 | DIVM_0 | DIVS_3 | SELS)
#else
#define VAL_BCSCTL1     (XT2OFF | RSEL2)
#define VAL_BCSCTL2     (SELM_0 | DIVM_0 | DIVS_0)
#endif

/*
 * Pin definitionsfor the Olimex MSP430-P1611 board.
 */
#define P3_O_TXD0       (1 << 4)
#define P3_I_RXD0       (1 << 5)
#define P6_O_LED        (1 << 0)
#define P6_I_BUTTON     (1 << 1)

/*
 * Initial I/O ports settings.
 */
#define VAL_P1OUT       0x00
#define VAL_P1DIR       0xFF
#define VAL_P1SEL       0x00

#define VAL_P2OUT       0x00
#define VAL_P2DIR       0xFF
#define VAL_P2SEL       0x00

#define VAL_P3OUT       P3_O_TXD0
#define VAL_P3DIR       ~P3_I_RXD0
#define VAL_P3SEL       0x00

#define VAL_P4OUT       0x00
#define VAL_P4DIR       0xFF
#define VAL_P4SEL       0x00

#define VAL_P5OUT       0x00
#define VAL_P5DIR       0xFF
#define VAL_P5SEL       0x00

#define VAL_P6OUT       P6_O_LED
#define VAL_P6DIR       ~P6_I_BUTTON
#define VAL_P6SEL       0x00

void hwinit(void);

#endif /* _BOARD_H_ */