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
32extern "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
76
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
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
181#ifdef __cplusplus
182}
183#endif
184
185#endif /* F2XX_G2XX_MSP430_REGS_H */
#define REG8
Register types.
msp430_usci_a_t USCI_A0
USCI_A0 register map.
msp430_usci_b_t USCI_B1
USCI_B1 register map.
msp430_usci_b_t USCI_B0
USCI_B0 register map.
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
msp430_usci_a_t USCI_A1
USCI_A1 register map.
Cortex CMSIS style definition of MSP430 registers.
Universal Serial Control Interface Type A (USCI_A) Registers.
Definition msp430_regs.h:63
REG8 MCTL
modulation control
Definition msp430_regs.h:71
REG8 IRTCTL
IrDA transmit control.
Definition msp430_regs.h:65
REG8 TXBUF
transmit buffer
Definition msp430_regs.h:74
REG8 ABCTL
auto baud rate control
Definition msp430_regs.h:64
REG8 BR1
baud rate control 1
Definition msp430_regs.h:70
REG8 BR0
baud rate control 0
Definition msp430_regs.h:69
REG8 STAT
status register
Definition msp430_regs.h:72
REG8 RXBUF
receive buffer
Definition msp430_regs.h:73
REG8 CTL1
control 1
Definition msp430_regs.h:68
REG8 IRRCTL
IrDA receive control.
Definition msp430_regs.h:66
REG8 CTL0
control 0
Definition msp430_regs.h:67
Universal Serial Control Interface Type B (USCI_B) Registers.
Definition msp430_regs.h:80
REG8 RXBUF
receive buffer
Definition msp430_regs.h:87
REG8 BR1
baud rate control 1
Definition msp430_regs.h:84
REG8 BR0
baud rate control 0
Definition msp430_regs.h:83
REG8 STAT
status register
Definition msp430_regs.h:86
REG8 CTL1
control 1
Definition msp430_regs.h:82
REG8 CTL0
control 0
Definition msp430_regs.h:81
REG8 TXBUF
transmit buffer
Definition msp430_regs.h:88
REG8 MCTL
modulation control
Definition msp430_regs.h:85