Toggle navigation
Documentation
The friendly Operating System for the Internet of Things
Loading...
Searching...
No Matches
msp430_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 F2XX_G2XX_MSP430_REGS_H
24
#define F2XX_G2XX_MSP430_REGS_H
25
26
#include <stdint.h>
27
#include <stddef.h>
28
29
#include "
msp430_regs_common.h
"
30
31
#ifdef __cplusplus
32
extern
"C"
{
33
#endif
34
44
#define MSP430_USCI_A_B_OFFSET 3U
45
57
#define MSP430_USCI_B_FROM_USCI_A(usci_a) \
58
((msp430_usci_b_t *)((uintptr_t)(usci_a) + MSP430_USCI_A_B_OFFSET))
59
63
typedef
struct
{
64
REG8
ABCTL
;
65
REG8
IRTCTL
;
66
REG8
IRRCTL
;
67
REG8
CTL0
;
68
REG8
CTL1
;
69
REG8
BR0
;
70
REG8
BR1
;
71
REG8
MCTL
;
72
REG8
STAT
;
73
REG8
RXBUF
;
74
REG8
TXBUF
;
75
}
msp430_usci_a_t
;
76
80
typedef
struct
{
81
REG8
CTL0
;
82
REG8
CTL1
;
83
REG8
BR0
;
84
REG8
BR1
;
85
REG8
MCTL
;
86
REG8
STAT
;
87
REG8
RXBUF
;
88
REG8
TXBUF
;
89
}
msp430_usci_b_t
;
90
99
#define UCSSEL_UCLKI UCSSEL_0
100
#define UCSSEL_ACLK UCSSEL_1
101
#define UCSSEL_SMCLK UCSSEL_2
103
#if (UCSSEL0 == 0x40) || DOXYGEN
104
# define UCSSEL_Pos 6
105
#else
106
# error "USSEL field in USCI CTL1 register is at unexpected position"
107
#endif
118
#define UCBRS_MASK UCBRS_7
120
#if (UCBRS_7 == 0x0E) || defined(DOXYGEN)
121
# define UCBRS_Pos 1
123
#else
124
/* The datasheet for the whole MCU family states the field is in bits 3-1,
125
* but let's better be safe than sorry here */
126
# error "UCBRS field in the UCAxMCTL register at unexpected position."
127
#endif
128
145
static
inline
msp430_usci_b_t
*
msp430_usci_b_from_usci_a
(
msp430_usci_a_t
*usci_a)
146
{
147
uintptr_t usci_b = (uintptr_t)usci_a + offsetof(
msp430_usci_a_t
, CTL0);
148
return
(
msp430_usci_b_t
*)usci_b;
149
}
150
160
extern
msp430_usci_a_t
USCI_A0
;
166
extern
msp430_usci_a_t
USCI_A1
;
172
extern
msp430_usci_b_t
USCI_B0
;
178
extern
msp430_usci_b_t
USCI_B1
;
181
#ifdef __cplusplus
182
}
183
#endif
184
185
#endif
/* F2XX_G2XX_MSP430_REGS_H */
REG8
#define REG8
Register types.
Definition
atmega_regs_common.h:40
USCI_A0
msp430_usci_a_t USCI_A0
USCI_A0 register map.
USCI_B1
msp430_usci_b_t USCI_B1
USCI_B1 register map.
USCI_B0
msp430_usci_b_t USCI_B0
USCI_B0 register map.
msp430_usci_b_from_usci_a
static msp430_usci_b_t * msp430_usci_b_from_usci_a(msp430_usci_a_t *usci_a)
"Convert" a USCI A into an USCI B interface
Definition
msp430_regs.h:145
USCI_A1
msp430_usci_a_t USCI_A1
USCI_A1 register map.
msp430_regs_common.h
Cortex CMSIS style definition of MSP430 registers.
msp430_usci_a_t
Universal Serial Control Interface Type A (USCI_A) Registers.
Definition
msp430_regs.h:63
msp430_usci_a_t::MCTL
REG8 MCTL
modulation control
Definition
msp430_regs.h:71
msp430_usci_a_t::IRTCTL
REG8 IRTCTL
IrDA transmit control.
Definition
msp430_regs.h:65
msp430_usci_a_t::TXBUF
REG8 TXBUF
transmit buffer
Definition
msp430_regs.h:74
msp430_usci_a_t::ABCTL
REG8 ABCTL
auto baud rate control
Definition
msp430_regs.h:64
msp430_usci_a_t::BR1
REG8 BR1
baud rate control 1
Definition
msp430_regs.h:70
msp430_usci_a_t::BR0
REG8 BR0
baud rate control 0
Definition
msp430_regs.h:69
msp430_usci_a_t::STAT
REG8 STAT
status register
Definition
msp430_regs.h:72
msp430_usci_a_t::RXBUF
REG8 RXBUF
receive buffer
Definition
msp430_regs.h:73
msp430_usci_a_t::CTL1
REG8 CTL1
control 1
Definition
msp430_regs.h:68
msp430_usci_a_t::IRRCTL
REG8 IRRCTL
IrDA receive control.
Definition
msp430_regs.h:66
msp430_usci_a_t::CTL0
REG8 CTL0
control 0
Definition
msp430_regs.h:67
msp430_usci_b_t
Universal Serial Control Interface Type B (USCI_B) Registers.
Definition
msp430_regs.h:80
msp430_usci_b_t::RXBUF
REG8 RXBUF
receive buffer
Definition
msp430_regs.h:87
msp430_usci_b_t::BR1
REG8 BR1
baud rate control 1
Definition
msp430_regs.h:84
msp430_usci_b_t::BR0
REG8 BR0
baud rate control 0
Definition
msp430_regs.h:83
msp430_usci_b_t::STAT
REG8 STAT
status register
Definition
msp430_regs.h:86
msp430_usci_b_t::CTL1
REG8 CTL1
control 1
Definition
msp430_regs.h:82
msp430_usci_b_t::CTL0
REG8 CTL0
control 0
Definition
msp430_regs.h:81
msp430_usci_b_t::TXBUF
REG8 TXBUF
transmit buffer
Definition
msp430_regs.h:88
msp430_usci_b_t::MCTL
REG8 MCTL
modulation control
Definition
msp430_regs.h:85
Generated on Wed May 8 2024 14:02:40 by
1.9.8